summaryrefslogtreecommitdiff
path: root/Makefile
blob: 9f5028aec19df8ded227c7280e820e1d35cfb45b (plain)
  1. #!/usr/bin/make -f
  2. # Makefile for monkeysphere
  3. # © 2008-2010 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
  4. # Licensed under GPL v3 or later
  5. MONKEYSPHERE_VERSION = `head -n1 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. debian-package:
  15. git buildpackage -uc -us
  16. # don't explicitly depend on the tarball, since our tarball
  17. # (re)generation is not idempotent even when no source changes.
  18. freebsd-distinfo:
  19. ./utils/build-freebsd-distinfo
  20. macports-portfile:
  21. ./utils/build-macports-portfile
  22. clean:
  23. # clean up old monkeysphere packages lying around as well.
  24. rm -f monkeysphere_*
  25. # this target is to be called from the tarball, not from the git
  26. # working dir!
  27. install: all installman
  28. mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin
  29. mkdir -p $(DESTDIR)$(PREFIX)/share/monkeysphere/m $(DESTDIR)$(PREFIX)/share/monkeysphere/mh $(DESTDIR)$(PREFIX)/share/monkeysphere/ma $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  30. mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
  31. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  32. printf "Monkeysphere %s\n" $(MONKEYSPHERE_VERSION) > $(DESTDIR)$(PREFIX)/share/monkeysphere/VERSION
  33. install src/monkeysphere $(DESTDIR)$(PREFIX)/bin
  34. install src/monkeysphere-host src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
  35. install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  36. install -m 0644 src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
  37. install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
  38. install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
  39. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
  40. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
  41. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  42. install -m 0644 src/transitions/README.txt $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  43. install -m 0644 src/share/m/* $(DESTDIR)$(PREFIX)/share/monkeysphere/m
  44. install -m 0644 src/share/mh/* $(DESTDIR)$(PREFIX)/share/monkeysphere/mh
  45. install -m 0644 src/share/ma/* $(DESTDIR)$(PREFIX)/share/monkeysphere/ma
  46. install Changelog $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  47. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  48. install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
  49. install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)
  50. installman:
  51. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  52. gzip -n man/*/*
  53. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  54. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  55. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  56. gzip -d man/*/*
  57. releasenote:
  58. ./utils/build-releasenote
  59. test: test-keytrans test-basic
  60. test-basic:
  61. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic
  62. test-keytrans:
  63. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
  64. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test