server.mk 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. tagwarn:
  63. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  64. $(info ======================================================) \
  65. $(info = =) \
  66. $(info = A release should only be made from a revision that =) \
  67. $(info = has an annotated tag! =) \
  68. $(info = =) \
  69. $(info ======================================================))
  70. version:
  71. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  72. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  73. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  74. cleanall clean: cleanrel
  75. cleanrel:
  76. -$(RM) org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  77. doc-up: info pdf card html
  78. $(MAKE) -C doc manual guide
  79. $(CP) doc/org.html $(SERVROOT)
  80. $(CP) doc/manual/* $(SERVROOT)/manual
  81. $(CP) doc/guide/* $(SERVROOT)/guide
  82. upload: cleanall elpa-up rel-up doc-up
  83. upload-elpa: cleanall elpa-up
  84. upload-release: cleanall rel-up
  85. upload-doc: cleanall doc-up