mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
build: better way to handle package build for development purpose.
This commit is contained in:
parent
2f455786e7
commit
d717a24adc
52
Makefile
52
Makefile
@ -6,15 +6,22 @@
|
||||
DESTDIR ?= /
|
||||
BUILD := .build
|
||||
PKGNAME := apparmor.d
|
||||
DISTRIBUTION := $(shell lsb_release --id --short)
|
||||
VERSION := 0.$(shell git rev-list --count HEAD)-1
|
||||
P = $(notdir $(wildcard ${BUILD}/apparmor.d/*))
|
||||
|
||||
.PHONY: all install auto local $(P) lint archlinux debian ubuntu whonix clean
|
||||
.PHONY: all build enforce full install local $(P) pkg dpkg rpm lint clean
|
||||
|
||||
all:
|
||||
all: build
|
||||
|
||||
build:
|
||||
@go build -o ${BUILD}/ ./cmd/aa-log
|
||||
|
||||
enforce: build
|
||||
@./${BUILD}/prebuild
|
||||
|
||||
full: build
|
||||
@./${BUILD}/prebuild --complain --full
|
||||
|
||||
ROOT = $(shell find "${BUILD}/root" -type f -printf "%P\n")
|
||||
PROFILES = $(shell find "${BUILD}/apparmor.d" -type f -printf "%P\n")
|
||||
install:
|
||||
@ -34,17 +41,6 @@ install:
|
||||
install -Dm0644 "$${file}" "${DESTDIR}/usr/lib/systemd/user/$${service}.d/apparmor.conf"; \
|
||||
done
|
||||
|
||||
auto:
|
||||
@[ ${DISTRIBUTION} = Arch ] || exit 0; \
|
||||
makepkg --syncdeps --install --cleanbuild --force --noconfirm
|
||||
@[ ${DISTRIBUTION} = Ubuntu ] || exit 0; \
|
||||
dch --newversion="${VERSION}" --urgency=medium --distribution=stable --controlmaint "Release ${VERSION}"; \
|
||||
dpkg-buildpackage -b -d --no-sign; \
|
||||
sudo dpkg -i "../apparmor.d_${VERSION}_all.deb"; \
|
||||
make clean
|
||||
@[ ${DISTRIBUTION} = openSUSE ] || exit 0; \
|
||||
make local
|
||||
|
||||
local:
|
||||
@./configure --complain
|
||||
@make
|
||||
@ -69,23 +65,27 @@ $(P):
|
||||
done;
|
||||
@systemctl restart apparmor || systemctl status apparmor
|
||||
|
||||
dist ?= archlinux
|
||||
package:
|
||||
@bash dists/build.sh ${dist}
|
||||
|
||||
pkg:
|
||||
@makepkg --syncdeps --install --cleanbuild --force --noconfirm
|
||||
|
||||
dpkg:
|
||||
@dch --newversion="${VERSION}" --urgency=medium --distribution=stable --controlmaint "Release ${VERSION}"
|
||||
@dpkg-buildpackage -b -d --no-sign
|
||||
@sudo dpkg -i "../apparmor.d_${VERSION}_all.deb"
|
||||
@make clean
|
||||
|
||||
rpm:
|
||||
@make local
|
||||
|
||||
lint:
|
||||
@shellcheck --shell=bash \
|
||||
PKGBUILD configure dists/build.sh \
|
||||
debian/${PKGNAME}.postinst debian/${PKGNAME}.postrm
|
||||
|
||||
archlinux:
|
||||
@bash dists/build.sh archlinux
|
||||
|
||||
debian:
|
||||
@bash dists/build.sh debian
|
||||
|
||||
ubuntu:
|
||||
@bash dists/build.sh ubuntu
|
||||
|
||||
whonix:
|
||||
@bash dists/build.sh whonix
|
||||
|
||||
clean:
|
||||
@rm -rf \
|
||||
debian/.debhelper debian/debhelper* debian/*.debhelper debian/${PKGNAME} \
|
||||
|
@ -62,8 +62,7 @@ build_in_docker_makepkg() {
|
||||
"$BASEIMAGE/$dist"
|
||||
fi
|
||||
|
||||
docker exec --workdir="$BUILDIR/" "$img" \
|
||||
makepkg -sfC --noconfirm --noprogressbar
|
||||
docker exec --workdir="$BUILDIR/" "$img" makepkg -sfC --noconfirm --noprogressbar
|
||||
mv "$VOLUME/$PKGNAME"-*.pkg.* .
|
||||
}
|
||||
|
||||
@ -95,7 +94,8 @@ build_in_docker_dpkg() {
|
||||
main() {
|
||||
case "$COMMAND" in
|
||||
archlinux)
|
||||
build_in_docker_makepkg "$COMMAND"
|
||||
# build_in_docker_makepkg "$COMMAND"
|
||||
PKGDEST=. makepkg -Cf
|
||||
;;
|
||||
|
||||
debian | ubuntu | whonix)
|
||||
@ -103,6 +103,10 @@ main() {
|
||||
build_in_docker_dpkg "$COMMAND"
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
echo "Work in progress"
|
||||
;;
|
||||
|
||||
*) ;;
|
||||
esac
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user