2 # $Id: Makefile,v 1.5 2004/11/25 20:18:39 x99laine Exp $
3 ################################################################################
6 VERSNUM
:= $(shell grep VERSION ChangeLog | head
-1 | sed
-e
"s/VERSION //;s/ .*//")
7 VERSTAG
:= $(shell grep VERSION ChangeLog | head
-1 | grep
'XX' > /dev
/null
2> /dev
/null
&& echo
'beta')
9 VERSION
= $(VERSNUM
)$(VERSTAG
)
12 PKG_DIST
= $(PKG_NAME
)-$(VERSION
)
13 PKG_FILES
= AUTHORS ChangeLog COPYING README Makefile
14 PKG_DIRS
= configs htdocs
include install.d plugins po scripts templates upgrade
16 VCS_FILTER
= ! -name .arch-ids
! -name CVS
19 @echo
"Downloading $@ from $(DOWNLOAD_SRC)"
20 wget
$(DOWNLOAD_SRC
) -O
$@
-q ||
($(RM
) $@
; exit
1)
23 ################################################################################
28 build
: core conf static banana wiki openid medals jquery maps
31 @
!(find .
-name
'*.php' -exec php
-l
{} ";" | grep
-v
'No syntax errors detected')
37 @echo
-e
"Code statistics\n"
38 @sloccount
$(filter-out wiki
/ spool
/, $(wildcard */)) 2> /dev
/null | egrep
'^[a-z]*:'
40 %: %.in Makefile ChangeLog
41 sed
-e
's,@VERSION@,$(VERSION),g' $< > $@
45 @git fetch
&& git rebase
`git symbolic-ref HEAD | sed -e 's~refs/heads/~origin/~'` && git submodule update
48 @doxygen core
/doc
/doxygen.cfg
50 ################################################################################
58 [ -d core
/.git
] ||
( git submodule init
&& git submodule update
)
65 conf
: spool
/templates_c spool
/mails_c classes
/platalglobals.php configs
/platal.cron htdocs
/.htaccess spool
/conf spool
/tmp spool
/banana
67 spool
/templates_c spool
/mails_c spool
/uploads spool
/conf spool
/tmp spool
/run spool
/banana
:
71 htdocs
/.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" $< > $@
79 static
: htdocs
/javascript
/core.js htdocs
/javascript@VERSION htdocs
/javascript
/json2.js
81 htdocs
/javascript
/core.js
:
82 cd htdocs
/javascript
/ && ln
-s ..
/..
/core
/htdocs
/javascript
/core.js
84 %@VERSION
: % Makefile ChangeLog
85 cd
$< && rm -f
$(VERSION
) && ln
-sf .
$(VERSION
)
87 htdocs
/javascript
/json2.js
: DOWNLOAD_SRC
= https
://github.com
/douglascrockford
/JSON-js
/raw
/master
/json2.js
--no-check-certificate
88 htdocs
/javascript
/json2.js
:
96 wiki
/local
/farmconfig.php \
97 wiki
/pub
/skins
/empty \
98 wiki
/cookbook
/e-protect.php \
103 wiki
: get-wiki build-wiki
105 build-wiki
: $(WIKI_NEEDS
) | get-wiki
108 cd htdocs
&& ln
-sf ..
/spool
/uploads
111 cd htdocs
&& ln
-sf ..
/wiki
/pub wiki
117 cd
$@
&& ln
-sf ..
/..
/include/wiki
/wiki.d
/* .
120 wiki
/cookbook
/e-protect.php
:
121 cd wiki
/cookbook
&& ln
-sf ..
/..
/include/wiki
/e-protect.php
123 wiki
/local
/farmconfig.php
:
124 cd wiki
/local
/ && ln
-sf ..
/..
/include/wiki
/farmconfig.php
126 wiki
/pub
/skins
/empty
:
127 cd wiki
/pub
/skins
/ && ln
-sf ..
/..
/..
/include/wiki
/empty
131 @if
! test -d wiki
; then \
132 wget http
://www.pmwiki.org
/pub
/pmwiki
/pmwiki-latest.tgz
; \
133 tar -xzvf pmwiki-latest.tgz
; \
134 rm pmwiki-latest.tgz
; \
148 banana
: htdocs
/images
/banana htdocs
/css
/banana.css
149 htdocs
/images
/banana
: banana-sub
150 cd
$(@D
) && ln
-snf ..
/..
/banana
/img
$(@F
)
152 htdocs
/css
/banana.css
: banana-sub
153 cd
$(@D
) && ln
-snf ..
/..
/banana
/css
/style.css
$(@F
)
161 MEDAL_PICTURES
=$(wildcard htdocs
/images
/medals
/*.jpg
)
162 MEDAL_THUMBNAILS
=$(subst /medals
/,/medals
/thumb
/,$(MEDAL_PICTURES
))
164 medals
: $(MEDAL_THUMBNAILS
)
166 $(MEDAL_THUMBNAILS
): $(subst /medals
/thumb
/,/medals
/,$(@F
))
167 convert
-resize x50
$(subst /medals
/thumb
/,/medals
/,$@
) $@
173 JQUERY_PLUGINS
=color form
174 JQUERY_PLUGINS_PATHES
=$(addprefix htdocs
/javascript
/jquery.
,$(addsuffix .js
,$(JQUERY_PLUGINS
)))
176 JQUERY_UI_VERSION
=1.8.10
177 JQUERY_UI
=core widget tabs datepicker autocomplete position
178 JQUERY_UI_PATHES
=$(addprefix htdocs
/javascript
/jquery.ui.
,$(addsuffix .js
,$(JQUERY_UI
)))
180 JQUERY_TMPL_VERSION
=vBeta1.0
.0
181 JQUERY_TMPL_PATH
=htdocs
/javascript
/jquery.tmpl.js
183 JSTREE_VERSION
=1.0rc2
184 JSTREE_PATH
=htdocs
/javascript
/jquery.jstree.js
186 jquery
: htdocs
/javascript
/jquery.xorg.js htdocs
/javascript
/jquery.ui.xorg.js
$(JSTREE_PATH
)
188 htdocs
/javascript
/jquery.xorg.js
: htdocs
/javascript
/jquery.js
$(JQUERY_PLUGINS_PATHES
) $(JQUERY_TMPL_PATH
)
191 htdocs
/javascript
/jquery.ui.xorg.js
: $(JQUERY_UI_PATHES
) htdocs
/javascript
/jquery.ui.datepicker-fr.js
194 htdocs
/javascript
/jquery-
$(JQUERY_VERSION
).min.js
: DOWNLOAD_SRC
= http
://jquery.com
/src
/$(@F
)
195 htdocs
/javascript
/jquery-
$(JQUERY_VERSION
).min.js
:
196 @
-rm htdocs
/javascript
/jquery-
*.min.js
199 htdocs
/javascript
/jquery.js
: htdocs
/javascript
/jquery-
$(JQUERY_VERSION
).min.js
202 $(JQUERY_PLUGINS_PATHES
): DOWNLOAD_SRC
= http
://plugins.jquery.com
/files
/$(@F
)_0.txt
203 $(JQUERY_PLUGINS_PATHES
):
204 @
-rm htdocs
/javascript
/jquery.ui
*.
$*.js
207 htdocs
/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
208 htdocs
/javascript
/jquery.ui-
$(JQUERY_UI_VERSION
).
%.js
:
211 htdocs
/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
212 htdocs
/javascript
/jquery.ui-
$(JQUERY_UI_VERSION
).datepicker-fr.js
:
215 $(JQUERY_UI_PATHES
) htdocs
/javascript
/jquery.ui.datepicker-fr.js
: htdocs
/javascript
/jquery.ui.
%.js
: htdocs
/javascript
/jquery.ui-
$(JQUERY_UI_VERSION
).
%.js
218 htdocs
/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
219 htdocs
/javascript
/jquery.tmpl-
$(JQUERY_TMPL_VERSION
).js
:
220 @
-rm htdocs
/javascript
/jquery.tmpl
*.js
223 $(JQUERY_TMPL_PATH
): htdocs
/javascript
/jquery.tmpl-
$(JQUERY_TMPL_VERSION
).js
227 rm -f htdocs
/javascript
/jquery.jstree-
*.js
228 mkdir spool
/tmp
/jstree
229 wget http
://jstree.googlecode.com
/files
/jsTree.v.
$(JSTREE_VERSION
).zip
-O spool
/tmp
/jstree
/jquery.jstree-
$(JSTREE_VERSION
).zip
230 unzip spool
/tmp
/jstree
/jquery.jstree-
$(JSTREE_VERSION
).zip
-d spool
/tmp
/jstree
/
231 mv
-f spool
/tmp
/jstree
/themes
/default
/style.css htdocs
/css
/jstree.css
232 mv
-f spool
/tmp
/jstree
/themes
/default
/d.png htdocs
/images
/jstree.png
233 mv
-f spool
/tmp
/jstree
/jquery.jstree.js htdocs
/javascript
/jquery.jstree-
$(JSTREE_VERSION
).js
234 sed
-i
-e
's/"d\.png"/"..\/images\/jstree.png"/' htdocs
/css
/jstree.css
235 sed
-i
-e
's/"throbber\.gif"/"..\/images\/wait.gif"/' htdocs
/css
/jstree.css
236 sed
-i
-e
's/#ffffee/inherit/' htdocs
/css
/jstree.css
237 ln
-snf jquery.jstree-
$(JSTREE_VERSION
).js htdocs
/javascript
/jquery.jstree.js
238 rm -Rf spool
/tmp
/jstree
241 ## Maps auxiliary scripts
243 maps
: htdocs
/javascript
/markerclusterer.js
245 ## Try and use taged version asap (from http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/…).
246 htdocs
/javascript
/markerclusterer.js
:
247 wget
"http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js?r=308" -O htdocs
/javascript
/markerclusterer.js
252 start-listrpc
: spool
/run
253 sudo
-u list
/sbin
/start-stop-daemon
--pidfile spool
/run
/listrpc.pid
-m
-b
-x
$$PWD/bin
/lists.rpc.py
--start
255 @sudo
-u list kill
-0 $$(cat spool
/run
/listrpc.pid
)
257 start-listrpc-fg
: spool
/run
258 sudo
-u list .
/bin
/lists.rpc.py
261 -sudo
-u list
/sbin
/start-stop-daemon
--pidfile spool
/run
/listrpc.pid
--stop
262 @
-rm -f spool
/run
/listrpc.pid
264 restart-listrpc
: stop-listrpc start-listrpc
266 ################################################################################
268 .PHONY
: build
dist clean core http
* check test
269 .PHONY
: wiki build-wiki
270 .PHONY
: banana banana-sub htdocs
/images
/banana htdocs
/css
/banana.css
271 .PHONY
: start-listrpc start-listrpc-fg stop-listrpc restart-listrpc
272 .PHONY
: up update doc