server.mk 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #----------------------------------------------------------------------
  2. # This file is used for maintenance of org on the server.
  3. #----------------------------------------------------------------------
  4. .PHONY: helpserver \
  5. release rel-dirty rel-up cleanrel \
  6. elpa elpa-dirty elpa-up \
  7. doc-up \
  8. upload-release upload-elpa upload-doc upload \
  9. tagwarn version
  10. help helpall helpserver::
  11. $(info )
  12. $(info Maintenance)
  13. $(info ===========)
  14. $(info release - clean up, create the distribution archives)
  15. $(info elpa - clean up, create the ELPA archive)
  16. $(info upload-release - clean up, populate the server with arhives)
  17. $(info upload-elpa - clean up, populate the server with ELPA)
  18. $(info upload-doc - clean up, populate the server with docs)
  19. $(info upload - clean up, populate the server with everything)
  20. helpserver::
  21. @echo ""
  22. #----------------------------------------------------------------------
  23. # no slash / at the end
  24. SERVROOT = /var/www/orgmode.org
  25. SERVERMK = true # or just any value at all, really
  26. #----------------------------------------------------------------------
  27. ORGCOMM = README request-assign-future.txt lisp/ doc/
  28. ORGFULL = $(ORGCOMM) Makefile \
  29. mk/default.mk mk/targets.mk mk/version.mk \
  30. mk/org-fixup.el \
  31. etc/ contrib/
  32. ORGFULL := $(ORGFULL:%/=%/*)
  33. ORGELPA = $(ORGCOMM) etc/styles/ org-pkg.el
  34. ORGELPA := $(ORGELPA:%/=%/*)
  35. release: ORG_MAKE_DOC=info pdf card # do not make HTML documentation
  36. release: cleanall doc rel-dirty tagwarn
  37. rel-dirty rel-up: ORGDIR=org-$(GITVERSION:release_%=%)
  38. rel-dirty:
  39. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-dist version autoloads
  40. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGRZIP)
  41. ln -s . $(ORGDIR)
  42. tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  43. zip -r9 $(ORGDIR).zip $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  44. -@$(RM) $(ORGDIR)
  45. rel-up: rel-dirty
  46. $(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
  47. PKG_TAG = $(shell date +%Y%m%d)
  48. PKG_DOC = "Outline-based notes management and organizer"
  49. PKG_REQ = "nil"
  50. elpa: ORG_MAKE_DOC=info # do not make HTML PDF card documentation
  51. elpa: cleanall doc elpa-dirty
  52. elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
  53. elpa-dirty:
  54. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
  55. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  56. ln -s . $(ORGDIR)
  57. echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" >org-pkg.el
  58. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  59. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  60. -@$(RM) $(ORGDIR) org-pkg.el
  61. elpa-up: elpa-dirty
  62. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  63. tagwarn:
  64. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  65. $(info ======================================================) \
  66. $(info = =) \
  67. $(info = A release should only be made from a revision that =) \
  68. $(info = has an annotated tag! =) \
  69. $(info = =) \
  70. $(info ======================================================))
  71. version:
  72. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  73. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  74. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  75. cleanall clean: cleanrel
  76. cleanrel:
  77. -$(RM) org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  78. doc-up:
  79. $(MAKE) -C doc html manual guide
  80. $(CP) doc/org.html $(SERVROOT)
  81. $(CP) doc/manual/* $(SERVROOT)/manual
  82. $(CP) doc/guide/* $(SERVROOT)/guide
  83. upload upload-elpa upload-release upload-doc: ORG_MAKE_DOC=info pdf card
  84. upload: cleanall doc elpa-up rel-up doc-up
  85. upload-elpa: cleanall doc elpa-up
  86. upload-release: cleanall doc rel-up
  87. upload-doc: cleanall doc doc-up