Updates email_virtual so that it only contains forlife emails.
[platal.git] / Makefile
CommitLineData
b6cdf7b4 1
0337d704 2# $Id: Makefile,v 1.5 2004/11/25 20:18:39 x99laine Exp $
3################################################################################
4# definitions
5
8fc4efa3 6VERSNUM := $(shell grep VERSION ChangeLog | head -1 | sed -e "s/VERSION //;s/ .*//")
7VERSTAG := $(shell grep VERSION ChangeLog | head -1 | grep 'XX' > /dev/null 2> /dev/null && echo 'beta')
5b677a86 8
8fc4efa3 9VERSION = $(VERSNUM)$(VERSTAG)
0337d704 10
11PKG_NAME = platal
12PKG_DIST = $(PKG_NAME)-$(VERSION)
13PKG_FILES = AUTHORS ChangeLog COPYING README Makefile
14PKG_DIRS = configs htdocs include install.d plugins po scripts templates upgrade
15
16VCS_FILTER = ! -name .arch-ids ! -name CVS
17
5594f3a9
FB
18define download
19@echo "Downloading $@ from $(DOWNLOAD_SRC)"
20wget $(DOWNLOAD_SRC) -O $@ -q || ($(RM) $@; exit 1)
21endef
22
0337d704 23################################################################################
24# global targets
25
26all: build
27
e97df22e 28build: core conf static banana wiki openid medals jquery
0337d704 29
cef8ceb2 30check:
1eaaa62d 31 @!(find . -name '*.php' -exec php -l {} ";" | grep -v 'No syntax errors detected')
cef8ceb2 32
fd48ab5f
FB
33test:
34 make -C core test
35
63528107 36q:
37 @echo -e "Code statistics\n"
38 @sloccount $(filter-out wiki/ spool/, $(wildcard */)) 2> /dev/null | egrep '^[a-z]*:'
39
5e73ff67 40%: %.in Makefile ChangeLog
0337d704 41 sed -e 's,@VERSION@,$(VERSION),g' $< > $@
42
8b944f3e
FB
43up: update
44update:
45 @git fetch && git rebase `git symbolic-ref HEAD | sed -e 's~refs/heads/~origin/~'` && git submodule update
46
98c7bd6a 47doc:
eecde6a3 48 @doxygen core/doc/doxygen.cfg
98c7bd6a 49
0337d704 50################################################################################
b66268df 51# targets
91f37c81 52
9380b1bf 53##
54## core
55##
56
7e846cdf 57core:
ba47d308 58 [ -d core/.git ] || ( git submodule init && git submodule update )
7e846cdf
FB
59 make -C core all
60
61##
62## conf
63##
64
5f0ecf6c 65conf: spool/templates_c spool/mails_c classes/platalglobals.php configs/platal.cron htdocs/.htaccess spool/conf spool/tmp spool/banana
9380b1bf 66
5f0ecf6c 67spool/templates_c spool/mails_c spool/uploads spool/conf spool/tmp spool/run spool/banana:
91f37c81 68 mkdir -p $@
69 chmod o+w $@
70
b6cdf7b4 71htdocs/.htaccess: htdocs/.htaccess.in Makefile
72 @REWRITE_BASE="/~$$(id -un)"; \
73 test "$$REWRITE_BASE" = "/~web" && REWRITE_BASE="/"; \
74 sed -e "s,@REWRITE_BASE@,$$REWRITE_BASE,g" $< > $@
9380b1bf 75
76##
e97df22e
VZ
77## static content
78##
40324482 79static: htdocs/javascript/core.js htdocs/javascript@VERSION htdocs/javascript/json2.js
e5b254d5
FB
80
81htdocs/javascript/core.js:
82 cd htdocs/javascript/ && ln -s ../../core/htdocs/javascript/core.js
e97df22e
VZ
83
84%@VERSION: % Makefile ChangeLog
85 cd $< && rm -f $(VERSION) && ln -sf . $(VERSION)
86
40324482
FB
87htdocs/javascript/json2.js: DOWNLOAD_SRC = https://github.com/douglascrockford/JSON-js/raw/master/json2.js --no-check-certificate
88htdocs/javascript/json2.js:
89 @$(download)
90
e97df22e 91##
9380b1bf 92## wiki
93##
94
95WIKI_NEEDS = \
96 wiki/local/farmconfig.php \
97 wiki/pub/skins/empty \
98 wiki/cookbook/e-protect.php \
99 spool/wiki.d \
100 htdocs/uploads \
101 htdocs/wiki \
102
103wiki: get-wiki build-wiki
104
105build-wiki: $(WIKI_NEEDS) | get-wiki
106
c31c4e6a 107htdocs/uploads:
9380b1bf 108 cd htdocs && ln -sf ../spool/uploads
109
110htdocs/wiki:
111 cd htdocs && ln -sf ../wiki/pub wiki
112
113
91f37c81 114spool/wiki.d:
b66268df 115 mkdir -p $@
116 chmod o+w $@
2c799249 117 cd $@ && ln -sf ../../include/wiki/wiki.d/* .
91f37c81 118
9380b1bf 119
4887dc90 120wiki/cookbook/e-protect.php:
2c799249 121 cd wiki/cookbook && ln -sf ../../include/wiki/e-protect.php
0337d704 122
796aea34 123wiki/local/farmconfig.php:
2c799249 124 cd wiki/local/ && ln -sf ../../include/wiki/farmconfig.php
b66268df 125
126wiki/pub/skins/empty:
2c799249 127 cd wiki/pub/skins/ && ln -sf ../../../include/wiki/empty
b66268df 128
9380b1bf 129
d207e9f5 130get-wiki:
131 @if ! test -d wiki; then \
91a3c521
FB
132 wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz; \
133 tar -xzvf pmwiki-latest.tgz; \
134 rm pmwiki-latest.tgz; \
135 mv pmwiki-* wiki; \
bba430bf
AA
136 fi
137
138##
139## openid
140##
141
a1af4a99 142openid: get-openid spool/openid/store
bba430bf
AA
143
144# There is no obvious way to automatically use the latest version
91a3c521
FB
145OPENID_VERSION = 2.2.2
146OPENID_COMMIT = 782224d
bba430bf 147get-openid:
b69727b4 148 @if ! test -d include/Auth; then \
91a3c521
FB
149 wget --no-check-certificate \
150 https://github.com/openid/php-openid/tarball/$(OPENID_VERSION) \
151 -O php-openid-$(OPENID_VERSION).tar.gz; \
152 tar -xzf php-openid-$(OPENID_VERSION).tar.gz; \
153 mv openid-php-openid-$(OPENID_COMMIT)/Auth include/; \
154 rm php-openid-$(OPENID_VERSION).tar.gz; \
155 rm -r openid-php-openid-$(OPENID_COMMIT); \
d207e9f5 156 fi
157
a1af4a99
AA
158spool/openid/store:
159 mkdir -p $@
160 chmod o+w $@
161
9380b1bf 162##
163## banana
164##
c3b581dc 165banana: htdocs/images/banana htdocs/css/banana.css
1fccdc24 166htdocs/images/banana: banana-sub
bdf8bbb2 167 cd $(@D) && ln -snf ../../banana/img $(@F)
08dbcb5a 168
1fccdc24 169htdocs/css/banana.css: banana-sub
bdf8bbb2 170 cd $(@D) && ln -snf ../../banana/css/style.css $(@F)
5b677a86 171
1fccdc24
FB
172banana-sub:
173 make -C banana
5b677a86 174
bd6a5fe3
VZ
175##
176## Medal thumbnails
177##
178MEDAL_PICTURES=$(wildcard htdocs/images/medals/*.jpg)
179MEDAL_THUMBNAILS=$(subst /medals/,/medals/thumb/,$(MEDAL_PICTURES))
180
181medals: $(MEDAL_THUMBNAILS)
5b677a86 182
bd6a5fe3
VZ
183$(MEDAL_THUMBNAILS): $(subst /medals/thumb/,/medals/,$(@F))
184 convert -resize x50 $(subst /medals/thumb/,/medals/,$@) $@
08dbcb5a 185
8c5c6d64 186##
187## jquery
188##
e6a2c4d5 189JQUERY_VERSION=1.5.1
21fb012b 190JQUERY_PLUGINS=color form
5594f3a9
FB
191JQUERY_PLUGINS_PATHES=$(addprefix htdocs/javascript/jquery.,$(addsuffix .js,$(JQUERY_PLUGINS)))
192
2409ba44 193JQUERY_UI_VERSION=1.8.10
b7bad73e 194JQUERY_UI=core widget tabs datepicker
889d9807 195JQUERY_UI_PATHES=$(addprefix htdocs/javascript/jquery.ui.,$(addsuffix .js,$(JQUERY_UI)))
16019034 196
aa0909f4
FB
197JQUERY_TMPL_VERSION=vBeta1.0.0
198JQUERY_TMPL_PATH=htdocs/javascript/jquery.tmpl.js
199
150a0a91
SJ
200JSTREE_VERSION=1.0rc2
201JSTREE_PATH=htdocs/javascript/jquery.jstree.js
202
dd916657
VZ
203# TODO: jquery.autocomplete.js should rather be downloaded from an official source. The issue
204# is that the version we use is not available anymore on the Internet, and the latest version
205# we could use is not backward compatible with our current code.
b7bad73e
FB
206jquery: htdocs/javascript/jquery.xorg.js htdocs/javascript/jquery.ui.xorg.js $(JSTREE_PATH)
207
208htdocs/javascript/jquery.xorg.js: htdocs/javascript/jquery.js $(JQUERY_PLUGINS_PATHES) $(JQUERY_TMPL_PATH) htdocs/javascript/jquery.autocomplete.js
209 cat $^ > $@
210
211htdocs/javascript/jquery.ui.xorg.js: $(JQUERY_UI_PATHES) htdocs/javascript/jquery.ui.datepicker-fr.js
212 cat $^ > $@
5594f3a9 213
889d9807
FB
214htdocs/javascript/jquery-$(JQUERY_VERSION).min.js: DOWNLOAD_SRC = http://jquery.com/src/$(@F)
215htdocs/javascript/jquery-$(JQUERY_VERSION).min.js:
07ea8c0e 216 @-rm htdocs/javascript/jquery-*.min.js
5594f3a9 217 @$(download)
8c5c6d64 218
889d9807 219htdocs/javascript/jquery.js: htdocs/javascript/jquery-$(JQUERY_VERSION).min.js
07ea8c0e 220 ln -snf $(<F) $@
889d9807 221
21fb012b 222$(JQUERY_PLUGINS_PATHES): DOWNLOAD_SRC = http://plugins.jquery.com/files/$(@F)_0.txt
5594f3a9 223$(JQUERY_PLUGINS_PATHES):
07ea8c0e 224 @-rm htdocs/javascript/jquery.ui*.$*.js
5594f3a9 225 @$(download)
de99248c 226
1b50c20c 227htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js: DOWNLOAD_SRC = http://jquery-ui.googlecode.com/svn/tags/$(JQUERY_UI_VERSION)/ui/minified/jquery.ui.$*.min.js
889d9807 228htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js:
16019034
FB
229 @$(download)
230
2409ba44
FB
231htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).datepicker-fr.js: DOWNLOAD_SRC = http://jquery-ui.googlecode.com/svn/tags/$(JQUERY_UI_VERSION)/ui/minified/i18n/jquery.ui.datepicker-fr.min.js
232htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).datepicker-fr.js:
233 @$(download)
234
235$(JQUERY_UI_PATHES) htdocs/javascript/jquery.ui.datepicker-fr.js: htdocs/javascript/jquery.ui.%.js: htdocs/javascript/jquery.ui-$(JQUERY_UI_VERSION).%.js
07ea8c0e 236 ln -snf $(<F) $@
889d9807 237
2c101eaa 238htdocs/javascript/jquery.tmpl-$(JQUERY_TMPL_VERSION).js: DOWNLOAD_SRC = https://github.com/jquery/jquery-tmpl/raw/$(JQUERY_TMPL_VERSION)/jquery.tmpl.js --no-check-certificate
aa0909f4
FB
239htdocs/javascript/jquery.tmpl-$(JQUERY_TMPL_VERSION).js:
240 @-rm htdocs/javascript/jquery.tmpl*.js
241 @$(download)
242
243$(JQUERY_TMPL_PATH): htdocs/javascript/jquery.tmpl-$(JQUERY_TMPL_VERSION).js
244 ln -snf $(<F) $@
245
150a0a91
SJ
246$(JSTREE_PATH):
247 rm -f htdocs/javascript/jquery.jstree-*.js
248 mkdir spool/tmp/jstree
249 wget http://jstree.googlecode.com/files/jsTree.v.$(JSTREE_VERSION).zip -O spool/tmp/jstree/jquery.jstree-$(JSTREE_VERSION).zip
250 unzip spool/tmp/jstree/jquery.jstree-$(JSTREE_VERSION).zip -d spool/tmp/jstree/
251 mv -f spool/tmp/jstree/themes/default/style.css htdocs/css/jstree.css
252 mv -f spool/tmp/jstree/themes/default/d.png htdocs/images/jstree.png
253 mv -f spool/tmp/jstree/jquery.jstree.js htdocs/javascript/jquery.jstree-$(JSTREE_VERSION).js
ac639b4c
PC
254 sed -i -e 's/"d\.png"/"..\/images\/jstree.png"/' htdocs/css/jstree.css
255 sed -i -e 's/"throbber\.gif"/"..\/images\/wait.gif"/' htdocs/css/jstree.css
256 sed -i -e 's/#ffffee/inherit/' htdocs/css/jstree.css
150a0a91
SJ
257 ln -snf jquery.jstree-$(JSTREE_VERSION).js htdocs/javascript/jquery.jstree.js
258 rm -Rf spool/tmp/jstree
259
260
c5644a5b
FB
261##
262## lists rpc
263##
264start-listrpc: spool/run
265 sudo -u list /sbin/start-stop-daemon --pidfile spool/run/listrpc.pid -m -b -x $$PWD/bin/lists.rpc.py --start
266 @sleep 2
267 @sudo -u list kill -0 $$(cat spool/run/listrpc.pid)
268
269start-listrpc-fg: spool/run
270 sudo -u list ./bin/lists.rpc.py
271
272stop-listrpc:
273 -sudo -u list /sbin/start-stop-daemon --pidfile spool/run/listrpc.pid --stop
274 @-rm -f spool/run/listrpc.pid
275
276restart-listrpc: stop-listrpc start-listrpc
277
0337d704 278################################################################################
b66268df 279
c3b581dc
FB
280.PHONY: build dist clean core http* check test
281.PHONY: wiki build-wiki
282.PHONY: banana banana-sub htdocs/images/banana htdocs/css/banana.css
c5644a5b 283.PHONY: start-listrpc start-listrpc-fg stop-listrpc restart-listrpc
98c7bd6a 284.PHONY: up update doc