-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMakefile
162 lines (127 loc) · 3.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Makefile for SIREMIS
# make variables
NAME ?= siremis
URLBASE ?= $(NAME)
BASEDIR ?= `pwd`
SIREMISDIR=$(BASEDIR)/$(NAME)
VERSION=5.3.0
owner ?= www-data:www-data
# tools
TAR ?= tar
# cooltext (dn:com/st:glowingsteel/fg:brandname/fn:hopt)
all: prepare
prepare-htaccess:
@echo "updating htaccess file for apache 2.2 ..."
@sed -e "s#/%%URLBASE%%/#/$(URLBASE)/#g" \
< ./misc/templates/htaccess > ./siremis/.htaccess
prepare-htaccess24:
@echo "updating htaccess file for apache 2.4 ..."
@sed -e "s#/%%URLBASE%%/#/$(URLBASE)/#g" \
< ./misc/templates/htaccess24 > ./siremis/.htaccess
@echo "deploying htaccess files for apache 2.4 in subdirs ..."
@cp ./misc/templates/htaccess24-deny ./siremis/log/.htaccess
@cp ./misc/templates/htaccess24-deny ./openbiz/metadata/.htaccess
@cp ./misc/templates/htaccess24-deny ./openbiz/languages/.htaccess
prepare-common:
@echo "updating app.inc file..."
@sed -e "s#/%%URLBASE%%#/$(URLBASE)#g" \
< ./misc/templates/app.inc > ./siremis/bin/app.inc
@echo "creating folders..."
@mkdir -p siremis/files/cache
@mkdir -p siremis/files/cache/data
@mkdir -p siremis/files/cache/metadata
@mkdir -p siremis/themes/default/template/cpl
@echo "done"
# prepare SIREMIS dirs for web install with apache 2.2
prepare: prepare-htaccess prepare-common
# prepare SIREMIS dirs for web install with apache 2.4
prepare24: prepare-htaccess24 prepare-common
apache-conf:
@echo "# siremis apache 2.2 conf snippet ..."
@echo
@sed -e "s#%%URLBASE%%#$(URLBASE)#g" \
-e "s#%%SIREMISDIR%%#$(SIREMISDIR)#g" \
< ./misc/templates/apache2.conf
apache24-conf:
@echo "# siremis apache 2.4 conf snippet ..."
@echo
@sed -e "s#%%URLBASE%%#$(URLBASE)#g" \
-e "s#%%SIREMISDIR%%#$(SIREMISDIR)#g" \
< ./misc/templates/apache24.conf
clean: cleancache
distclean: cleancache cleansessions
cleancache:
@echo "cleaning caching files..."
rm -f siremis/themes/default/template/cpl/*.php
rm -f siremis/log/*.log
rm -f siremis/files/cache/metadata/*.cmp
rm -rf `find ./siremis/files/cache/data/* -maxdepth 0 -type d`
cleansessions:
@echo "cleaning session files..."
rm -f siremis/session/sess_*
cleansvn:
@echo "removing .svn directories..."
rm -rf `find . -type d -name .svn`
cleansiremis:
@echo "removing temporary files..."
rm -f siremis/*.txt
rm -f siremis/*.lock
cleanbin:
@echo "removing unsafe files..."
rm -rf siremis/bin/cronjob
rm -rf siremis/bin/filebrowser
rm -rf siremis/bin/phing
rm -rf siremis/bin/tools
rm -rf siremis/bin/toolsx
rm -f siremis/bin/empty.php
rm -f siremis/bin/install_mod.php
rm -f siremis/bin/metaedit.php
cleanweb: cleansvn cleansiremis cleanbin
cleanwiz:
@echo "removing web installation wizard files..."
rm -rf siremis/install
toolsx:
@echo "preparing toolsx meta bin directory..."
rm -rf siremis/bin/toolsx
cp -a misc/bin/toolsx siremis/bin/
cleantoolsx:
@echo "removing toolsx meta bin directory..."
rm -rf siremis/bin/toolsx
resetchmod:
@echo "reseting file permisions..."
find . ! -type d -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
locks:
@echo "preparing install lock..."
touch siremis/install.lock
cleanlocks:
@echo "removing install lock..."
rm -rf siremis/install.lock
.PHONY: chown
chown:
@echo "changing onwner to $(owner) ..."
chown -R $(owner) .
cleantopkg: distclean cleansvn cleansiremis cleanbin cleantoolsx
.PHONY: tar
tar:
rm -rf tmp
mkdir -p tmp/$(NAME)-$(VERSION)
$(TAR) --exclude=tmp/* --exclude=tmp -cf - . \
| $(TAR) -x --directory=tmp/$(NAME)-$(VERSION)
make -C tmp/$(NAME)-$(VERSION) cleantopkg
$(TAR) -C tmp/ \
--exclude=.git* \
--exclude=.svn* \
--exclude=.cvs* \
--exclude=CVS* \
--exclude=*.gz \
--exclude=*.tgz \
--exclude=*.bz2 \
--exclude=*.tar \
--exclude=*.patch \
--exclude=.\#* \
--exclude=*.swp \
--exclude=*.swo \
-czvf "$(NAME)-$(VERSION).tgz" "$(NAME)-$(VERSION)"
mv "$(NAME)-$(VERSION).tgz" ../
rm -rf tmp