nix-tools/Makefile

241 lines
7.4 KiB
Makefile
Raw Normal View History

2022-08-27 10:52:42 +02:00
Version=0.15.14
2014-10-04 00:46:40 +02:00
2015-06-14 22:25:57 +02:00
PREFIX = /usr/local
SYSCONFDIR = /etc
2014-10-04 00:46:40 +02:00
2015-12-04 00:34:54 +01:00
SYSCONF = \
data/manjaro-tools.conf \
data/branding.desc.d
2015-12-04 00:34:54 +01:00
BIN_BASE = \
2015-06-12 01:26:44 +02:00
bin/mkchroot \
bin/basestrap \
bin/manjaro-chroot \
bin/fstabgen \
bin/signfile \
2015-11-12 12:25:35 +01:00
bin/chroot-run
2015-06-12 01:26:44 +02:00
2015-12-04 00:34:54 +01:00
LIBS_BASE = \
lib/util.sh \
lib/util-mount.sh \
lib/util-msg.sh \
lib/util-fstab.sh
SHARED_BASE = \
data/pacman-default.conf \
data/pacman-multilib.conf \
data/pacman-mirrors.conf
2015-12-04 00:34:54 +01:00
2016-06-09 18:03:38 +02:00
LIST_PKG = \
2017-03-24 10:33:40 +01:00
$(wildcard data/pkg.list.d/*.list)
2015-12-04 00:34:54 +01:00
ARCH_CONF = \
2017-03-24 10:33:40 +01:00
$(wildcard data/make.conf.d/*.conf)
2015-06-12 01:26:44 +02:00
BIN_PKG = \
2014-10-04 08:27:55 +02:00
bin/checkpkg \
bin/lddd \
bin/finddeps \
bin/find-libdeps \
bin/signpkgs \
2014-10-04 09:09:20 +02:00
bin/mkchrootpkg \
bin/buildpkg \
2015-01-19 04:22:02 +01:00
bin/buildtree
2014-10-05 00:17:23 +02:00
2015-12-04 00:34:54 +01:00
LIBS_PKG = \
2017-03-27 18:07:26 +02:00
$(wildcard lib/util-pkg*.sh)
2014-10-04 00:46:40 +02:00
2015-12-04 00:34:54 +01:00
SHARED_PKG = \
2018-04-14 01:09:07 +02:00
data/makepkg.conf
2015-01-29 14:09:05 +01:00
2016-06-09 18:03:38 +02:00
LIST_ISO = \
2017-03-24 10:33:40 +01:00
$(wildcard data/iso.list.d/*.list)
2015-01-29 14:09:05 +01:00
2015-12-04 00:34:54 +01:00
BIN_ISO = \
bin/buildiso \
bin/testiso \
2017-10-23 23:44:37 +02:00
bin/deployiso \
2017-10-24 11:35:58 +02:00
bin/signiso
2015-06-11 22:56:13 +02:00
LIBS_ISO = \
2017-03-24 10:33:40 +01:00
$(wildcard lib/util-iso*.sh) \
2016-09-18 01:04:36 +02:00
lib/util-publish.sh
2014-10-04 00:46:40 +02:00
2015-12-04 00:34:54 +01:00
SHARED_ISO = \
2016-08-19 21:15:58 +02:00
data/pacman-mhwd.conf \
data/mkinitcpio.conf \
2015-12-04 00:34:54 +01:00
data/profile.conf.example
2014-12-04 19:20:40 +01:00
CPIOHOOKS = \
2017-03-24 10:33:40 +01:00
$(wildcard initcpio/hooks/*)
2015-01-29 14:09:05 +01:00
2014-12-04 19:20:40 +01:00
CPIOINST = \
2017-03-24 10:33:40 +01:00
$(wildcard initcpio/install/*)
2015-01-29 14:09:05 +01:00
CPIO = \
initcpio/script/miso_shutdown
2015-05-15 20:10:49 +02:00
MAN_XML = \
2015-06-05 09:39:02 +02:00
buildpkg.xml \
buildtree.xml \
2015-05-25 12:15:46 +02:00
buildiso.xml \
2015-11-28 20:46:10 +01:00
deployiso.xml \
check-yaml.xml \
2015-05-25 12:15:46 +02:00
manjaro-tools.conf.xml \
profile.conf.xml
2015-05-15 20:10:49 +02:00
2016-09-18 01:04:36 +02:00
BIN_YAML = \
bin/check-yaml
LIBS_YAML = \
lib/util-yaml.sh
2016-09-18 01:04:36 +02:00
SHARED_YAML = \
data/linux.preset
2016-09-18 01:04:36 +02:00
all: $(BIN_BASE) $(BIN_PKG) $(BIN_ISO) $(BIN_YAML) doc
2014-10-04 00:46:40 +02:00
2015-12-08 12:33:28 +01:00
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
2014-10-04 09:09:20 +02:00
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/manjaro-tools|g" \
2014-10-08 13:14:57 +02:00
-e "s|@libdir[@]|$(DESTDIR)$(PREFIX)/lib/manjaro-tools|g" \
2015-06-22 21:45:12 +02:00
-e "s|@version@|${Version}|"
2014-10-04 09:09:20 +02:00
%: %.in Makefile
2014-10-04 00:46:40 +02:00
@echo "GEN $@"
@$(RM) "$@"
@m4 -P $@.in | $(edit) >$@
@chmod a-w "$@"
@chmod +x "$@"
2015-05-15 20:10:49 +02:00
doc:
mkdir -p man
2015-05-25 12:17:40 +02:00
$(foreach var,$(MAN_XML),xsltproc /usr/share/docbook2X/xslt/man/docbook.xsl docbook/$(var) | db2x_manxml --output-dir man ;)
2015-05-15 20:10:49 +02:00
2014-10-04 00:46:40 +02:00
clean:
2015-12-04 00:34:54 +01:00
rm -f $(BIN_BASE) ${BIN_PKG} ${BIN_ISO}
2015-05-15 20:10:49 +02:00
rm -rf man
2014-10-04 00:46:40 +02:00
2015-06-12 03:26:12 +02:00
install_base:
2014-10-04 09:09:20 +02:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
2015-06-12 01:26:44 +02:00
install -m0644 ${SYSCONF} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
2015-06-12 03:26:12 +02:00
2014-10-04 00:46:40 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/bin
2015-12-04 00:34:54 +01:00
install -m0755 ${BIN_BASE} $(DESTDIR)$(PREFIX)/bin
2015-06-11 22:56:13 +02:00
2014-10-04 09:09:20 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2015-12-04 00:34:54 +01:00
install -m0644 ${LIBS_BASE} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2015-06-11 22:56:13 +02:00
2015-06-12 03:26:12 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
2015-12-04 00:34:54 +01:00
install -m0644 ${SHARED_BASE} $(DESTDIR)$(PREFIX)/share/manjaro-tools
2015-06-12 03:26:12 +02:00
install_pkg:
2016-06-09 18:03:38 +02:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.list.d
install -m0644 ${LIST_PKG} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.list.d
2015-06-12 03:26:12 +02:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/make.conf.d
install -m0644 ${ARCH_CONF} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/make.conf.d
2014-10-04 00:46:40 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/bin
2015-06-12 01:26:44 +02:00
install -m0755 ${BIN_PKG} $(DESTDIR)$(PREFIX)/bin
2014-10-04 00:46:40 +02:00
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
2015-06-11 22:56:13 +02:00
2015-06-12 03:26:12 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
install -m0644 ${LIBS_PKG} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2014-10-04 09:09:20 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
2015-06-12 03:26:12 +02:00
install -m0644 ${SHARED_PKG} $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
gzip -c man/buildpkg.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildpkg.1.gz
gzip -c man/buildtree.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
install_iso:
2016-06-09 18:03:38 +02:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d
install -m0644 ${LIST_ISO} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d
2015-06-12 03:26:12 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -m0755 ${BIN_ISO} $(DESTDIR)$(PREFIX)/bin
2014-10-04 09:09:20 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2015-06-12 03:26:12 +02:00
install -m0644 ${LIBS_ISO} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2015-06-11 22:56:13 +02:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/initcpio/hooks
install -m0755 ${CPIOHOOKS} $(DESTDIR)$(SYSCONFDIR)/initcpio/hooks
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/initcpio/install
install -m0755 ${CPIOINST} $(DESTDIR)$(SYSCONFDIR)/initcpio/install
2016-12-06 15:20:14 +01:00
install -m0755 ${CPIO} $(DESTDIR)$(SYSCONFDIR)/initcpio
2015-06-12 03:26:12 +02:00
2015-06-12 03:26:12 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -m0644 ${SHARED_ISO} $(DESTDIR)$(PREFIX)/share/manjaro-tools
2015-06-11 22:56:13 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
2015-05-25 12:15:46 +02:00
gzip -c man/buildiso.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildiso.1.gz
2015-11-28 20:51:38 +01:00
gzip -c man/deployiso.1 > $(DESTDIR)$(PREFIX)/share/man/man1/deployiso.1.gz
2015-06-12 03:26:12 +02:00
2015-06-11 22:56:13 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man5
2015-05-25 12:15:46 +02:00
gzip -c man/manjaro-tools.conf.5 > $(DESTDIR)$(PREFIX)/share/man/man5/manjaro-tools.conf.5.gz
gzip -c man/profile.conf.5 > $(DESTDIR)$(PREFIX)/share/man/man5/profile.conf.5.gz
2015-01-29 14:09:05 +01:00
2016-09-18 01:04:36 +02:00
install_yaml:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -m0755 ${BIN_YAML} $(DESTDIR)$(PREFIX)/bin
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
install -m0644 ${LIBS_YAML} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -m0644 ${SHARED_YAML} $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
gzip -c man/check-yaml.1 > $(DESTDIR)$(PREFIX)/share/man/man1/check-yaml.1.gz
2015-06-12 03:26:12 +02:00
uninstall_base:
2015-06-12 01:26:44 +02:00
for f in ${SYSCONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/$$f; done
2015-12-04 00:34:54 +01:00
for f in ${BIN_BASE}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${SHARED_BASE}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
for f in ${LIBS_BASE}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
2015-06-12 03:26:12 +02:00
uninstall_pkg:
2016-06-09 18:03:38 +02:00
for f in ${LIST_PKG}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.list.d/$$f; done
for f in ${ARCH_CONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/make.conf.d/$$f; done
2015-06-12 03:26:12 +02:00
for f in ${BIN_PKG}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
2014-10-04 00:46:40 +02:00
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
2015-06-12 03:26:12 +02:00
for f in ${SHARED_PKG}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
for f in ${LIBS_PKG}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildpkg.1.gz
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
2015-06-11 22:56:13 +02:00
2015-06-12 03:26:12 +02:00
uninstall_iso:
2016-06-09 18:03:38 +02:00
for f in ${LIST_ISO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d/$$f; done
2015-06-12 03:26:12 +02:00
for f in ${BIN_ISO}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${SHARED_ISO}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
2016-09-18 01:04:36 +02:00
2015-06-12 03:26:12 +02:00
for f in ${LIBS_ISO}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
2016-12-06 15:20:14 +01:00
for f in ${CPIOHOOKS}; do rm -f $(DESTDIR)$(SYSCONFDIR)/initcpio/hooks/$$f; done
for f in ${CPIOINST}; do rm -f $(DESTDIR)$(SYSCONFDIR)/initcpio/install/$$f; done
for f in ${CPIO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/initcpio/$$f; done
2015-05-25 12:15:46 +02:00
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildiso.1.gz
2015-11-28 20:51:38 +01:00
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/deployiso.1.gz
2015-06-05 09:49:15 +02:00
rm -f $(DESTDIR)$(PREFIX)/share/man/man5/manjaro-tools.conf.5.gz
rm -f $(DESTDIR)$(PREFIX)/share/man/man5/profile.conf.5.gz
2015-05-15 20:10:49 +02:00
2016-09-18 01:04:36 +02:00
uninstall_yaml:
for f in ${BIN_YAML}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${LIBS_YAML}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
for f in ${SHARED_YAML}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/check-yaml.1.gz
2016-09-18 01:04:36 +02:00
install: install_base install_pkg install_iso install_yaml
2015-06-12 03:26:12 +02:00
2016-09-18 01:04:36 +02:00
uninstall: uninstall_base uninstall_pkg uninstall_iso uninstall_yaml
2014-10-04 00:46:40 +02:00
dist:
2015-06-22 21:47:52 +02:00
git archive --format=tar --prefix=manjaro-tools-$(Version)/ $(Version) | gzip -9 > manjaro-tools-$(Version).tar.gz
2015-06-22 21:45:12 +02:00
gpg --detach-sign --use-agent manjaro-tools-$(Version).tar.gz
2014-10-04 00:46:40 +02:00
.PHONY: all clean install uninstall dist