Merge branch 'maint'
[org-mode/org-tableheadings.git] / mk / server.mk
blob4d9e9a927ddc489098c18696a9a1a35107af7ebd
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
11 help helpall helpserver::
12 $(info )
13 $(info Maintenance)
14 $(info ===========)
15 $(info release - clean up, create the distribution archives)
16 $(info elpa - clean up, create the org-*.tar ELPA archive)
17 $(info elpaplus - clean up, create the org-plus-contrib-*.tar ELPA archive)
18 $(info upload-release - clean up, populate the server with arhives)
19 $(info upload-elpa - clean up, populate the server with org-*.tar)
20 $(info upload-elpaplus - clean up, populate the server with org-plus-contrib-*.tar)
21 $(info upload-doc - clean up, populate the server with docs)
22 $(info upload - clean up, populate the server with everything)
24 helpserver::
25 @echo ""
27 #----------------------------------------------------------------------
29 SERVROOT ?= /var/www/orgmode.org
30 SERVERMK ?= true # or just any value at all, really
32 #----------------------------------------------------------------------
34 ORGFULL = README COPYING lisp/ \
35 Makefile request-assign-future.txt \
36 mk/default.mk mk/targets.mk mk/version.mk \
37 mk/org-fixup.el \
38 etc/ contrib/ doc/
39 ORGFULL := $(ORGFULL:%/=%/*)
40 ORGELPA = README_ELPA COPYING lisp/ \
41 doc/dir doc/org doc/orgcard.pdf \
42 etc/styles/ org-pkg.el
43 ORGELPA := $(ORGELPA:%/=%/*)
44 ORGELPAPLUS := $(ORGELPA:org-pkg%=org-plus-contrib-pkg%)
46 release: cleanall info pdf card rel-dirty tagwarn
47 rel-dirty rel-up: ORGDIR=org-$(GITVERSION:release_%=%)
48 rel-dirty:
49 @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-dist version autoloads
50 -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGRZIP)
51 ln -s . $(ORGDIR)
52 tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
53 zip -r9 $(ORGDIR).zip $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
54 -@$(RM) $(ORGDIR)
55 rel-up: info pdf card rel-dirty
56 $(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
58 PKG_TAG = $(shell date +%Y%m%d)
59 PKG_DOC = "Outline-based notes management and organizer"
60 PKG_REQ = "" # marmalade chokes on explicit "nil"
62 elpa: cleanall info card elpa-dirty
63 elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
64 elpa-dirty:
65 @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
66 -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
67 ln -s . $(ORGDIR)
68 echo "(define-package \"org\"" > org-pkg.el
69 echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-pkg.el
70 echo ";; no-byte-compile: t" >> org-pkg.el
71 tar --exclude=Makefile --exclude="org-colview-xemacs.el" \
72 --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
73 $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
74 -@$(RM) $(ORGDIR) org-pkg.el
75 elpa-up: info card elpa-dirty archive-contents
76 $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/elpa/
78 archive-contents:
79 echo "(1 (org . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar])" > $@
80 echo " (org-plus-contrib . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar]))" >> $@
82 elpaplus: cleanall info card elpaplus-dirty
83 elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-* ob-* ox-*
84 elpaplus-dirty elpaplus-up: ORGDIR=org-plus-contrib-$(PKG_TAG)
85 elpaplus-dirty:
86 @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads
87 -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
88 ln -s . $(ORGDIR)
89 echo "(define-package \"org-plus-contrib\"" > org-plus-contrib-pkg.el
90 echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-plus-contrib-pkg.el
91 echo ";; no-byte-compile: t" >> org-plus-contrib-pkg.el
92 tar --exclude=Makefile --exclude="org-colview-xemacs.el" \
93 --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
94 $(foreach dist, $(ORGELPAPLUS), $(ORGDIR)/$(dist))
95 -@$(RM) $(ORGDIR) org-plus-contrib-pkg.el
96 @$(MAKE) cleanlisp
97 elpaplus-up: info card elpaplus-dirty archive-contents
98 $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/elpa/
100 tagwarn:
101 $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
102 $(info ======================================================) \
103 $(info = =) \
104 $(info = A release should only be made from a revision that =) \
105 $(info = has an annotated tag! =) \
106 $(info = =) \
107 $(info ======================================================))
109 version:
110 @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
111 @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
112 @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
114 cleanall clean: cleanrel
115 cleanrel:
116 -$(RM) archive-contents org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
118 doc-up: info pdf card html
119 $(MAKE) -C doc manual guide
120 $(CP) doc/org.html $(SERVROOT)
121 $(CP) doc/org.pdf $(SERVROOT)
122 $(CP) doc/orgguide.pdf $(SERVROOT)
123 $(CP) doc/manual/* $(SERVROOT)/manual
124 $(CP) doc/guide/* $(SERVROOT)/guide
126 upload: cleanall rel-up doc-up elpa-up elpaplus-up
127 upload-elpa: cleanall elpa-up
128 upload-elpaplus: cleanall elpaplus-up
129 upload-release: cleanall rel-up
130 upload-doc: cleanall doc-up