forked from typecho/typecho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
100 lines (79 loc) · 2.56 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
#define root directory
DIR=../
#update subversion
update:
@echo 'git update'
rm -Rf build/
git clone https://github.com/typecho/typecho.git build
rm -Rf build/.git
rm -f build/.gitignore
rm -f build/.gitattributes
for i in `find build/ -name '*.css'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
for i in `find build/admin/js/ -name '*.js'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done;
for i in `find build/ -name '*.php'`; do php -l $$i; done;
package:
@echo 'package'
rm -Rf build/tools/
rm -f build/todo.txt
rm -f build/changelog.txt
rm -f build/.travis.yml
rm -f build/README.md
rm -Rf build/admin/scss
rm -Rf build/admin/img/editor
rm -Rf build/admin/img/icons
rm -Rf build/admin/img/icons-2x
rm -Rf build/usr/langs/*
mkdir build/usr/uploads/
chmod 777 build/usr/uploads/
tar -cvvzf build.tar.gz build/
clear:
rm -Rf build/
upgrade:
make update
rm -Rf ${DIR}/admin/
cp -Rf build/admin/ ${DIR}
rm -Rf ${DIR}/var/
cp -Rf build/var/ ${DIR}
rm -Rf ${DIR}/index.php
cp build/index.php ${DIR}
make clear
langs:
rm -rf ../usr/langs
mkdir ../usr/langs
git clone https://github.com/typecho/languages.git
#for i in `find . -name '*.po'`; do echo $$i && php msgfmt.php $$i; done;
cd languages/ && for i in `find . -name '*.po'`; do echo `basename $$i` && msgfmt -o `basename $$i .po`.mo `basename $$i`; done;
cp languages/*.mo ../usr/langs/
rm -rf languages
theme:
make update
rm -Rf ${DIR}/usr/themes/default/
cp -Rf build/usr/themes/default/ ${DIR}/usr/themes/
make clear
install:
make update
rm -Rf build/tools/
rm -f build/todo.txt
rm -f build/changelog.txt
rm -f build/.travis.yml
rm -f build/README.md
rm -Rf build/admin/scss
rm -Rf build/admin/img/editor
rm -Rf build/admin/img/icons
rm -Rf build/admin/img/icons-2x
mkdir build/usr/uploads/
chmod 777 build/usr/uploads/
cp -Rf build/* ${DIR}
make clear
pot:
cd ../ && php tools/list.php ./ > tools/files.txt
cd ../ && xgettext --files-from=tools/files.txt -Lphp --from-code=UTF-8 --keyword=_t --keyword=_e --keyword=_n:1,2 --no-location --copyright-holder=Typecho --package-name=Typecho --package-version=`grep -E "VERSION = '(.*)'" ./var/Typecho/Common.php | cut -d "'" -f 2` --no-wrap --output=tools/messages.pot
rm -f files.txt
test:
for i in `find ../var/ -name '*.php'`; do php -l $$i || exit 1; done;
for i in `find ../usr/ -name '*.php'`; do php -l $$i || exit 1; done;
for i in `find ../admin/ -name '*.php'`; do php -l $$i || exit 1; done;
all:
make update
make package
make clear