server.mk 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 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 ";; no-byte-compile: t" >> org-pkg.el
  62. tar --exclude=Makefile --exclude="org-colview-xemacs.el" \
  63. --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  64. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  65. -@$(RM) $(ORGDIR) org-pkg.el
  66. elpa-up: info card elpa-dirty archive-contents
  67. $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/elpa/
  68. archive-contents:
  69. echo "(1 (org . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar])" > $@
  70. echo " (org-plus-contrib . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar]))" >> $@
  71. elpaplus: cleanall info card elpaplus-dirty
  72. elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-* ob-* ox-*
  73. elpaplus-dirty elpaplus-up: ORGDIR=org-plus-contrib-$(PKG_TAG)
  74. elpaplus-dirty:
  75. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads
  76. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  77. ln -s . $(ORGDIR)
  78. echo "(define-package \"org-plus-contrib\"" > org-plus-contrib-pkg.el
  79. echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-plus-contrib-pkg.el
  80. echo ";; no-byte-compile: t" >> org-plus-contrib-pkg.el
  81. tar --exclude=Makefile --exclude="org-colview-xemacs.el" \
  82. --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  83. $(foreach dist, $(ORGELPAPLUS), $(ORGDIR)/$(dist))
  84. -@$(RM) $(ORGDIR) org-plus-contrib-pkg.el
  85. @$(MAKE) cleanlisp
  86. elpaplus-up: info card elpaplus-dirty archive-contents
  87. $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/elpa/
  88. tagwarn:
  89. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  90. $(info ======================================================) \
  91. $(info = =) \
  92. $(info = A release should only be made from a revision that =) \
  93. $(info = has an annotated tag! =) \
  94. $(info = =) \
  95. $(info ======================================================))
  96. version:
  97. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  98. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  99. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  100. cleanall clean: cleanrel
  101. cleanrel:
  102. -$(RM) archive-contents org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  103. doc-up: info pdf card html
  104. $(MAKE) -C doc manual guide
  105. $(CP) doc/org.html $(SERVROOT)
  106. $(CP) doc/org.pdf $(SERVROOT)
  107. $(CP) doc/orgguide.pdf $(SERVROOT)
  108. $(CP) doc/manual/* $(SERVROOT)/manual
  109. $(CP) doc/guide/* $(SERVROOT)/guide
  110. upload: cleanall rel-up doc-up elpa-up elpaplus-up
  111. upload-elpa: cleanall elpa-up
  112. upload-elpaplus: cleanall elpaplus-up
  113. upload-release: cleanall rel-up
  114. upload-doc: cleanall doc-up