server.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. SERVROOT ?= /var/www/orgmode.org
  24. SERVERMK ?= true # or just any value at all, really
  25. #----------------------------------------------------------------------
  26. ORGCOMM = README lisp/
  27. ORGFULL = $(ORGCOMM) Makefile request-assign-future.txt \
  28. mk/default.mk mk/targets.mk mk/version.mk \
  29. mk/org-fixup.el \
  30. etc/ contrib/ doc/
  31. ORGFULL := $(ORGFULL:%/=%/*)
  32. ORGELPA = $(ORGCOMM) doc/dir doc/org doc/orgcard.pdf \
  33. etc/styles/ org-pkg.el
  34. ORGELPA := $(ORGELPA:%/=%/*)
  35. ORGELPAPLUS := $(ORGELPA:org-pkg%=orgplus-pkg%)
  36. release: cleanall info pdf card 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: info pdf card 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: cleanall info card elpa-dirty
  51. elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
  52. elpa-dirty:
  53. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
  54. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  55. ln -s . $(ORGDIR)
  56. echo "(define-package \"orgplus\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" \
  57. > orgplus-pkg.el
  58. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  59. $(foreach dist, $(ORGELPAPLUS), $(ORGDIR)/$(dist))
  60. -@$(RM) $(ORGDIR) orgplus-pkg.el
  61. elpa-up: info card elpa-dirty
  62. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  63. elpaplus: cleanall info card elpaplus-dirty
  64. elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-*
  65. elpaplus-dirty elpaplus-up: ORGDIR=orgplus-$(PKG_TAG)
  66. elpaplus-dirty:
  67. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads
  68. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  69. ln -s . $(ORGDIR)
  70. echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" \
  71. > org-pkg.el
  72. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  73. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  74. -@$(RM) $(ORGDIR) org-pkg.el
  75. @$(MAKE) cleanlisp
  76. elpaplus-up: info card elpaplus-dirty
  77. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  78. tagwarn:
  79. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  80. $(info ======================================================) \
  81. $(info = =) \
  82. $(info = A release should only be made from a revision that =) \
  83. $(info = has an annotated tag! =) \
  84. $(info = =) \
  85. $(info ======================================================))
  86. version:
  87. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  88. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  89. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  90. cleanall clean: cleanrel
  91. cleanrel:
  92. -$(RM) org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  93. doc-up: info pdf card html
  94. $(MAKE) -C doc manual guide
  95. $(CP) doc/org.html $(SERVROOT)
  96. $(CP) doc/manual/* $(SERVROOT)/manual
  97. $(CP) doc/guide/* $(SERVROOT)/guide
  98. upload: cleanall elpa-up rel-up doc-up elpaplus-up
  99. upload-elpa: cleanall elpa-up
  100. upload-elpaplus: cleanall elpaplus-up
  101. upload-release: cleanall rel-up
  102. upload-doc: cleanall doc-up