forked from dotclear/dotclear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
120 lines (95 loc) · 3.71 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
.PHONY: config-stamp
SHELL=/bin/sh
DIST=_dist
DC=$(DIST)/dotclear
default:
@echo "make config or make dist"
config: clean config-stamp
mkdir -p ./$(DC)
## Copy needed folders and files
cp -pRf ./admin ./inc ./src ./index.php ./CHANGELOG ./CREDITS ./LICENSE ./README.md ./CONTRIBUTING.md ./$(DC)/
## Locales directory
mkdir -p ./$(DC)/locales
cp -pRf ./locales/README ./locales/en ./locales/fr ./$(DC)/locales/
## Create cache, var, db, plugins, themes and public folders
mkdir ./$(DC)/cache ./$(DC)/var ./$(DC)/db ./$(DC)/plugins ./$(DC)/themes ./$(DC)/public
cp -p inc/.htaccess ./$(DC)/cache/
cp -p inc/.htaccess ./$(DC)/var/
cp -p inc/.htaccess ./$(DC)/db/
cp -p inc/.htaccess ./$(DC)/plugins/
## Remove config file if any
rm -f ./$(DC)/inc/config.php
## Copy built-in themes (same list that DC_DISTRIB_THEMES constant in inc/prepend.php)
cp -pRf \
./themes/berlin \
./themes/blowup \
./themes/blueSilence \
./themes/customCSS \
./themes/ductile \
./$(DC)/themes/
## Copy built-in plugins (same list that DC_DISTRIB_PLUGINS constant in inc/prepend.php)
cp -pRf \
./plugins/aboutConfig \
./plugins/akismet \
./plugins/antispam \
./plugins/attachments \
./plugins/blogroll \
./plugins/breadcrumb \
./plugins/dcCKEditor \
./plugins/dcLegacyEditor \
./plugins/dcProxyV1 \
./plugins/dcProxyV2 \
./plugins/fairTrackbacks \
./plugins/importExport \
./plugins/maintenance \
./plugins/pages \
./plugins/pings \
./plugins/simpleMenu \
./plugins/tags \
./plugins/themeEditor \
./plugins/userPref \
./plugins/widgets \
./$(DC)/plugins/
## "Compile" .po files
./build-tools/make-l10n.php ./$(DC)/
## Pack javascript files
find $(DC)/admin/js/*.js ! -name '*.min.js' -exec ./build-tools/min-js.php \{\} \;
find $(DC)/admin/js/codemirror ! -name '*.min.js' -name '*.js' -exec ./build-tools/min-js.php \{\} \;
find $(DC)/admin/js/jquery/*.js ! -name '*.min.js' ! -name 'jquery.js' -exec ./build-tools/min-js.php \{\} \;
find $(DC)/admin/js/jsUpload/*.js ! -name '*.min.js' -exec ./build-tools/min-js.php \{\} \;
find $(DC)/plugins -name '*.js' ! -name '*.min.js' ! -name 'jquery.js' -exec ./build-tools/min-js.php \{\} \;
find $(DC)/themes -name '*.js' ! -name '*.min.js' ! -name 'jquery.js' -exec ./build-tools/min-js.php \{\} \;
find $(DC)/inc/js -name '*.js' ! -name '*.min.js' ! -name 'jquery.js' -exec ./build-tools/min-js.php \{\} \;
## Debug off
perl -pi -e "s|^//\*== DC_DEBUG|/*== DC_DEBUG|sgi;" $(DC)/inc/prepend.php $(DC)/inc/prepend.php
## Remove scm files and folders from DC and CB
find ./$(DIST)/ -type d -name '.git' | xargs -r rm -rf
find ./$(DIST)/ -type f -name '.*ignore' | xargs -r rm -rf
find ./$(DIST)/ -type f -name '.flow' | xargs -r rm -rf
## Create digest
cd $(DC) && ( \
md5sum `find . -type f -not -path "./inc/digest" -not -path "./cache/*" -not -path "./var/*" -not -path "./db/*" -not -path ./CHANGELOG` \
> inc/digests \
)
touch config-stamp
dist: config dist-tgz dist-zip dist-l10n
dist-tgz:
[ -f config-stamp ]
cd $(DIST) && tar cfz dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).tar.gz ./dotclear
dist-zip:
[ -f config-stamp ]
cd $(DIST) && zip -r9 dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).zip ./dotclear
dist-l10n:
[ -f config-stamp ]
rm -rf ./$(DIST)/l10n
mkdir -p ./$(DIST)/l10n
find ./locales/ -maxdepth 1 -mindepth 1 -type d -not -name '.svn' -not -name '_pot' -not -name 'en' \
-exec cp -pRf \{\} ./$(DIST)/l10n/ \;
find ./$(DIST)/l10n -type d -name '.svn' | xargs rm -rf
./build-tools/make-l10n.php ./$(DIST)/l10n/
cd ./$(DIST)/l10n && for i in *; do \
zip -r9 "$$i-$$(grep DC_VERSION ../dotclear/inc/prepend.php | cut -d"'" -f4).zip" "$$i"; \
rm -rf "$$i"; \
done
clean:
rm -rf $(DIST) config-stamp