From 2f5315b3c32fbd23ebce05da80712183dc259b7c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 May 2017 14:27:39 -0400 Subject: standalone tarball Adapted the standalone tarball building code from git-annex. --- Makefile | 54 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ca07972..3244942 100644 --- a/Makefile +++ b/Makefile @@ -41,22 +41,44 @@ debug-me: clean: if [ "$(BUILDER)" != ./Setup ] && [ "$(BUILDER)" != cabal ]; then $(BUILDER) clean; fi - rm -rf debug-me dist .stack-work Setup Setup.hi Setup.o + rm -rf dist .stack-work tmp + rm -f debig-me Build/LinuxMkLibs Setup + find . -name \*.o -exec rm {} \; + find . -name \*.hi -exec rm {} \; install: install-files useradd --system debug-me - chmod 700 $(PREFIX)/var/log/debug-me - chown debug-me:debug-me $(PREFIX)/var/log/debug-me - -install-files: debug-me - install -d $(PREFIX)/var/log/debug-me - install -d $(PREFIX)/usr/bin - install -s -m 0755 debug-me $(PREFIX)/usr/bin/debug-me - install -d $(PREFIX)/usr/share/man/man1 - install -m 0644 debug-me.1 $(PREFIX)/usr/share/man/man1/debug-me.1 - install -d $(PREFIX)/lib/systemd/system - install -m 0644 debug-me.service $(PREFIX)/lib/systemd/system/debug-me.service - install -d $(PREFIX)/etc/init.d - install -m 0755 debug-me.init $(PREFIX)/etc/init.d/debug-me - install -d $(PREFIX)/etc/default - install -m 0644 debug-me.default $(PREFIX)/etc/default/debug-me + chmod 700 $(DESTDIR)$(PREFIX)/var/log/debug-me + chown debug-me:debug-me $(DESTDIR)$(PREFIX)/var/log/debug-me + +install-files: debug-me install-mans + install -d $(DESTDIR)$(PREFIX)/var/log/debug-me + install -d $(DESTDIR)$(PREFIX)/usr/bin + install -s -m 0755 debug-me $(DESTDIR)$(PREFIX)/usr/bin/debug-me + install -d $(DESTDIR)$(PREFIX)/lib/systemd/system + install -m 0644 debug-me.service $(DESTDIR)$(PREFIX)/lib/systemd/system/debug-me.service + install -d $(DESTDIR)$(PREFIX)/etc/init.d + install -m 0755 debug-me.init $(DESTDIR)$(PREFIX)/etc/init.d/debug-me + install -d $(DESTDIR)$(PREFIX)/etc/default + install -m 0644 debug-me.default $(DESTDIR)$(PREFIX)/etc/default/debug-me + +install-mans: + install -d $(DESTDIR)$(PREFIX)/usr/share/man/man1 + install -m 0644 debug-me.1 $(DESTDIR)$(PREFIX)/usr/share/man/man1/debug-me.1 + +Build/LinuxMkLibs: Build/LinuxMkLibs.hs + ghc --make $@ -Wall -fno-warn-tabs + +LINUXSTANDALONE_DEST=tmp/debug-me +linuxstandalone: debug-me Build/LinuxMkLibs + rm -rf "$(LINUXSTANDALONE_DEST)" + mkdir -p tmp + cp -R standalone/linux/skel "$(LINUXSTANDALONE_DEST)" + install -d "$(LINUXSTANDALONE_DEST)/bin" + cp debug-me "$(LINUXSTANDALONE_DEST)/bin/" + strip "$(LINUXSTANDALONE_DEST)/bin/debug-me" + ./Build/LinuxMkLibs "$(LINUXSTANDALONE_DEST)" + $(MAKE) install-mans DESTDIR="$(LINUXSTANDALONE_DEST)" + cd tmp && tar c debug-me | gzip -9 --rsyncable > debug-me-standalone-$(shell dpkg --print-architecture).tar.gz + +.PHONY: debug-me -- cgit v1.2.3