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
|
2017-05-16 15:36:22 +00:00
|
|
|
build_dir_own=/tmp/build_own
|
|
|
|
sign_dir_own=/tmp/sign_own
|
2016-11-30 19:00:03 +00:00
|
|
|
cert_dir=$(HOME)/.nextcloud/certificates
|
2017-05-16 15:36:22 +00:00
|
|
|
cert_dir_own=$(HOME)/.owncloud/certificates
|
2017-03-18 05:09:10 +00:00
|
|
|
webserveruser ?= www-data
|
|
|
|
occ_dir ?= /var/www/html/nextcloud
|
2017-05-16 15:36:22 +00:00
|
|
|
occ_dir_own ?= /var/www/html/owncloud
|
2016-11-30 19:00:03 +00:00
|
|
|
|
|
|
|
all: appstore
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(build_dir)
|
2017-05-16 15:36:22 +00:00
|
|
|
rm -rf $(build_dir_own)
|
2016-11-30 19:00:03 +00:00
|
|
|
rm -rf $(sign_dir)
|
2017-05-16 15:36:22 +00:00
|
|
|
rm -rf $(sign_dir_own)
|
2016-11-30 19:00:03 +00:00
|
|
|
|
|
|
|
appstore: clean
|
|
|
|
mkdir -p $(sign_dir)
|
2017-05-16 15:36:22 +00:00
|
|
|
mkdir -p $(sign_dir)_own
|
2016-11-30 19:00:03 +00:00
|
|
|
mkdir -p $(build_dir)
|
2017-05-16 15:36:22 +00:00
|
|
|
mkdir -p $(build_dir)_own
|
2016-11-30 19:00:03 +00:00
|
|
|
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 \
|
2017-05-16 15:36:22 +00:00
|
|
|
--exclude=README.md \
|
2016-11-30 19:00:03 +00:00
|
|
|
--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-05-16 15:36:22 +00:00
|
|
|
cp -r $(sign_dir)/$(app_name) $(sign_dir_own)/
|
|
|
|
# adapt info.xml
|
|
|
|
sed -i '/[^<][oO]wncloud[^>]/d' $(sign_dir)/$(app_name)/appinfo/info.xml
|
|
|
|
sed -i '/[nN]extcloud/d' $(sign_dir_own)/$(app_name)/appinfo/info.xml
|
2017-03-18 05:09:10 +00:00
|
|
|
# give the webserver user the right to create signature file
|
2017-05-16 15:36:22 +00:00
|
|
|
sudo chown $(webserveruser) $(sign_dir)/$(app_name)/appinfo $(sign_dir_own)/$(app_name)/appinfo
|
2017-03-18 05:09:10 +00:00
|
|
|
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)/
|
2017-05-16 15:36:22 +00:00
|
|
|
sudo -u $(webserveruser) php $(occ_dir_own)/occ integrity:sign-app --privateKey=$(cert_dir_own)/$(app_name).key --certificate=$(cert_dir_own)/$(app_name).crt --path=$(sign_dir_own)/$(app_name)/
|
|
|
|
sudo chown -R $(USER) $(sign_dir)/$(app_name)/appinfo $(sign_dir_own)/$(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)
|
2017-05-16 15:36:22 +00:00
|
|
|
tar -czf $(build_dir_own)/$(app_name)-$(app_version).tar.gz \
|
|
|
|
-C $(sign_dir_own) $(app_name)
|
|
|
|
echo NEXTCLOUD------------------------------------------
|
2016-11-30 19:00:03 +00:00
|
|
|
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(app_version).tar.gz | openssl base64
|
2017-05-16 15:36:22 +00:00
|
|
|
echo OWNCLOUD-------------------------------------------
|
|
|
|
openssl dgst -sha512 -sign $(cert_dir_own)/$(app_name).key $(build_dir_own)/$(app_name)-$(app_version).tar.gz | openssl base64
|