server.mk 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 org-*.tar ELPA archive)
  16. $(info elpaplus - clean up, create the org-plus-contrib-*.tar ELPA archive)
  17. $(info upload-release - clean up, populate the server with arhives)
  18. $(info upload-elpa - clean up, populate the server with org-*.tar)
  19. $(info upload-elpaplus - clean up, populate the server with org-plus-contrib-*.tar)
  20. $(info upload-doc - clean up, populate the server with docs)
  21. $(info upload - clean up, populate the server with everything)
  22. helpserver::
  23. @echo ""
  24. #----------------------------------------------------------------------
  25. SERVROOT ?= /var/www/orgmode.org
  26. SERVERMK ?= true # or just any value at all, really
  27. #----------------------------------------------------------------------
  28. ORGFULL = README COPYING lisp/ \
  29. Makefile request-assign-future.txt \
  30. mk/default.mk mk/targets.mk mk/version.mk \
  31. mk/org-fixup.el \
  32. etc/ contrib/ doc/ testing/
  33. ORGFULL := $(ORGFULL:%/=%/*)
  34. ORGELPA = README_ELPA COPYING etc/ORG-NEWS lisp/ \
  35. doc/dir doc/org doc/orgcard.pdf \
  36. etc/styles/ org-pkg.el
  37. ORGELPA := $(ORGELPA:%/=%/*)
  38. ORGELPAPLUS := $(ORGELPA:org-pkg%=org-plus-contrib-pkg%)
  39. release: cleanall info pdf card rel-dirty tagwarn
  40. rel-dirty rel-up: ORGDIR=org-$(GITVERSION:release_%=%)
  41. rel-dirty:
  42. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-dist version autoloads
  43. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGRZIP)
  44. ln -s . $(ORGDIR)
  45. tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  46. zip -r9 $(ORGDIR).zip $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  47. -@$(RM) $(ORGDIR)
  48. rel-up: info pdf card rel-dirty
  49. $(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
  50. PKG_TAG = $(shell date +%Y%m%d)
  51. PKG_DOC = "Outline-based notes management and organizer"
  52. PKG_REQ = "" # marmalade chokes on explicit "nil"
  53. elpa: cleanall info card elpa-dirty
  54. elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
  55. elpa-dirty:
  56. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
  57. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  58. ln -s . $(ORGDIR)
  59. echo "(define-package \"org\"" > org-pkg.el
  60. echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-pkg.el
  61. echo ";; Local Variables:" >> org-pkg.el
  62. echo ";; no-byte-compile: t" >> org-pkg.el
  63. echo ";; End:" >> org-pkg.el
  64. tar --exclude=Makefile \
  65. --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  66. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  67. -@$(RM) $(ORGDIR) org-pkg.el
  68. elpa-up: info card elpa-dirty archive-contents
  69. $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/elpa/
  70. archive-contents:
  71. echo "(1 (org . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar])" > $@
  72. echo " (org-plus-contrib . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar]))" >> $@
  73. elpaplus: cleanall info card elpaplus-dirty
  74. elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org*.el ob-*.el ox-*.el
  75. elpaplus-dirty elpaplus-up: ORGDIR=org-plus-contrib-$(PKG_TAG)
  76. elpaplus-dirty:
  77. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads
  78. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  79. ln -s . $(ORGDIR)
  80. echo "(define-package \"org-plus-contrib\"" > org-plus-contrib-pkg.el
  81. echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-plus-contrib-pkg.el
  82. echo ";; Local Variables:" >> org-plus-contrib-pkg.el
  83. echo ";; no-byte-compile: t" >> org-plus-contrib-pkg.el
  84. echo ";; End:" >> org-plus-contrib-pkg.el
  85. tar --exclude=Makefile \
  86. --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  87. $(foreach dist, $(ORGELPAPLUS), $(ORGDIR)/$(dist))
  88. -@$(RM) $(ORGDIR) org-plus-contrib-pkg.el
  89. @$(MAKE) cleanlisp
  90. elpaplus-up: info card elpaplus-dirty archive-contents
  91. $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/elpa/
  92. tagwarn:
  93. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  94. $(info ======================================================) \
  95. $(info = =) \
  96. $(info = A release should only be made from a revision that =) \
  97. $(info = has an annotated tag! =) \
  98. $(info = =) \
  99. $(info ======================================================))
  100. version:
  101. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  102. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  103. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  104. cleanall clean: cleanrel
  105. cleanrel:
  106. -$(RM) archive-contents org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  107. doc-up: info pdf card html
  108. $(MAKE) -C doc manual guide
  109. $(CP) doc/org.html $(SERVROOT)
  110. $(CP) doc/org.pdf $(SERVROOT)
  111. $(CP) doc/orgguide.pdf $(SERVROOT)
  112. $(CP) doc/manual/* $(SERVROOT)/manual
  113. $(CP) doc/guide/* $(SERVROOT)/guide
  114. upload: cleanall rel-up doc-up elpa-up elpaplus-up
  115. upload-elpa: cleanall elpa-up
  116. upload-elpaplus: cleanall elpaplus-up
  117. upload-release: cleanall rel-up
  118. upload-doc: cleanall doc-up