summaryrefslogtreecommitdiff
path: root/Makefile
blob: 322a79d7510868223e1d772a6c71346e512121e2 (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. install -m 0644 src/share/list_primary_fingerprints $(DESTDIR)$(PREFIX)/share/monkeysphere
  44. install -m 0644 src/share/process_authorized_user_ids $(DESTDIR)$(PREFIX)/share/monkeysphere
  45. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(PREFIX)/share/monkeysphere/defaultenv
  46. sed -i 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):' $(DESTDIR)$(PREFIX)/share/monkeysphere/defaultenv
  47. install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
  48. install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
  49. ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
  50. ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
  51. ln -sf ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2pem
  52. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  53. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions/0.23
  54. sed -i 's:__SYSSHAREDIR_PREFIX__:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions/0.28
  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 -m 0644 Changelog $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  60. install -d $(DESTDIR)$(PREFIX)/share/doc/monkeysphere/examples
  61. install -m 0644 examples/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere/examples
  62. install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere.conf$(ETCSUFFIX)
  63. install -m 0644 etc/monkeysphere-host.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-host.conf$(ETCSUFFIX)
  64. install -m 0644 etc/monkeysphere-authentication.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-authentication.conf$(ETCSUFFIX)
  65. installman:
  66. mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
  67. gzip -n man/*/*
  68. install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
  69. install man/man7/* $(DESTDIR)$(MANPREFIX)/man7
  70. install man/man8/* $(DESTDIR)$(MANPREFIX)/man8
  71. ln -s openpgp2ssh.1.gz $(DESTDIR)$(MANPREFIX)/man1/openpgp2pem.1.gz
  72. gzip -d man/*/*
  73. gzip -d $(DESTDIR)$(MANPREFIX)/man1/monkeysphere.1.gz
  74. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(MANPREFIX)/man1/monkeysphere.1
  75. gzip -n $(DESTDIR)$(MANPREFIX)/man1/monkeysphere.1
  76. gzip -d $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8.gz
  77. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8
  78. sed -i 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8
  79. gzip -n $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-host.8
  80. gzip -d $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8.gz
  81. sed -i 's:__SYSCONFDIR_PREFIX__:$(ETCPREFIX):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8
  82. sed -i 's:__SYSDATADIR_PREFIX__:$(LOCALSTATEDIR):' $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8
  83. gzip -n $(DESTDIR)$(MANPREFIX)/man8/monkeysphere-authentication.8
  84. # this target depends on you having the monkeysphere-docs
  85. # repo checked out as a peer of your monkeysphere repo.
  86. releasenote:
  87. ../monkeysphere-docs/utils/build-releasenote
  88. test: test-keytrans test-basic
  89. test-basic:
  90. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/basic
  91. test-keytrans:
  92. MONKEYSPHERE_TEST_NO_EXAMINE=true ./tests/keytrans
  93. .PHONY: all tarball debian-package freebsd-distinfo clean install installman releasenote test