nix-tools/Makefile

89 lines
2.5 KiB
Makefile
Raw Normal View History

2014-10-28 11:35:12 +01:00
V=0.9.1
2014-10-04 00:46:40 +02:00
PREFIX = /usr/local
BINPROGS = \
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/mkchroot \
bin/mkchrootpkg \
2014-10-04 08:27:55 +02:00
bin/build-set \
2014-10-04 09:37:25 +02:00
bin/basestrap \
bin/manjaro-chroot \
2014-10-07 01:04:26 +02:00
bin/fstabgen \
bin/make-set
2014-10-05 00:17:23 +02:00
2014-10-04 00:46:40 +02:00
SYSCONFIGFILES = \
2014-10-04 09:09:20 +02:00
conf/manjaro-tools.conf
2014-10-04 00:46:40 +02:00
SETS = \
2014-10-14 00:23:45 +02:00
sets/default.set
2014-10-04 00:46:40 +02:00
CONFIGFILES = \
2014-10-04 08:27:55 +02:00
conf/makepkg-i686.conf \
conf/makepkg-x86_64.conf \
conf/pacman-default.conf \
conf/pacman-mirrors.conf \
conf/pacman-multilib.conf
2014-10-04 09:09:20 +02:00
LIBS = \
2014-10-08 00:12:43 +02:00
lib/build-api.sh \
lib/mount-api.sh \
lib/util.sh \
lib/messages.sh
2014-10-04 00:46:40 +02:00
all: $(BINPROGS)
2014-10-04 09:09:20 +02:00
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
-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" \
-e "s|@version@|${V}|"
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 "$@"
clean:
rm -f $(BINPROGS)
install:
2014-10-04 09:09:20 +02:00
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
install -m0644 ${SYSCONFIGFILES} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/sets
install -m0644 ${SETS} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/sets
2014-10-04 00:46:40 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/bin
2014-10-04 09:09:20 +02:00
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2014-10-04 00:46:40 +02:00
install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
2014-10-04 09:09:20 +02:00
install -m0644 ${CONFIGFILES} $(DESTDIR)$(PREFIX)/share/manjaro-tools
2014-10-04 00:46:40 +02:00
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
2014-10-04 09:09:20 +02:00
install -m0644 ${LIBS} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
2014-10-28 11:31:34 +01:00
# compat symlinks
ln -sf basestrap $(DESTDIR)$(PREFIX)/bin/pacstrap
ln -sf fstabgen $(DESTDIR)$(PREFIX)/bin/genfstab
ln -sf manjaro-chroot $(DESTDIR)$(PREFIX)/bin/arch-chroot
2014-10-04 00:46:40 +02:00
uninstall:
2014-10-04 09:09:20 +02:00
for f in ${SYSCONFIGFILES}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/$$f; done
for f in ${SETS}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/sets/$$f; done
2014-10-04 00:46:40 +02:00
for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
2014-10-04 09:09:20 +02:00
for f in ${CONFIGFILES}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
2014-10-04 00:46:40 +02:00
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
2014-10-04 09:09:20 +02:00
for f in ${LIBS}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
2014-10-28 11:31:34 +01:00
# compat symlinks
rm -f $(DESTDIR)$(PREFIX)/bin/pacstrap
rm -f $(DESTDIR)$(PREFIX)/bin/genfstab
rm -f $(DESTDIR)$(PREFIX)/bin/arch-chroot
2014-10-04 00:46:40 +02:00
dist:
2014-10-04 09:09:20 +02:00
git archive --format=tar --prefix=manjaro-tools-$(V)/ $(V) | gzip -9 > manjaro-tools-$(V).tar.gz
gpg --detach-sign --use-agent manjaro-tools-$(V).tar.gz
2014-10-04 00:46:40 +02:00
.PHONY: all clean install uninstall dist