2022-06-22 00:58:19 +02:00
|
|
|
V=20220621
|
2021-11-29 20:43:22 +01:00
|
|
|
BUILDTOOLVER ?= $(V)
|
2010-05-02 15:46:51 +02:00
|
|
|
|
2011-08-12 16:44:36 +02:00
|
|
|
PREFIX = /usr/local
|
2018-09-09 21:02:43 +02:00
|
|
|
MANDIR = $(PREFIX)/share/man
|
2022-05-18 00:35:08 +02:00
|
|
|
BUILDDIR = build
|
2011-08-12 16:44:36 +02:00
|
|
|
|
2022-05-18 00:35:08 +02:00
|
|
|
BINPROGS = \
|
2011-03-12 22:25:09 +01:00
|
|
|
archco \
|
2019-08-09 20:26:57 +02:00
|
|
|
arch-nspawn \
|
2011-03-12 22:25:09 +01:00
|
|
|
archrelease \
|
|
|
|
archbuild \
|
2019-08-09 20:26:57 +02:00
|
|
|
checkpkg \
|
|
|
|
commitpkg \
|
|
|
|
crossrepomove\
|
2022-04-22 21:40:20 +02:00
|
|
|
diffpkg \
|
2022-03-29 11:36:16 +02:00
|
|
|
export-pkgbuild-keys \
|
2011-03-12 22:25:09 +01:00
|
|
|
finddeps \
|
2012-03-05 01:48:27 +01:00
|
|
|
find-libdeps \
|
2019-08-09 20:26:57 +02:00
|
|
|
lddd \
|
2019-02-13 23:14:00 +01:00
|
|
|
makerepropkg \
|
2011-03-12 22:25:09 +01:00
|
|
|
mkarchroot \
|
2019-09-13 01:32:57 +02:00
|
|
|
makechrootpkg \
|
2019-12-28 19:05:28 +01:00
|
|
|
offload-build \
|
2019-08-09 20:26:57 +02:00
|
|
|
rebuildpkgs \
|
2019-09-13 01:32:57 +02:00
|
|
|
sogrep
|
2022-05-18 00:35:08 +02:00
|
|
|
BINPROGS := $(addprefix $(BUILDDIR)/bin/,$(BINPROGS))
|
2011-03-12 22:25:09 +01:00
|
|
|
|
2022-05-18 02:24:58 +02:00
|
|
|
MAKEPKG_CONFIGS=$(wildcard config/makepkg/*)
|
|
|
|
PACMAN_CONFIGS=$(wildcard config/pacman/*)
|
|
|
|
SETARCH_ALIASES = $(wildcard config/setarch-aliases.d/*)
|
2020-04-09 21:27:11 +02:00
|
|
|
|
2011-03-12 22:25:09 +01:00
|
|
|
COMMITPKG_LINKS = \
|
|
|
|
extrapkg \
|
|
|
|
testingpkg \
|
|
|
|
stagingpkg \
|
|
|
|
communitypkg \
|
|
|
|
community-testingpkg \
|
|
|
|
community-stagingpkg \
|
|
|
|
multilibpkg \
|
2011-12-04 17:48:46 +01:00
|
|
|
multilib-testingpkg \
|
2012-01-14 20:22:26 +01:00
|
|
|
multilib-stagingpkg \
|
2011-12-04 17:48:46 +01:00
|
|
|
kde-unstablepkg \
|
|
|
|
gnome-unstablepkg
|
2011-03-12 22:25:09 +01:00
|
|
|
|
|
|
|
ARCHBUILD_LINKS = \
|
|
|
|
extra-x86_64-build \
|
2022-01-29 01:30:35 +01:00
|
|
|
extra-x86_64_v3-build \
|
2011-03-12 22:25:09 +01:00
|
|
|
testing-x86_64-build \
|
2022-01-29 01:30:35 +01:00
|
|
|
testing-x86_64_v3-build \
|
2011-03-12 22:25:09 +01:00
|
|
|
staging-x86_64-build \
|
2022-01-29 01:30:35 +01:00
|
|
|
staging-x86_64_v3-build \
|
2011-03-12 22:25:09 +01:00
|
|
|
multilib-build \
|
2011-12-04 17:48:46 +01:00
|
|
|
multilib-testing-build \
|
2012-01-14 20:22:26 +01:00
|
|
|
multilib-staging-build \
|
2011-12-04 17:48:46 +01:00
|
|
|
kde-unstable-x86_64-build \
|
|
|
|
gnome-unstable-x86_64-build
|
2011-03-12 22:25:09 +01:00
|
|
|
|
2012-03-05 01:48:27 +01:00
|
|
|
CROSSREPOMOVE_LINKS = \
|
|
|
|
extra2community \
|
|
|
|
community2extra
|
|
|
|
|
2022-05-18 02:07:01 +02:00
|
|
|
COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*)))
|
2012-06-24 23:50:22 +02:00
|
|
|
BASHCOMPLETION_LINKS = \
|
|
|
|
archco \
|
|
|
|
communityco
|
|
|
|
|
2018-09-09 21:02:43 +02:00
|
|
|
MANS = \
|
2022-05-18 00:35:08 +02:00
|
|
|
archbuild.1 \
|
|
|
|
arch-nspawn.1 \
|
|
|
|
export-pkgbuild-keys.1 \
|
|
|
|
makechrootpkg.1 \
|
|
|
|
lddd.1 \
|
|
|
|
checkpkg.1 \
|
|
|
|
diffpkg.1 \
|
|
|
|
offload-build.1 \
|
|
|
|
sogrep.1 \
|
|
|
|
makerepropkg.1 \
|
|
|
|
mkarchroot.1 \
|
|
|
|
find-libdeps.1 \
|
|
|
|
find-libprovides.1 \
|
|
|
|
devtools.7
|
|
|
|
MANS := $(addprefix $(BUILDDIR)/doc/,$(MANS))
|
|
|
|
|
|
|
|
|
|
|
|
all: binprogs completion man
|
|
|
|
binprogs: $(BINPROGS)
|
|
|
|
completion: $(COMPLETIONS)
|
2018-09-09 21:02:43 +02:00
|
|
|
man: $(MANS)
|
2011-08-29 10:53:50 +02:00
|
|
|
|
2022-05-18 02:24:58 +02:00
|
|
|
|
|
|
|
ifneq ($(wildcard pacman-*.conf),)
|
|
|
|
$(error Legacy pacman config file found: $(wildcard pacman-*.conf) - please migrate to config/pacman/*)
|
|
|
|
endif
|
|
|
|
ifneq ($(wildcard makepkg-*.conf),)
|
|
|
|
$(error Legacy makepkg config files found: $(wildcard makepkg-*.conf) - please migrate to config/makepkg/*)
|
|
|
|
endif
|
|
|
|
ifneq ($(wildcard setarch-aliases.d/*),)
|
|
|
|
$(error Legacy setarch aliase found: $(wildcard setarch-aliases.d/*) - please migrate to config/setarch-aliases.d/*)
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2018-10-16 00:32:03 +02:00
|
|
|
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
|
2011-11-01 15:33:08 +01:00
|
|
|
|
2022-05-18 02:07:01 +02:00
|
|
|
define buildInScript
|
|
|
|
$(1)/%: $(2)%.in
|
|
|
|
@echo "GEN $$(notdir $$@)"
|
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
@$(RM) "$$@"
|
|
|
|
@{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
|
|
|
|
@chmod $(3) "$$@"
|
|
|
|
@bash -O extglob -n "$$@"
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call buildInScript,build/bin,,555))
|
|
|
|
$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,444)))
|
2004-07-19 07:26:30 +02:00
|
|
|
|
2022-05-18 00:45:00 +02:00
|
|
|
$(BUILDDIR)/doc/%: doc/%.asciidoc doc/asciidoc.conf doc/footer.asciidoc
|
2022-05-18 00:35:08 +02:00
|
|
|
@mkdir -p $(BUILDDIR)/doc
|
|
|
|
a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage --destination-dir=$(BUILDDIR)/doc -a pkgdatadir=$(PREFIX)/share/devtools $<
|
2018-09-09 21:02:43 +02:00
|
|
|
|
2011-08-29 10:53:51 +02:00
|
|
|
clean:
|
2022-05-18 00:35:08 +02:00
|
|
|
rm -rf $(BUILDDIR)
|
2011-08-29 10:53:51 +02:00
|
|
|
|
2022-05-18 00:45:00 +02:00
|
|
|
install: all
|
2011-08-12 16:44:36 +02:00
|
|
|
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
2020-04-09 21:27:11 +02:00
|
|
|
install -dm0755 $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d
|
2011-08-12 16:44:36 +02:00
|
|
|
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
|
2022-05-18 02:24:58 +02:00
|
|
|
for conf in ${MAKEPKG_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
|
|
|
|
for conf in ${PACMAN_CONFIGS}; do install -Dm0644 $$conf $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done
|
|
|
|
for a in ${SETARCH_ALIASES}; do install -m0644 $$a -t $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d; done
|
2011-08-12 16:44:36 +02:00
|
|
|
for l in ${COMMITPKG_LINKS}; do ln -sf commitpkg $(DESTDIR)$(PREFIX)/bin/$$l; done
|
|
|
|
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2012-03-05 01:48:27 +01:00
|
|
|
for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2011-08-08 17:58:12 +02:00
|
|
|
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
2022-05-18 02:07:01 +02:00
|
|
|
install -Dm0644 $(BUILDDIR)/contrib/completion/bash/devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
|
2022-05-17 21:02:10 +02:00
|
|
|
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
|
2022-05-18 02:07:01 +02:00
|
|
|
install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_devtools $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
2011-08-12 16:44:36 +02:00
|
|
|
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
|
2018-09-09 21:02:43 +02:00
|
|
|
for manfile in $(MANS); do \
|
|
|
|
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
|
|
|
|
done;
|
2007-11-28 00:54:57 +01:00
|
|
|
|
|
|
|
uninstall:
|
2022-05-18 00:35:08 +02:00
|
|
|
for f in $(notdir $(BINPROGS)); do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
2022-05-18 02:24:58 +02:00
|
|
|
for conf in ${MAKEPKG_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/makepkg-$${conf##*/}; done
|
|
|
|
for conf in ${PACMAN_CONFIGS}; do rm -f $(DESTDIR)$(PREFIX)/share/devtools/pacman-$${conf##*/}; done
|
|
|
|
for f in $(notdir $(SETARCH_ALIASES)); do rm -f $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d/$$f; done
|
2011-08-12 16:44:36 +02:00
|
|
|
for l in ${COMMITPKG_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
|
|
|
|
for l in ${ARCHBUILD_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2012-03-05 01:48:27 +01:00
|
|
|
for l in ${CROSSREPOMOVE_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$l; done
|
2022-05-17 20:57:32 +02:00
|
|
|
for l in ${BASHCOMPLETION_LINKS}; do rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
|
2022-05-17 21:02:10 +02:00
|
|
|
rm $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
|
2011-08-25 12:50:30 +02:00
|
|
|
rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
2011-08-12 16:44:36 +02:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
|
2011-08-08 17:58:12 +02:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
2022-05-18 00:35:08 +02:00
|
|
|
for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done;
|
2022-05-18 02:07:01 +02:00
|
|
|
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d $(DESTDIR)$(PREFIX)/share/devtools
|
2010-02-13 20:57:34 +01:00
|
|
|
|
2019-09-13 02:13:27 +02:00
|
|
|
TODAY=$(shell date +"%Y%m%d")
|
|
|
|
tag:
|
|
|
|
@sed -E "s|^V=[0-9]{8}|V=$(TODAY)|" -i Makefile
|
|
|
|
@git commit --gpg-sign --message "Version $(TODAY)" Makefile
|
|
|
|
@git tag --sign --message "Version $(TODAY)" $(TODAY)
|
|
|
|
|
2010-02-13 20:57:34 +01:00
|
|
|
dist:
|
2022-01-26 22:44:09 +01:00
|
|
|
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip > devtools-$(V).tar.gz
|
2011-10-31 14:04:35 +01:00
|
|
|
gpg --detach-sign --use-agent devtools-$(V).tar.gz
|
2011-03-12 21:53:52 +01:00
|
|
|
|
2011-04-09 23:04:59 +02:00
|
|
|
upload:
|
2016-05-27 21:02:46 +02:00
|
|
|
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
|
2011-04-09 23:04:59 +02:00
|
|
|
|
2022-05-18 02:24:58 +02:00
|
|
|
check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools config/makepkg/x86_64.conf PKGBUILD.proto
|
2017-05-06 00:41:06 +02:00
|
|
|
shellcheck $^
|
|
|
|
|
2022-05-18 00:35:08 +02:00
|
|
|
.PHONY: all completion man clean install uninstall dist upload check tag
|
2017-05-06 00:41:03 +02:00
|
|
|
.DELETE_ON_ERROR:
|