Dotclear

source: Makefile @ 2931:eed943c66a5f

Revision 2931:eed943c66a5f, 3.7 KB checked in by Nicolas <nikrou77@…>, 11 years ago (diff)

Start adding behat tests

Line 
1.PHONY: config-stamp
2
3SHELL=/bin/sh
4DIST=_dist
5DC=$(DIST)/dotclear
6
7default:
8     @echo "make config or make dist"
9
10config: clean config-stamp
11     mkdir -p ./$(DC)
12
13     ## Copy needed folders and files
14     cp -pRf ./admin ./inc ./index.php ./CHANGELOG ./CREDITS ./LICENSE ./README.md ./CONTRIBUTING.md ./$(DC)/
15
16     ## Locales directory
17     mkdir -p ./$(DC)/locales
18     cp -pRf ./locales/README ./locales/en ./locales/fr ./$(DC)/locales/
19
20     ## Remove tests directories and test stuff
21     rm -fr ./$(DC)/inc/libs/clearbricks/tests ./$(DC)/inc/libs/clearbricks/composer.*    \
22            ./$(DC)/inc/libs/clearbricks/.atoum.* ./$(DC)/inc/libs/clearbricks/vendor     \
23            ./$(DC)/inc/libs/clearbricks/bin ./$(DC)/inc/libs/clearbricks/_dist      \
24            ./$(DC)/features ./$(DC)/travis ./$(DC)/behat.yml.dist ./$(DC)/composer.*
25
26     ## Create cache, db, plugins and public folders
27     mkdir ./$(DC)/cache ./$(DC)/db ./$(DC)/plugins ./$(DC)/public ./$(DC)/themes
28     cp -p inc/.htaccess ./$(DC)/cache/
29     cp -p inc/.htaccess ./$(DC)/db/
30     cp -p inc/.htaccess ./$(DC)/plugins/
31
32     ## Remove config file if any
33     rm -f ./$(DC)/inc/config.php
34
35     ## Copy built-in themes
36     cp -pRf \
37     ./themes/default \
38     ./themes/blueSilence \
39     ./themes/customCSS \
40     ./themes/ductile \
41     ./themes/berlin \
42     ./$(DC)/themes/
43
44     ## Copy built-in plugins based on DC_DISTRIB_PLUGINS constant
45     cp -pRf $$(grep DC_DISTRIB_PLUGINS inc/prepend.php | \
46          sed -e "s/.*,'//" -e "s/'.*//" | \
47          sed -e  's/\(^\|,\)/ .\/plugins\//g') \
48     ./$(DC)/plugins/
49
50     ## "Compile" .po files
51     ./build-tools/make-l10n.php ./$(DC)/
52
53     ## Pack javascript files
54     find $(DC)/admin/js/*.js -exec ./build-tools/min-js.php \{\} \;
55     find $(DC)/admin/js/ie7/*.js -exec ./build-tools/min-js.php \{\} \;
56     find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \;
57     find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \;
58     find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \;
59     find $(DC)/themes/default/js/*.js -exec ./build-tools/min-js.php \{\} \;
60     find $(DC)/inc/js -name '*.js' -exec ./build-tools/min-js.php \{\} \;
61
62     ## Debug off
63     perl -pi -e "s|^//\*== DC_DEBUG|/*== DC_DEBUG|sgi;" $(DC)/inc/prepend.php $(DC)/inc/prepend.php
64
65     ## Remove scm files and folders from DC and CB
66     find ./$(DIST)/ -type d -name '.svn' | xargs -r rm -rf
67     find ./$(DIST)/ -type d -name '.hg'  | xargs -r rm -rf
68     find ./$(DIST)/ -type d -name '.git' | xargs -r rm -rf
69     find ./$(DIST)/ -type f -name '.*ignore' | xargs -r rm -rf
70     find ./$(DIST)/ -type f -name '.flow' | xargs -r rm -rf
71
72     ## Create digest
73     cd $(DC) && ( \
74          md5sum `find . -type f -not -path "./inc/digest" -not -path "./cache/*" -not -path "./db/*" -not -path ./CHANGELOG` \
75          > inc/digests \
76     )
77
78     touch config-stamp
79
80dist: config dist-tgz dist-zip dist-l10n
81
82deb:
83     cp ./README.md debian/README
84     dpkg-buildpackage -rfakeroot
85
86dist-tgz:
87     [ -f config-stamp ]
88     cd $(DIST) && tar cfz dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).tar.gz ./dotclear
89
90dist-zip:
91     [ -f config-stamp ]
92     cd $(DIST) && zip -r9 dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).zip ./dotclear
93
94dist-l10n:
95     [ -f config-stamp ]
96
97     rm -rf ./$(DIST)/l10n
98     mkdir -p ./$(DIST)/l10n
99
100     find ./locales/ -maxdepth 1 -mindepth 1 -type d -not -name '.svn' -not -name '_pot' -not -name 'en' \
101     -exec cp -pRf \{\} ./$(DIST)/l10n/ \;
102
103     find ./$(DIST)/l10n -type d -name '.svn' | xargs rm -rf
104     ./build-tools/make-l10n.php ./$(DIST)/l10n/
105
106     cd ./$(DIST)/l10n && for i in *; do \
107          zip -r9 "$$i-$$(grep DC_VERSION ../dotclear/inc/prepend.php | cut -d"'" -f4).zip" "$$i"; \
108          rm -rf "$$i"; \
109     done
110
111
112clean:
113     rm -rf $(DIST) config-stamp
114
115
116## Modules (Themes and Plugins) ###############################################
117pack-tool:
118     [ "$(ipath)" != '' ]
119     [ "$(iname)" != '' ]
120     [ "$(iname)" != '' ]
121     [ -d $(ipath)/$(iname) ]
122
123
124copy-plugins: clean
Note: See TracBrowser for help on using the repository browser.

Sites map