forked from 3liz/lizmap-web-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (23 loc) · 1.04 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
#
STAGE=build
DIST=$(STAGE)/lizmap-web-client
FILES=lib lizmap INSTALL.md icon.png license.txt README.md UPGRADE.md CONTRIBUTING.md
VERSION=$(shell sed -n 's:.*<version[^>]*>\(.*\)</version>.*:\1:p' lizmap/project.xml)
FORBIDDEN_CONFIG_FILES := installer.ini.php liveconfig.ini.php lizmapConfig.ini.php localconfig.ini.php profiles.ini.php
EMPTY_DIRS := var/db var/log var/mails var/uploads var/sessions
PACKAGE_NAME=lizmap-web-client-$(VERSION)
.PHONY: package clean stage
package: clean stage
cd $(STAGE) && zip -r $(PACKAGE_NAME).zip lizmap-web-client/
clean:
rm -rf $(STAGE)
stage:
mkdir -p $(DIST)
cp -aR $(FILES) $(DIST)/
mkdir -p $(DIST)/temp/lizmap/
cp -a temp/.htaccess $(DIST)/temp/
cp -a temp/lizmap/.empty $(DIST)/temp/lizmap/
rm -rf $(DIST)/lizmap/vendor
@for file in $(FORBIDDEN_CONFIG_FILES); do rm -f $(DIST)/lizmap/var/config/$$file; done;
@for dir in $(EMPTY_DIRS); do rm -rf $(DIST)/lizmap/$$dir/*; touch $(DIST)/lizmap/$$dir/.empty; done;
rm -rf $(DIST)/lizmap/www/cache/images/* && touch $(DIST)/lizmap/www/cache/images/.empty