Dotclear

source: Makefile @ 3305:a528708b0655

Revision 3305:a528708b0655, 3.9 KB checked in by franck <carnet.franck.paul@…>, 9 years ago (diff)

Pack codemirror js library as the other are

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

Sites map