Adds the precision that the site password has to be shorter than 10 characters
[platal.git] / Makefile
1
2 # $Id: Makefile,v 1.5 2004/11/25 20:18:39 x99laine Exp $
3 ################################################################################
4 # definitions
5
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")
9
10 VERSION = $(VERSNUM)$(VERSTAG)
11
12 PKG_NAME = platal
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
16
17 VCS_FILTER = ! -name .arch-ids ! -name CVS
18
19 ################################################################################
20 # global targets
21
22 all: build
23
24 build: core banana wiki jquery
25
26 q:
27 @echo -e "Code statistics\n"
28 @sloccount $(filter-out wiki/ spool/, $(wildcard */)) 2> /dev/null | egrep '^[a-z]*:'
29
30 %: %.in Makefile ChangeLog
31 sed -e 's,@VERSION@,$(VERSION),g' $< > $@
32
33 ################################################################################
34 # targets
35
36 ##
37 ## core
38 ##
39
40 core: spool/templates_c spool/mails_c include/globals.inc.php configs/platal.cron htdocs/.htaccess spool/conf spool/tmp
41
42 spool/templates_c spool/mails_c spool/uploads spool/conf spool/tmp:
43 mkdir -p $@
44 chmod o+w $@
45
46 htdocs/.htaccess: htdocs/.htaccess.in Makefile
47 @REWRITE_BASE="/~$$(id -un)"; \
48 test "$$REWRITE_BASE" = "/~web" && REWRITE_BASE="/"; \
49 sed -e "s,@REWRITE_BASE@,$$REWRITE_BASE,g" $< > $@
50
51 ##
52 ## wiki
53 ##
54
55 WIKI_NEEDS = \
56 wiki/local/farmconfig.php \
57 wiki/pub/skins/empty \
58 wiki/cookbook/e-protect.php \
59 spool/wiki.d \
60 htdocs/uploads \
61 htdocs/wiki \
62
63 wiki: get-wiki build-wiki
64
65 build-wiki: $(WIKI_NEEDS) | get-wiki
66
67 htdocs/uploads:
68 cd htdocs && ln -sf ../spool/uploads
69
70 htdocs/wiki:
71 cd htdocs && ln -sf ../wiki/pub wiki
72
73
74 spool/wiki.d:
75 mkdir -p $@
76 chmod o+w $@
77 cd $@ && ln -sf ../../include/wiki/wiki.d/* .
78
79
80 wiki/cookbook/e-protect.php:
81 cd wiki/cookbook && ln -sf ../../include/wiki/e-protect.php
82
83 wiki/local/farmconfig.php:
84 cd wiki/local/ && ln -sf ../../include/wiki/farmconfig.php
85
86 wiki/pub/skins/empty:
87 cd wiki/pub/skins/ && ln -sf ../../../include/wiki/empty
88
89
90 get-wiki:
91 @if ! test -d wiki; then \
92 wget http://www.pmwiki.org/pub/pmwiki/pmwiki-latest.tgz; \
93 tar -xzvf pmwiki-latest.tgz; \
94 rm pmwiki-latest.tgz; \
95 mv pmwiki-* wiki; \
96 fi
97
98 ##
99 ## banana
100 ##
101
102 banana: htdocs/images/banana htdocs/css/banana.css include/banana/banana.inc.php
103 htdocs/images/banana:
104 cd $(@D) && ln -snf $(BANANA)/img $(@F)
105
106 htdocs/css/banana.css:
107 cd $(@D) && ln -snf $(BANANA)/css/style.css $(@F)
108
109 include/banana/banana.inc.php:
110 cd $(@D) && find $(BANANA)/banana/ -name '*.php' -exec ln -snf {} . ";"
111
112
113
114 ##
115 ## jquery
116 ##
117
118 jquery: htdocs/javascript/jquery.js htdocs/javascript/jquery.autocomplete.js htdocs/javascript/jquery.color.js
119 htdocs/javascript/jquery.js:
120 wget http://jquery.com/src/jquery-latest.pack.js -O $@ -q || ($(RM) $@; exit 1)
121
122 htdocs/javascript/jquery.color.js:
123 wget http://plugins.jquery.com/files/jquery.color.js.txt -O $@ -q || ($(RM) $@; exit 1)
124
125 ################################################################################
126
127 .PHONY: build dist clean wiki build-wiki banana htdocs/images/banana htdocs/css/banana.css include/banana/banana.inc.php
128