summaryrefslogtreecommitdiff
path: root/Makefile
blob: 201abf43e8a79b764f3985d4a9d89e4e443f450a (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. LOCALSTATEDIR ?= /var/lib
  13. # nothing actually needs to be built now.
  14. all:
  15. debian-package:
  16. git buildpackage -uc -us
  17. # don't explicitly depend on the tarball, since our tarball
  18. # (re)generation is not idempotent even when no source changes.
  19. freebsd-distinfo:
  20. ./utils/build-freebsd-distinfo
  21. macports-portfile:
  22. ./utils/build-macports-portfile
  23. clean:
  24. # clean up old monkeysphere packages lying around as well.
  25. rm -f monkeysphere_*
  26. # this target is to be called from the tarball, not from the git
  27. # working dir!
  28. install: all installman
  29. mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin
  30. mkdir -p $(DESTDIR)$(PREFIX)/share/monkeysphere/m $(DESTDIR)$(PREFIX)/share/monkeysphere/mh $(DESTDIR)$(PREFIX)/share/monkeysphere/ma $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  31. mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
  32. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  33. printf "Monkeysphere %s\n" $(MONKEYSPHERE_VERSION) > $(DESTDIR)$(PREFIX)/share/monkeysphere/VERSION
  34. install src/monkeysphere $(DESTDIR)$(PREFIX)/bin
  35. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/bin/monkeysphere
  36. install src/monkeysphere-host $(DESTDIR)$(PREFIX)/sbin
  37. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/sbin/monkeysphere-host
  38. install src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
  39. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/sbin/monkeysphere-authentication
  40. install src/monkeysphere-authentication-keys-for-user $(DESTDIR)$(PREFIX)/share/monkeysphere
  41. install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  42. install -m 0644 src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
  43. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(PREFIX)/share/monkeysphere/defaultenv
  44. sed -i 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):' $(DESTDIR)$(PREFIX)/share/monkeysphere/defaultenv
  45. install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
  46. install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
  47. ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
  48. ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
  49. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  50. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions/0.23
  51. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions/0.28
  52. install -m 0644 src/transitions/README.txt $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  53. install -m 0644 src/share/m/* $(DESTDIR)$(PREFIX)/share/monkeysphere/m
  54. install -m 0644 src/share/mh/* $(DESTDIR)$(PREFIX)/share/monkeysphere/mh
  55. install -m 0644 src/share/ma/* $(DESTDIR)$(PREFIX)/share/monkeysphere/ma
  56. install -m 0644 Changelog $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  57. install -d $(DESTDIR)$(PREFIX)/share/doc/monkeysphere/examples
  58. install -m 0644 examples/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere/examples
  59. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  60. install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
  61. install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)
  62. installman:
  63. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  64. gzip -n man/*/*
  65. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  66. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  67. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  68. gzip -d man/*/*
  69. gzip -d $(DESTDIR)$(MANPREFIX)/man1/monkeysphere.1.gz
  70. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(MANPREFIX)/man1/monkeysphere.1
  71. gzip -n $(DESTDIR)$(MANPREFIX)/man1/monkeysphere.1
  72. gzip -d $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8.gz
  73. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8
  74. sed -i 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8
  75. gzip -n $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8
  76. gzip -d $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8.gz
  77. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8
  78. sed -i 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8
  79. gzip -n $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8
  80. releasenote:
  81. ./utils/build-releasenote
  82. test: test-keytrans test-basic
  83. test-basic:
  84. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic
  85. test-keytrans:
  86. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
  87. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test