summaryrefslogtreecommitdiff
path: root/Makefile
blob: 3880713c4a5d4ce0836b8ab4bdedc6d7d052885d (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:=$(shell 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. tarball: clean
  15. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  16. ln -s ../Changelog ../COPYING ../etc ../Makefile ../man ../src ../tests monkeysphere-$(MONKEYSPHERE_VERSION)
  17. echo Monkeysphere $(MONKEYSPHERE_VERSION) > monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  18. echo -n "git revision " >> monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  19. git rev-parse HEAD >> monkeysphere-$(MONKEYSPHERE_VERSION)/VERSION
  20. tar -ch --exclude='*~' monkeysphere-$(MONKEYSPHERE_VERSION) | gzip -n > monkeysphere_$(MONKEYSPHERE_VERSION).orig.tar.gz
  21. rm -rf monkeysphere-$(MONKEYSPHERE_VERSION)
  22. VERSION: Changelog
  23. sed 's/^Monkeysphere .*$$/Monkeysphere '$(MONKEYSPHERE_VERSION)'/' -i VERSION
  24. debian-package:
  25. git buildpackage -uc -us --git-upstream-branch=master --git-debian-branch=debian --git-no-pristine-tar --git-ignore-new
  26. # don't explicitly depend on the tarball, since our tarball
  27. # (re)generation is not idempotent even when no source changes.
  28. freebsd-distinfo:
  29. ./utils/build-freebsd-distinfo
  30. macports-portfile:
  31. ./utils/build-macports-portfile
  32. clean:
  33. # clean up old monkeysphere packages lying around as well.
  34. rm -f monkeysphere_*
  35. # this target is to be called from the tarball, not from the git
  36. # working dir!
  37. install: all installman
  38. mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/sbin
  39. mkdir -p $(DESTDIR)$(PREFIX)/share/monkeysphere/m $(DESTDIR)$(PREFIX)/share/monkeysphere/mh $(DESTDIR)$(PREFIX)/share/monkeysphere/ma $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  40. mkdir -p $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
  41. mkdir -p $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  42. install -m 0644 VERSION $(DESTDIR)$(PREFIX)/share/monkeysphere
  43. install src/monkeysphere $(DESTDIR)$(PREFIX)/bin
  44. install src/monkeysphere-host src/monkeysphere-authentication $(DESTDIR)$(PREFIX)/sbin
  45. install -m 0644 src/share/common $(DESTDIR)$(PREFIX)/share/monkeysphere
  46. install -m 0644 src/share/defaultenv $(DESTDIR)$(PREFIX)/share/monkeysphere
  47. install -m 0755 src/share/checkperms $(DESTDIR)$(PREFIX)/share/monkeysphere
  48. install -m 0755 src/share/keytrans $(DESTDIR)$(PREFIX)/share/monkeysphere
  49. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/pem2openpgp
  50. ln -s ../share/monkeysphere/keytrans $(DESTDIR)$(PREFIX)/bin/openpgp2ssh
  51. install -m 0744 src/transitions/* $(DESTDIR)$(PREFIX)/share/monkeysphere/transitions
  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 Changelog $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
  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