2016-11-30 19:00:03 +00:00
|
|
|
app_name=gpxedit
|
|
|
|
app_version=$(version)
|
|
|
|
project_dir=$(CURDIR)/../$(app_name)
|
|
|
|
build_dir=/tmp/build
|
|
|
|
sign_dir=/tmp/sign
|
|
|
|
cert_dir=$(HOME)/.nextcloud/certificates
|
2017-03-18 05:09:10 +00:00
|
|
|
webserveruser ?= www-data
|
|
|
|
occ_dir ?= /var/www/html/nextcloud
|
2016-11-30 19:00:03 +00:00
|
|
|
|
|
|
|
all: appstore
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(build_dir)
|
|
|
|
rm -rf $(sign_dir)
|
|
|
|
|
|
|
|
appstore: clean
|
|
|
|
mkdir -p $(sign_dir)
|
|
|
|
mkdir -p $(build_dir)
|
|
|
|
rsync -a \
|
|
|
|
--exclude=.git \
|
2017-03-18 05:09:10 +00:00
|
|
|
--exclude=appinfo/signature.json \
|
2016-11-30 19:00:03 +00:00
|
|
|
--exclude=*.swp \
|
|
|
|
--exclude=build \
|
|
|
|
--exclude=.gitignore \
|
|
|
|
--exclude=.travis.yml \
|
|
|
|
--exclude=.scrutinizer.yml \
|
|
|
|
--exclude=CONTRIBUTING.md \
|
|
|
|
--exclude=composer.json \
|
|
|
|
--exclude=composer.lock \
|
|
|
|
--exclude=composer.phar \
|
|
|
|
--exclude=l10n/.tx \
|
|
|
|
--exclude=l10n/no-php \
|
|
|
|
--exclude=makefile \
|
|
|
|
--exclude=screenshots \
|
|
|
|
--exclude=phpunit*xml \
|
|
|
|
--exclude=tests \
|
|
|
|
--exclude=vendor/bin \
|
|
|
|
$(project_dir) $(sign_dir)
|
2017-03-18 05:09:10 +00:00
|
|
|
# give the webserver user the right to create signature file
|
|
|
|
sudo chown $(webserveruser) $(sign_dir)/$(app_name)/appinfo
|
|
|
|
sudo -u $(webserveruser) php $(occ_dir)/occ integrity:sign-app --privateKey=$(cert_dir)/$(app_name).key --certificate=$(cert_dir)/$(app_name).crt --path=$(sign_dir)/$(app_name)/
|
|
|
|
sudo chown -R $(USER) $(sign_dir)/$(app_name)/appinfo
|
2016-11-30 19:00:03 +00:00
|
|
|
tar -czf $(build_dir)/$(app_name)-$(app_version).tar.gz \
|
|
|
|
-C $(sign_dir) $(app_name)
|
|
|
|
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(app_version).tar.gz | openssl base64
|