nc-gpxedit/makefile

72 lines
2.6 KiB
Makefile
Raw Normal View History

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
2017-06-27 12:14:55 +00:00
occ_dir ?= /var/www/html/n12
2018-02-10 15:15:37 +00:00
occ_dir_own ?= /var/www/html/n12
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 \
2017-11-28 10:40:39 +00:00
--exclude=CONTRIBUTING.md \
2016-11-30 19:00:03 +00:00
--exclude=composer.json \
--exclude=composer.lock \
--exclude=composer.phar \
2017-11-28 10:40:39 +00:00
--exclude=crowdin.yml \
--exclude=tools \
2016-11-30 19:00:03 +00:00
--exclude=l10n/.tx \
2017-11-28 10:40:39 +00:00
--exclude=l10n/l10n.pl \
--exclude=l10n/templates \
--exclude=l10n/*.sh \
--exclude=l10n/[a-z][a-z] \
--exclude=l10n/[a-z][a-z]_[A-Z][A-Z] \
2016-11-30 19:00:03 +00:00
--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
2017-06-05 15:58:24 +00:00
sed -i '/[^<][oO]wn[cC]loud[^>]/d' $(sign_dir)/$(app_name)/appinfo/info.xml
2017-05-16 15:36:22 +00:00
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