nix-tools/Makefile

245 lines
7.4 KiB
Makefile
Raw Normal View History

2015-11-02 18:39:24 +01:00
Version=0.9.15
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-06-12 01:26:44 +02:00
BIN = \
bin/mkchroot \
bin/basestrap \
bin/manjaro-chroot \
bin/fstabgen \
2015-11-12 12:25:35 +01:00
bin/chroot-run
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/signpkg \
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-06-12 01:26:44 +02:00
BIN_ISO = \
2015-06-12 03:26:12 +02:00
bin/buildiso \
2015-11-12 12:25:35 +01:00
bin/testiso \
bin/deployiso
2015-06-12 01:26:44 +02:00
SYSCONF = \
2014-10-04 09:09:20 +02:00
conf/manjaro-tools.conf
2014-10-04 00:46:40 +02:00
2015-01-14 22:28:56 +01:00
SETS_PKG = \
2015-12-03 22:54:58 +01:00
conf/pkg.d/default.set
2015-01-29 14:09:05 +01:00
2015-01-14 22:28:56 +01:00
SETS_ISO = \
2015-12-03 22:54:58 +01:00
conf/iso.d/default.set \
conf/iso.d/official.set \
conf/iso.d/community.set \
conf/iso.d/community-minimal.set
2015-01-29 14:09:05 +01:00
2015-06-12 01:26:44 +02:00
SHARED = \
2014-10-04 08:27:55 +02:00
conf/pacman-default.conf \
2014-11-12 04:14:36 +01:00
conf/pacman-multilib.conf \
conf/pacman-mirrors-stable.conf \
conf/pacman-mirrors-testing.conf \
2015-06-12 03:26:12 +02:00
conf/pacman-mirrors-unstable.conf
SHARED_PKG = \
conf/makepkg-i686.conf \
2015-10-22 12:09:45 +02:00
conf/base-devel-udev \
2015-06-12 03:26:12 +02:00
conf/makepkg-x86_64.conf
SHARED_ISO = \
2015-01-29 14:09:05 +01:00
conf/pacman-gfx.conf \
2015-06-05 09:39:02 +02:00
conf/profile.conf.example
2015-01-29 14:09:05 +01:00
2014-10-04 09:09:20 +02:00
LIBS = \
2014-10-08 00:12:43 +02:00
lib/util.sh \
2014-11-13 16:00:56 +01:00
lib/util-mount.sh \
2014-12-08 23:50:56 +01:00
lib/util-msg.sh \
lib/util-pac-conf.sh \
2015-06-11 22:56:13 +02:00
lib/util-fstab.sh
LIBS_PKG = \
2014-12-08 23:50:56 +01:00
lib/util-pkg.sh \
2015-06-12 03:26:12 +02:00
lib/util-pkgtree.sh
2015-06-11 22:56:13 +02:00
LIBS_ISO = \
2015-01-29 14:09:05 +01:00
lib/util-iso.sh \
2015-06-15 19:10:34 +02:00
lib/util-iso-aufs.sh \
lib/util-iso-overlayfs.sh \
lib/util-iso-image.sh \
2015-01-29 14:09:05 +01:00
lib/util-iso-calamares.sh \
2015-02-16 20:32:27 +01:00
lib/util-livecd.sh \
2015-03-04 00:41:05 +01:00
lib/util-iso-boot.sh \
2015-11-12 19:02:31 +01:00
lib/util-publish.sh \
2015-06-12 03:26:12 +02:00
lib/util-iso-log.sh
2014-10-04 00:46:40 +02:00
2014-12-04 19:20:40 +01:00
CPIOHOOKS = \
2014-12-17 03:44:04 +01:00
initcpio/hooks/miso \
initcpio/hooks/miso_overlayfs \
2014-12-17 03:44:04 +01:00
initcpio/hooks/miso_loop_mnt \
2015-05-08 20:30:22 +02:00
initcpio/hooks/miso_pxe_common \
2015-05-10 23:53:21 +02:00
initcpio/hooks/miso_pxe_http
2015-01-29 14:09:05 +01:00
2014-12-04 19:20:40 +01:00
CPIOINST = \
2014-12-17 03:44:04 +01:00
initcpio/inst/miso \
initcpio/inst/miso_overlayfs \
2014-12-17 03:44:04 +01:00
initcpio/inst/miso_loop_mnt \
2015-05-08 20:30:22 +02:00
initcpio/inst/miso_pxe_common \
initcpio/inst/miso_pxe_http \
2014-12-17 03:44:04 +01:00
initcpio/inst/miso_kms
2015-01-29 14:09:05 +01:00
2014-12-15 04:03:50 +01:00
SCRIPTS = \
2014-12-19 17:46:25 +01:00
scripts/mhwd-live \
2015-02-26 20:53:20 +01:00
scripts/livecd \
2015-02-28 01:38:42 +01:00
scripts/kbd-model-map
2014-12-09 00:40:46 +01:00
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 \
2015-05-25 12:15:46 +02:00
manjaro-tools.conf.xml \
profile.conf.xml
2015-05-15 20:10:49 +02:00
2015-06-12 01:43:24 +02:00
all: $(BIN) $(BIN_PKG) $(BIN_ISO) doc #bin/bash_completion bin/zsh_completion
2014-10-04 00:46:40 +02:00
2014-10-04 09:09:20 +02:00
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
2014-12-14 07:57:34 +01:00
-e "s|@bindir[@]|$(DESTDIR)$(PREFIX)/bin|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-06-12 03:26:12 +02:00
rm -f $(BIN) ${BIN_PKG} ${BIN_ISO} #bin/bash_completion bin/zsh_completion
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-06-12 03:26:12 +02:00
install -m0755 ${BIN} $(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-06-12 03:26:12 +02:00
install -m0644 ${LIBS} $(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
install -m0644 ${SHARED} $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
gzip -c man/buildset.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildset.1.gz
# install -Dm0644 bin/bash_completion $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/manjaro_tools
# install -Dm0644 bin/zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_manjaro_tools
install_pkg:
2015-12-03 22:54:58 +01:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.d
install -m0644 ${SETS_PKG} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.d
2015-06-12 03:26:12 +02:00
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:
2015-12-03 22:54:58 +01:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.d
install -m0644 ${SETS_ISO} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.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
2014-12-04 19:42:03 +01:00
install -dm0755 $(DESTDIR)$(PREFIX)/lib/initcpio/hooks
install -m0755 ${CPIOHOOKS} $(DESTDIR)$(PREFIX)/lib/initcpio/hooks
2015-06-12 03:26:12 +02:00
2014-12-04 19:42:03 +01:00
install -dm0755 $(DESTDIR)$(PREFIX)/lib/initcpio/install
install -m0755 ${CPIOINST} $(DESTDIR)$(PREFIX)/lib/initcpio/install
2015-06-12 03:26:12 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -m0644 ${SHARED_ISO} $(DESTDIR)$(PREFIX)/share/manjaro-tools
2014-12-15 04:03:50 +01:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools/scripts
install -m0644 ${SCRIPTS} $(DESTDIR)$(PREFIX)/share/manjaro-tools/scripts
2015-06-12 03:26:12 +02:00
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
2014-10-04 00:46:40 +02:00
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
for f in ${BIN}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${SHARED}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
2015-06-12 03:26:12 +02:00
for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildset.1.gz
# rm $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/manjaro_tools
# rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_manjaro_tools
uninstall_pkg:
2015-12-03 22:54:58 +01:00
for f in ${SETS_PKG}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.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:
2015-12-03 22:54:58 +01:00
for f in ${SETS_ISO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.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
for f in ${LIBS_ISO}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
2014-12-04 19:20:40 +01:00
for f in ${CPIOHOOKS}; do rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/hooks/$$f; done
for f in ${CPIOINST}; do rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/install/$$f; done
2014-12-15 04:03:50 +01:00
for f in ${SCRIPTS}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/scripts/$$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
2015-06-12 03:26:12 +02:00
install: install_base install_pkg install_iso
uninstall: uninstall_base uninstall_pkg uninstall_iso
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