server.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. release: cleanall info pdf card rel-dirty tagwarn
  36. rel-dirty rel-up: ORGDIR=org-$(GITVERSION:release_%=%)
  37. rel-dirty:
  38. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-dist version autoloads
  39. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGRZIP)
  40. ln -s . $(ORGDIR)
  41. tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  42. zip -r9 $(ORGDIR).zip $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  43. -@$(RM) $(ORGDIR)
  44. rel-up: info pdf card rel-dirty
  45. $(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
  46. PKG_TAG = $(shell date +%Y%m%d)
  47. PKG_DOC = "Outline-based notes management and organizer"
  48. PKG_REQ = "nil"
  49. elpa: cleanall info card elpa-dirty
  50. elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
  51. elpa-dirty:
  52. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
  53. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  54. ln -s . $(ORGDIR)
  55. echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" \
  56. > org-pkg.el
  57. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  58. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  59. -@$(RM) $(ORGDIR) org-pkg.el
  60. elpa-up: info card elpa-dirty
  61. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  62. elpaplus: cleanall info card elpaplus-dirty
  63. elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-*
  64. elpaplus-dirty elpaplus-up: ORGDIR=orgplus-$(PKG_TAG)
  65. elpaplus-dirty:
  66. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads
  67. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  68. ln -s . $(ORGDIR)
  69. echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" \
  70. > org-pkg.el
  71. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  72. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  73. -@$(RM) $(ORGDIR) org-pkg.el
  74. @$(MAKE) cleanlisp
  75. elpaplus-up: info card elpaplus-dirty
  76. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  77. tagwarn:
  78. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  79. $(info ======================================================) \
  80. $(info = =) \
  81. $(info = A release should only be made from a revision that =) \
  82. $(info = has an annotated tag! =) \
  83. $(info = =) \
  84. $(info ======================================================))
  85. version:
  86. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  87. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  88. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  89. cleanall clean: cleanrel
  90. cleanrel:
  91. -$(RM) org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  92. doc-up: info pdf card html
  93. $(MAKE) -C doc manual guide
  94. $(CP) doc/org.html $(SERVROOT)
  95. $(CP) doc/manual/* $(SERVROOT)/manual
  96. $(CP) doc/guide/* $(SERVROOT)/guide
  97. upload: cleanall elpa-up rel-up doc-up elpaplus-up
  98. upload-elpa: cleanall elpa-up
  99. upload-elpaplus: cleanall elpaplus-up
  100. upload-release: cleanall rel-up
  101. upload-doc: cleanall doc-up