forked from smallsong/chanzhieps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·60 lines (57 loc) · 2.35 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
VERSION=$(shell head -n 1 VERSION)
all: zip
trunk:
git archive --format=zip --output=code.zip master
rm -rf /tmp/chanzhirelease
mkdir /tmp/chanzhirelease
mv code.zip /tmp/chanzhirelease
cd /tmp/chanzhirelease; unzip code.zip; rm code.zip; make zip
clean:
rm -fr chanzhieps
rm -fr *.zip
zip:
mkdir chanzhieps
cp -frv system chanzhieps/
rm -fr chanzhieps/system/config/my.php
cp -frv www chanzhieps && rm -fr chanzhieps/www/data/* && mkdir -p chanzhieps/www/data/upload/
mkdir -p chanzhieps/www/data/css/default/default
mkdir -p chanzhieps/www/data/css/default/tartan
mkdir -p chanzhieps/www/data/css/default/wide
mkdir -p chanzhieps/www/data/slides
mkdir -p chanzhieps/www/data/source
touch chanzhieps/www/robots.txt && rm chanzhieps/www/robots.txt && touch chanzhieps/www/robots.txt && chmod 777 chanzhieps/www/robots.txt
rm -frv chanzhieps/system/tmp
mkdir -p chanzhieps/system/module/package/ext/
mkdir -p chanzhieps/system/module/ui/theme/
mkdir -p chanzhieps/system/tmp/cache/
mkdir -p chanzhieps/system/tmp/log/
mkdir -p chanzhieps/system/tmp/model/
mkdir -p chanzhieps/system/tmp/package/
mkdir -p chanzhieps/system/tmp/theme/
# combine js and css files.
mkdir -pv chanzhieps/system/build/ && cp system/build/minifyfront.php chanzhieps/system/build/
cd chanzhieps/system/build/ && php ./minifyfront.php && php ./createcustomercss.php
rm -frv chanzhieps/system/build
# delete the unused files.
find chanzhieps -name '.git*' |xargs rm -frv
find chanzhieps -name '.svn*' |xargs rm -frv
find chanzhieps -name tests |xargs rm -frv
# create index.html of each folder.
for path in `find chanzhieps/ -type d`; do touch "$$path/index.html"; done
rm chanzhieps/www/index.html
# add header code to every php file.
sed -i '1i\<?php if(!defined("RUN_MODE")) die();?>' `find chanzhieps/www/template/ -name '*.php'`
sed -i '1i\<?php if(!defined("RUN_MODE")) die();?>' `find chanzhieps/system/module/ -name '*.php'`
# change mode.
chmod 777 -R chanzhieps/system/tmp/
chmod 777 -R chanzhieps/www/data
chmod 777 -R chanzhieps/www/template
chmod 777 -R chanzhieps/system/config
chmod 777 chanzhieps/system/module
chmod 777 chanzhieps/system/module/package/ext
chmod 777 chanzhieps/system/module/ui/theme
chmod a+rx chanzhieps/system/bin/*
#find chanzhieps/ -name ext |xargs chmod 777 -R
# zip it.
zip -r -9 chanzhiEPS.$(VERSION).zip chanzhieps
rm -fr chanzhieps