server.mk 4.7 KB

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