mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-15 07:54:17 +01:00
build(opensuse): improve opensuse build process.
This commit is contained in:
parent
233b1f2f0e
commit
158c6006b1
4
Makefile
4
Makefile
@ -26,7 +26,7 @@ full: build
|
|||||||
ROOT = $(shell find "${BUILD}/root" -type f -printf "%P\n")
|
ROOT = $(shell find "${BUILD}/root" -type f -printf "%P\n")
|
||||||
PROFILES = $(shell find "${BUILD}/apparmor.d" -type f -printf "%P\n")
|
PROFILES = $(shell find "${BUILD}/apparmor.d" -type f -printf "%P\n")
|
||||||
install:
|
install:
|
||||||
@install -Dm755 ${BUILD}/aa-log ${DESTDIR}/usr/bin/aa-log
|
@install -Dm0755 ${BUILD}/aa-log ${DESTDIR}/usr/bin/aa-log
|
||||||
@for file in ${ROOT}; do \
|
@for file in ${ROOT}; do \
|
||||||
install -Dm0644 "${BUILD}/root/$${file}" "${DESTDIR}/$${file}"; \
|
install -Dm0644 "${BUILD}/root/$${file}" "${DESTDIR}/$${file}"; \
|
||||||
done;
|
done;
|
||||||
@ -78,7 +78,7 @@ dpkg:
|
|||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
@bash dists/build.sh rpm
|
@bash dists/build.sh rpm
|
||||||
@sudo rpm -i ${PKGNAME}-*.rpm
|
@sudo rpm -ivh --force ${PKGNAME}-*.rpm
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
@go test ./cmd/... -v -cover -coverprofile=coverage.out
|
@go test ./cmd/... -v -cover -coverprofile=coverage.out
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
readonly COMMAND="$1"
|
readonly COMMAND="$1"
|
||||||
readonly OUTPUT="${PKGDEST:-$PWD}"
|
readonly OUTPUT="$PWD"
|
||||||
|
readonly PKGDEST="${PKGDEST:-$PWD}"
|
||||||
readonly PKGNAME=apparmor.d
|
readonly PKGNAME=apparmor.d
|
||||||
VERSION="0.$(git rev-list --count HEAD)"
|
VERSION="0.$(git rev-list --count HEAD)"
|
||||||
readonly VERSION
|
readonly VERSION
|
||||||
@ -27,7 +28,7 @@ main() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
rpm)
|
rpm)
|
||||||
RPMBUILD_ROOT=$(mktemp -d)
|
RPMBUILD_ROOT=$(mktemp -d /tmp/$PKGNAME.XXXXXX)
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
readonly RPMBUILD_ROOT ARCH
|
readonly RPMBUILD_ROOT ARCH
|
||||||
|
|
||||||
@ -39,7 +40,7 @@ main() {
|
|||||||
sed -i "s/^Version:.*/Version: $VERSION/" "SPECS/$PKGNAME.spec"
|
sed -i "s/^Version:.*/Version: $VERSION/" "SPECS/$PKGNAME.spec"
|
||||||
rpmbuild -bb --define "_topdir $RPMBUILD_ROOT" "SPECS/$PKGNAME.spec"
|
rpmbuild -bb --define "_topdir $RPMBUILD_ROOT" "SPECS/$PKGNAME.spec"
|
||||||
|
|
||||||
cp "$RPMBUILD_ROOT/RPMS/$ARCH/"*.rpm "$OUTPUT"
|
mv "$RPMBUILD_ROOT/RPMS/$ARCH/"*.rpm "$OUTPUT"
|
||||||
rm -rf "$RPMBUILD_ROOT"
|
rm -rf "$RPMBUILD_ROOT"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user