# ============================================================ BUILD OPTIONS == # path to build aports directory OUT := ./out # signing key for each package KEY := aports.rsa KEY_PUB := aports.rsa.pub # name of docker image IMAGE := g.freya.cat/freya/aports # alpine version to build the packages on ALPINE_VERSION := 3.22 # order of packages to build APORTS := apk-conf \ caddy-conf \ openssh-conf \ tmux-conf \ zsh-conf \ freya-certs \ freya-keys \ freya-base # location to publish aports REPO := shun.freya.cat:/static/cdn/ # ============================================================================= .PHONY: publish aports image clean realclean ALWAYS # docker run arguments DOCKER_ARGS := -v ./aports:/aports \ -v $(OUT):/home/builder/packages \ -v ./$(KEY):/etc/apk/keys/$(KEY) \ -v ./$(KEY_PUB):/etc/apk/keys/$(KEY_PUB) \ --ulimit "nofile=1024:1048576" \ -e PACKAGER_PRIVKEY=/etc/apk/keys/$(KEY) \ -e APORTS="$(APORTS)" \ $(IMAGE) # docker run command DOCKER := docker run --rm -it $(DOCKER_ARGS) aports: image $(KEY) clean ALWAYS mkdir -p $(OUT)/aports $(DOCKER) /bin/aports-build cp $(KEY_PUB) $(OUT)/aports image: Dockerfile docker build . \ --build-arg "UID=$(shell id -u)" \ --build-arg "GID=$(shell id -g)" \ --build-arg "ALPINE_VERSION=$(ALPINE_VERSION)" \ -t $(IMAGE) $(KEY): touch $(KEY) $(KEY_PUB) $(DOCKER) /bin/aports-keygen clean: rm -fr $(OUT) rm -fr $(patsubst %,./aports/%/src,$(APORTS)) realclean: clean rm -f $(KEY) $(KEY_PUB) docker image rm $(IMAGE) all: aports publish publish: rsync -avz --delete $(OUT)/aports/* $(REPO)/aports/