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