summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7493b1f5112924e38f92e20094967ff6e8d41234 (plain)
  1. #!/usr/bin/make -f
  2. # Makefile for monkeysphere
  3. # (c) 2008 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
  4. # Licensed under GPL v3 or later
  5. MONKEYSPHERE_VERSION = `head -n1 packaging/debian/changelog | sed 's/.*(\([^-]*\)-.*/\1/'`
  6. # these defaults are for debian. porters should probably adjust them
  7. # before calling make install
  8. ETCPREFIX ?=
  9. ETCSUFFIX ?=
  10. PREFIX ?= /usr
  11. MANPREFIX ?= $(PREFIX)/share/man
  12. all: keytrans
  13. keytrans:
  14. $(MAKE) -C src/keytrans
  15. tarball: clean
  16. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  17. mkdir -p monkeysphere-$(MONKEYSPHERE_VERSION)/doc
  18. ln -s ../../website/getting-started-user.mdwn ../../website/getting-started-admin.mdwn ../../doc/TODO ../../doc/MonkeySpec monkeysphere-$(MONKEYSPHERE_VERSION)/doc
  19. ln -s ../COPYING ../etc ../Makefile ../man ../src ../tests monkeysphere-$(MONKEYSPHERE_VERSION)
  20. tar -ch --exclude='*~' monkeysphere-$(MONKEYSPHERE_VERSION) | gzip -n > monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  21. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  22. debian-package: tarball
  23. tar xzf monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  24. cp -a packaging/debian monkeysphere-$(MONKEYSPHERE_VERSION)
  25. (cd monkeysphere-$(MONKEYSPHERE_VERSION) && debuild -uc -us)
  26. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  27. # don't explicitly depend on the tarball, since our tarball
  28. # (re)generation is not idempotent even when no source changes.
  29. freebsd-distinfo:
  30. ./utils/build-freebsd-distinfo
  31. clean:
  32. $(MAKE) -C src/keytrans clean
  33. # clean up old monkeysphere packages lying around as well.
  34. rm -f monkeysphere_*
  35. # this target is to be called from the tarball, not from the git
  36. # working dir!
  37. install: all installman
  38. mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin $(DESTDIR)$(PREFIX)/share/monkeysphere
  39. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  40. mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
  41. install src/monkeysphere src/monkeysphere-ssh-proxycommand src/keytrans/openpgp2ssh $(DESTDIR)$(PREFIX)/bin
  42. install src/monkeysphere-server $(DESTDIR)$(PREFIX)/sbin
  43. install -m 0644 src/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  44. install doc/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  45. install -m 0644 etc/gnupg-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/gnupg-host.conf$(ETCSUFFIX)
  46. install -m 0644 etc/gnupg-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/gnupg-authentication.conf$(ETCSUFFIX)
  47. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  48. install -m 0644 etc/monkeysphere-server.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-server.conf$(ETCSUFFIX)
  49. installman:
  50. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  51. gzip -n man/*/*
  52. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  53. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  54. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  55. gzip -d man/*/*
  56. releasenote:
  57. ./utils/build-releasenote
  58. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote