summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7662f7b54fd1fd7b2dc3ba9321a07aa99e4196b9 (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 src/monkeysphere-authentication-keys-for-user $(DESTDIR)$(PREFIX)/share/monkeysphere
  36. install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  37. install -m 0644 src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
  38. install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
  39. install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
  40. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
  41. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
  42. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  43. install -m 0644 src/transitions/README.txt $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  44. install -m 0644 src/share/m/* $(DESTDIR)$(PREFIX)/share/monkeysphere/m
  45. install -m 0644 src/share/mh/* $(DESTDIR)$(PREFIX)/share/monkeysphere/mh
  46. install -m 0644 src/share/ma/* $(DESTDIR)$(PREFIX)/share/monkeysphere/ma
  47. install Changelog $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  48. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  49. install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
  50. install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)
  51. installman:
  52. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  53. gzip -n man/*/*
  54. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  55. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  56. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  57. gzip -d man/*/*
  58. releasenote:
  59. ./utils/build-releasenote
  60. test: test-keytrans test-basic
  61. test-basic:
  62. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic
  63. test-keytrans:
  64. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
  65. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test