[2558] | 1 | .PHONY: config-stamp |
---|
| 2 | |
---|
[0] | 3 | SHELL=/bin/sh |
---|
| 4 | DIST=_dist |
---|
| 5 | DC=$(DIST)/dotclear |
---|
| 6 | |
---|
| 7 | default: |
---|
| 8 | @echo "make config or make dist" |
---|
| 9 | |
---|
[2558] | 10 | config: 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 |
---|
| 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 | |
---|
[0] | 25 | ## Create cache, db, plugins and public folders |
---|
[2558] | 26 | mkdir ./$(DC)/cache ./$(DC)/db ./$(DC)/plugins ./$(DC)/public ./$(DC)/themes |
---|
| 27 | cp -p inc/.htaccess ./$(DC)/cache/ |
---|
| 28 | cp -p inc/.htaccess ./$(DC)/db/ |
---|
| 29 | cp -p inc/.htaccess ./$(DC)/plugins/ |
---|
[2537] | 30 | |
---|
[0] | 31 | ## Remove config file if any |
---|
| 32 | rm -f ./$(DC)/inc/config.php |
---|
[2537] | 33 | |
---|
[2558] | 34 | ## Copy built-in themes |
---|
| 35 | cp -pRf \ |
---|
| 36 | ./themes/default \ |
---|
| 37 | ./themes/blueSilence \ |
---|
| 38 | ./themes/customCSS \ |
---|
| 39 | ./themes/ductile \ |
---|
| 40 | ./$(DC)/themes/ |
---|
| 41 | |
---|
[0] | 42 | ## Copy built-in plugins |
---|
| 43 | cp -pRf \ |
---|
| 44 | ./plugins/aboutConfig \ |
---|
| 45 | ./plugins/akismet \ |
---|
| 46 | ./plugins/antispam \ |
---|
[415] | 47 | ./plugins/attachments \ |
---|
[0] | 48 | ./plugins/blogroll \ |
---|
| 49 | ./plugins/blowupConfig \ |
---|
[2283] | 50 | ./plugins/dclegacy \ |
---|
[0] | 51 | ./plugins/fairTrackbacks \ |
---|
| 52 | ./plugins/importExport \ |
---|
| 53 | ./plugins/maintenance \ |
---|
| 54 | ./plugins/tags \ |
---|
| 55 | ./plugins/pages \ |
---|
| 56 | ./plugins/pings \ |
---|
[682] | 57 | ./plugins/simpleMenu \ |
---|
[0] | 58 | ./plugins/themeEditor \ |
---|
[285] | 59 | ./plugins/userPref \ |
---|
[0] | 60 | ./plugins/widgets \ |
---|
| 61 | ./$(DC)/plugins/ |
---|
[2537] | 62 | |
---|
[0] | 63 | ## "Compile" .po files |
---|
| 64 | ./build-tools/make-l10n.php ./$(DC)/ |
---|
[2537] | 65 | |
---|
[0] | 66 | ## Pack javascript files |
---|
| 67 | find $(DC)/admin/js/*.js -exec ./build-tools/min-js.php \{\} \; |
---|
[707] | 68 | find $(DC)/admin/js/ie7/*.js -exec ./build-tools/min-js.php \{\} \; |
---|
[0] | 69 | find $(DC)/admin/js/jquery/*.js -exec ./build-tools/min-js.php \{\} \; |
---|
| 70 | find $(DC)/admin/js/jsToolBar/*.js -exec ./build-tools/min-js.php \{\} \; |
---|
[1451] | 71 | find $(DC)/admin/js/jsUpload/*.js -exec ./build-tools/min-js.php \{\} \; |
---|
[0] | 72 | find $(DC)/plugins -name '*.js' -exec ./build-tools/min-js.php \{\} \; |
---|
| 73 | find $(DC)/themes/default/js/*.js -exec ./build-tools/min-js.php \{\} \; |
---|
[2537] | 74 | |
---|
[0] | 75 | ## Debug off |
---|
| 76 | perl -pi -e "s|^//\*== DC_DEBUG|/*== DC_DEBUG|sgi;" $(DC)/inc/prepend.php $(DC)/inc/prepend.php |
---|
[2537] | 77 | |
---|
[2558] | 78 | ## Remove scm files and folders from DC and CB |
---|
| 79 | find ./$(DIST)/ -type d -name '.svn' | xargs -r rm -rf |
---|
| 80 | find ./$(DIST)/ -type d -name '.hg' | xargs -r rm -rf |
---|
| 81 | find ./$(DIST)/ -type d -name '.git' | xargs -r rm -rf |
---|
| 82 | find ./$(DIST)/ -type f -name '.*ignore' | xargs -r rm -rf |
---|
| 83 | |
---|
[0] | 84 | ## Create digest |
---|
| 85 | cd $(DC) && ( \ |
---|
| 86 | md5sum `find . -type f -not -path "./inc/digest" -not -path "./cache/*" -not -path "./db/*" -not -path ./CHANGELOG` \ |
---|
| 87 | > inc/digests \ |
---|
| 88 | ) |
---|
[2537] | 89 | |
---|
[0] | 90 | touch config-stamp |
---|
| 91 | |
---|
| 92 | dist: config dist-tgz dist-zip dist-l10n |
---|
| 93 | |
---|
| 94 | deb: |
---|
[1581] | 95 | cp ./README.md debian/README |
---|
[0] | 96 | dpkg-buildpackage -rfakeroot |
---|
| 97 | |
---|
| 98 | dist-tgz: |
---|
| 99 | [ -f config-stamp ] |
---|
| 100 | cd $(DIST) && tar cfz dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).tar.gz ./dotclear |
---|
| 101 | |
---|
| 102 | dist-zip: |
---|
| 103 | [ -f config-stamp ] |
---|
| 104 | cd $(DIST) && zip -r9 dotclear-$$(grep DC_VERSION dotclear/inc/prepend.php | cut -d"'" -f4).zip ./dotclear |
---|
| 105 | |
---|
| 106 | dist-l10n: |
---|
| 107 | [ -f config-stamp ] |
---|
[2537] | 108 | |
---|
[0] | 109 | rm -rf ./$(DIST)/l10n |
---|
| 110 | mkdir -p ./$(DIST)/l10n |
---|
[2537] | 111 | |
---|
[0] | 112 | find ./locales/ -maxdepth 1 -mindepth 1 -type d -not -name '.svn' -not -name '_pot' -not -name 'en' \ |
---|
| 113 | -exec cp -pRf \{\} ./$(DIST)/l10n/ \; |
---|
[2537] | 114 | |
---|
[0] | 115 | find ./$(DIST)/l10n -type d -name '.svn' | xargs rm -rf |
---|
| 116 | ./build-tools/make-l10n.php ./$(DIST)/l10n/ |
---|
[2537] | 117 | |
---|
[0] | 118 | cd ./$(DIST)/l10n && for i in *; do \ |
---|
| 119 | zip -r9 "$$i-$$(grep DC_VERSION ../dotclear/inc/prepend.php | cut -d"'" -f4).zip" "$$i"; \ |
---|
| 120 | rm -rf "$$i"; \ |
---|
| 121 | done |
---|
[2537] | 122 | |
---|
[0] | 123 | |
---|
| 124 | clean: |
---|
[2558] | 125 | rm -rf $(DIST) config-stamp |
---|
[0] | 126 | |
---|
| 127 | |
---|
| 128 | ## Modules (Themes and Plugins) ############################################### |
---|
| 129 | pack-tool: |
---|
| 130 | [ "$(ipath)" != '' ] |
---|
| 131 | [ "$(iname)" != '' ] |
---|
| 132 | [ "$(iname)" != '' ] |
---|
| 133 | [ -d $(ipath)/$(iname) ] |
---|
[2537] | 134 | |
---|
| 135 | |
---|