summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7ca73efd9f7aa2118eaef4c083d3ef5fdc930516 (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. # nothing actually needs to be built now.
  13. all:
  14. tarball: clean
  15. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  16. mkdir -p monkeysphere-$(MONKEYSPHERE_VERSION)/doc
  17. ln -s ../../website/getting-started-user.mdwn ../../website/getting-started-admin.mdwn ../../doc/TODO ../../doc/MonkeySpec monkeysphere-$(MONKEYSPHERE_VERSION)/doc
  18. ln -s ../COPYING ../etc ../Makefile ../man ../src ../tests monkeysphere-$(MONKEYSPHERE_VERSION)
  19. echo Monkeysphere $(MONKEYSPHERE_VERSION) > monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  20. echo -n "git revision " >> monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  21. git rev-parse HEAD >> monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  22. tar -ch --exclude='*~' monkeysphere-$(MONKEYSPHERE_VERSION) | gzip -n > monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  23. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  24. debian-package: tarball
  25. tar xzf monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  26. cp -a packaging/debian monkeysphere-$(MONKEYSPHERE_VERSION)
  27. (cd monkeysphere-$(MONKEYSPHERE_VERSION) && debuild -uc -us)
  28. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  29. # don't explicitly depend on the tarball, since our tarball
  30. # (re)generation is not idempotent even when no source changes.
  31. freebsd-distinfo:
  32. ./utils/build-freebsd-distinfo
  33. macports-portfile:
  34. ./utils/build-macports-portfile
  35. clean:
  36. # clean up old monkeysphere packages lying around as well.
  37. rm -f monkeysphere_*
  38. # this target is to be called from the tarball, not from the git
  39. # working dir!
  40. install: all installman
  41. mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin
  42. mkdir -p $(DESTDIR)$(PREFIX)/share/monkeysphere/m $(DESTDIR)$(PREFIX)/share/monkeysphere/mh $(DESTDIR)$(PREFIX)/share/monkeysphere/ma $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  43. mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
  44. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  45. install -m 0644 VERSION $(DESTDIR)$(PREFIX)/share/monkeysphere
  46. install src/monkeysphere $(DESTDIR)$(PREFIX)/bin
  47. install src/monkeysphere-host src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
  48. install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  49. install -m 0644 src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
  50. install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
  51. install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
  52. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
  53. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
  54. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  55. install -m 0644 src/transitions/README.txt $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  56. install -m 0644 src/share/m/* $(DESTDIR)$(PREFIX)/share/monkeysphere/m
  57. install -m 0644 src/share/mh/* $(DESTDIR)$(PREFIX)/share/monkeysphere/mh
  58. install -m 0644 src/share/ma/* $(DESTDIR)$(PREFIX)/share/monkeysphere/ma
  59. install doc/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  60. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  61. install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
  62. install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)
  63. installman:
  64. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  65. gzip -n man/*/*
  66. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  67. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  68. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  69. gzip -d man/*/*
  70. releasenote:
  71. ./utils/build-releasenote
  72. test:
  73. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
  74. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic
  75. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test