summaryrefslogtreecommitdiff
path: root/Makefile
blob: 0284a8a0e52405ad4b29d8942df6b4d0315936a2 (plain)
  1. #!/usr/bin/make -f
  2. # Makefile for monkeysphere
  3. # (c) 2008-2009 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. echo $(MONKEYSPHERE_VERSION) > monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  21. tar -ch --exclude='*~' monkeysphere-$(MONKEYSPHERE_VERSION) | gzip -n > monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  22. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  23. debian-package: tarball
  24. tar xzf monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  25. cp -a packaging/debian monkeysphere-$(MONKEYSPHERE_VERSION)
  26. (cd monkeysphere-$(MONKEYSPHERE_VERSION) && debuild -uc -us)
  27. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  28. # don't explicitly depend on the tarball, since our tarball
  29. # (re)generation is not idempotent even when no source changes.
  30. freebsd-distinfo:
  31. ./utils/build-freebsd-distinfo
  32. clean:
  33. $(MAKE) -C src/keytrans clean
  34. # clean up old monkeysphere packages lying around as well.
  35. rm -f monkeysphere_*
  36. # this target is to be called from the tarball, not from the git
  37. # working dir!
  38. install: all installman
  39. mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin
  40. mkdir -p $(DESTDIR)$(PREFIX)/share/monkeysphere/m $(DESTDIR)$(PREFIX)/share/monkeysphere/mh $(DESTDIR)$(PREFIX)/share/monkeysphere/ma $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  41. mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
  42. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  43. install -m 0644 VERSION $(DESTDIR)$(PREFIX)/share/monkeysphere
  44. install src/monkeysphere src/keytrans/openpgp2ssh src/keytrans/pem2openpgp $(DESTDIR)$(PREFIX)/bin
  45. install src/monkeysphere-host src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
  46. install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  47. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  48. install -m 0644 src/transitions/README.txt $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  49. install -m 0644 src/share/m/* $(DESTDIR)$(PREFIX)/share/monkeysphere/m
  50. install -m 0644 src/share/mh/* $(DESTDIR)$(PREFIX)/share/monkeysphere/mh
  51. install -m 0644 src/share/ma/* $(DESTDIR)$(PREFIX)/share/monkeysphere/ma
  52. install doc/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  53. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  54. install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
  55. install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)
  56. installman:
  57. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  58. gzip -n man/*/*
  59. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  60. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  61. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  62. gzip -d man/*/*
  63. releasenote:
  64. ./utils/build-releasenote
  65. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote