Files
voidpkgs/Makefile
2025-04-29 17:05:37 -05:00

39 lines
1.2 KiB
Makefile

BUILDDIR := ./void-packages
TEMPLATES := $(shell find srcpkgs/* -maxdepth 0 -type d)
PACKAGES := $(addprefix $(BUILDDIR)/,$(notdir $(TEMPLATES)))
all: sync $(PACKAGES) end
$(info TEMPLATES: $(TEMPLATES))
$(info PACKAGES: $(PACKAGES))
$(BUILDDIR)/%: srcpkgs/%
@echo "Building package: $<"
@rm -rf $(BUILDDIR)/srcpkgs/$<
@cp -ru $< $(BUILDDIR)/srcpkgs/
@-cd $(BUILDDIR) && ./xbps-src clean $<
@-cd $(BUILDDIR) && ./xbps-src pkg $< || echo "Warning: Failed to build $<"
@mkdir -p ./dest
@-cp -u $(BUILDDIR)/hostdir/binpkgs/*.xbps ./dest/
@-cp $(BUILDDIR)/hostdir/binpkgs/x86_64-repodata ./dest/
end:
@printf "\n\n\033[1;31mRun the following commands:\033[m\n"
@printf 'xbps-rindex -s ./dest --privkey \033[31m/path/to/key\033[m --signedby \033[31m"Name <Email>"\033[m\n'
@printf 'xbps-rindex -S ./dest/* --privkey \033[31m/path/to/key\033[m\n'
sync: sync-build
sync-fetch:
test -d $(BUILDDIR) || git clone --depth=1 https://github.com/void-linux/void-packages.git $^
sync-update: sync-fetch
@cd $(BUILDDIR) && git pull
sync-build: sync-update
@cd $(BUILDDIR) && ./xbps-src binary-bootstrap
sync-clean:
rm -rf $(BUILDDIR)
build-clean:
rm -rf ./dest
clean: sync-clean build-clean