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')
8 BANANA
:= $(shell ( [ -d ..
/banana
] && echo
`pwd`"/../banana" ) || echo
"/home/web/dev/banana")
10 VERSION
= $(VERSNUM
)$(VERSTAG
)
13 PKG_DIST
= $(PKG_NAME
)-$(VERSION
)
14 PKG_FILES
= AUTHORS ChangeLog COPYING README Makefile
15 PKG_DIRS
= configs htdocs
include install.d plugins po scripts templates upgrade
17 VCS_FILTER
= ! -name .arch-ids
! -name CVS
20 @echo
"Downloading $@ from $(DOWNLOAD_SRC)"
21 wget
$(DOWNLOAD_SRC
) -O
$@
-q ||
($(RM
) $@
; exit
1)
24 ################################################################################
29 build
: core conf static banana wiki openid medals jquery
32 @echo
-e
"Code statistics\n"
33 @sloccount
$(filter-out wiki
/ spool
/, $(wildcard */)) 2> /dev
/null | egrep
'^[a-z]*:'
35 %: %.in Makefile ChangeLog
36 sed
-e
's,@VERSION@,$(VERSION),g' $< > $@
38 ################################################################################
46 [ -d core
/.git
] ||
( git submodule init
&& git submodule update
)
53 conf
: spool
/templates_c spool
/mails_c classes
/platalglobals.php configs
/platal.cron htdocs
/.htaccess spool
/conf spool
/tmp
55 spool
/templates_c spool
/mails_c spool
/uploads spool
/conf spool
/tmp
:
59 htdocs
/.htaccess
: htdocs
/.htaccess.in Makefile
60 @REWRITE_BASE
="/~$$(id -un)"; \
61 test "$$REWRITE_BASE" = "/~web" && REWRITE_BASE
="/"; \
62 sed
-e
"s,@REWRITE_BASE@,$$REWRITE_BASE,g" $< > $@
67 static
: htdocs
/javascript@VERSION
69 %@VERSION
: % Makefile ChangeLog
70 cd
$< && rm -f
$(VERSION
) && ln
-sf .
$(VERSION
)
77 wiki
/local
/farmconfig.php \
78 wiki
/pub
/skins
/empty \
79 wiki
/cookbook
/e-protect.php \
84 wiki
: get-wiki build-wiki
86 build-wiki
: $(WIKI_NEEDS
) | get-wiki
89 cd htdocs
&& ln
-sf ..
/spool
/uploads
92 cd htdocs
&& ln
-sf ..
/wiki
/pub wiki
98 cd
$@
&& ln
-sf ..
/..
/include/wiki
/wiki.d
/* .
101 wiki
/cookbook
/e-protect.php
:
102 cd wiki
/cookbook
&& ln
-sf ..
/..
/include/wiki
/e-protect.php
104 wiki
/local
/farmconfig.php
:
105 cd wiki
/local
/ && ln
-sf ..
/..
/include/wiki
/farmconfig.php
107 wiki
/pub
/skins
/empty
:
108 cd wiki
/pub
/skins
/ && ln
-sf ..
/..
/..
/include/wiki
/empty
112 @if
! test -d wiki
; then \
113 wget http
://www.pmwiki.org
/pub
/pmwiki
/pmwiki-latest.tgz
; \
114 tar -xzvf pmwiki-latest.tgz
; \
115 rm pmwiki-latest.tgz
; \
123 openid
: get-openid spool
/openid
/store
125 # There is no obvious way to automatically use the latest version
126 OPENID_VERSION
= 2.1.3
128 @if
! test -d
include/Auth
; then \
129 wget http
://openidenabled.com
/files
/php-openid
/packages
/php-openid-
$(OPENID_VERSION
).
tar.bz2
; \
130 tar -xjf php-openid-
$(OPENID_VERSION
).
tar.bz2
; \
131 mv php-openid-
$(OPENID_VERSION
)/Auth
include/; \
132 rm php-openid-
$(OPENID_VERSION
).
tar.bz2
; \
133 rm -r php-openid-
$(OPENID_VERSION
); \
144 banana
: htdocs
/images
/banana htdocs
/css
/banana.css
include/banana
/banana.inc.php
145 htdocs
/images
/banana
:
146 cd
$(@D
) && ln
-snf
$(BANANA
)/img
$(@F
)
148 htdocs
/css
/banana.css
:
149 cd
$(@D
) && ln
-snf
$(BANANA
)/css
/style.css
$(@F
)
151 include/banana
/banana.inc.php
:
152 cd
$(@D
) && find
$(BANANA
)/banana
/ -name
'*.php' -exec ln
-snf
{} .
";"
157 MEDAL_PICTURES
=$(wildcard htdocs
/images
/medals
/*.jpg
)
158 MEDAL_THUMBNAILS
=$(subst /medals
/,/medals
/thumb
/,$(MEDAL_PICTURES
))
160 medals
: $(MEDAL_THUMBNAILS
)
162 $(MEDAL_THUMBNAILS
): $(subst /medals
/thumb
/,/medals
/,$(@F
))
163 convert
-resize x50
$(subst /medals
/thumb
/,/medals
/,$@
) $@
170 JQUERY_PLUGINS_PATHES
=$(addprefix htdocs
/javascript
/jquery.
,$(addsuffix .js
,$(JQUERY_PLUGINS
)))
172 # TODO: jquery.autocomplete.js should rather be downloaded from an official source. The issue
173 # is that the version we use is not available anymore on the Internet, and the latest version
174 # we could use is not backward compatible with our current code.
175 jquery
: htdocs
/javascript
/jquery.js
$(JQUERY_PLUGINS_PATHES
)
177 htdocs
/javascript
/jquery.js
: DOWNLOAD_SRC
= http
://jquery.com
/src
/jquery-latest.min.js
178 htdocs
/javascript
/jquery.js
:
181 $(JQUERY_PLUGINS_PATHES
): DOWNLOAD_SRC
= http
://plugins.jquery.com
/files
/$(@F
).txt
182 $(JQUERY_PLUGINS_PATHES
):
185 ################################################################################
187 .PHONY
: build
dist clean core wiki build-wiki banana htdocs
/images
/banana htdocs
/css
/banana.css
include/banana
/banana.inc.php http
*