update makefile

merge-requests/12/merge
Julien Veyssier 2019-04-09 17:05:07 +02:00
parent 916990f1ad
commit 5d8d500851
1 changed files with 3 additions and 20 deletions

View File

@ -3,27 +3,19 @@ app_version=$(version)
project_dir=$(CURDIR)/../$(app_name) project_dir=$(CURDIR)/../$(app_name)
build_dir=/tmp/build build_dir=/tmp/build
sign_dir=/tmp/sign sign_dir=/tmp/sign
build_dir_own=/tmp/build_own
sign_dir_own=/tmp/sign_own
cert_dir=$(HOME)/.nextcloud/certificates cert_dir=$(HOME)/.nextcloud/certificates
cert_dir_own=$(HOME)/.owncloud/certificates
webserveruser ?= www-data webserveruser ?= www-data
occ_dir ?= /var/www/html/n14 occ_dir ?= /var/www/html/n15
occ_dir_own ?= /var/www/html/n14
all: appstore all: appstore
clean: clean:
rm -rf $(build_dir) rm -rf $(build_dir)
rm -rf $(build_dir_own)
rm -rf $(sign_dir) rm -rf $(sign_dir)
rm -rf $(sign_dir_own)
appstore: clean appstore: clean
mkdir -p $(sign_dir) mkdir -p $(sign_dir)
mkdir -p $(sign_dir)_own
mkdir -p $(build_dir) mkdir -p $(build_dir)
mkdir -p $(build_dir)_own
rsync -a \ rsync -a \
--exclude=.git \ --exclude=.git \
--exclude=appinfo/signature.json \ --exclude=appinfo/signature.json \
@ -52,20 +44,11 @@ appstore: clean
--exclude=tests \ --exclude=tests \
--exclude=vendor/bin \ --exclude=vendor/bin \
$(project_dir) $(sign_dir) $(project_dir) $(sign_dir)
cp -r $(sign_dir)/$(app_name) $(sign_dir_own)/
# adapt info.xml
sed -i '/[^<][oO]wn[cC]loud[^>]/d' $(sign_dir)/$(app_name)/appinfo/info.xml
sed -i '/[nN]extcloud/d' $(sign_dir_own)/$(app_name)/appinfo/info.xml
# give the webserver user the right to create signature file # give the webserver user the right to create signature file
sudo chown $(webserveruser) $(sign_dir)/$(app_name)/appinfo $(sign_dir_own)/$(app_name)/appinfo 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 -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 -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
sudo chown -R $(USER) $(sign_dir)/$(app_name)/appinfo $(sign_dir_own)/$(app_name)/appinfo
tar -czf $(build_dir)/$(app_name)-$(app_version).tar.gz \ tar -czf $(build_dir)/$(app_name)-$(app_version).tar.gz \
-C $(sign_dir) $(app_name) -C $(sign_dir) $(app_name)
tar -czf $(build_dir_own)/$(app_name)-$(app_version).tar.gz \
-C $(sign_dir_own) $(app_name)
echo NEXTCLOUD------------------------------------------ echo NEXTCLOUD------------------------------------------
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(app_version).tar.gz | openssl base64 openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(app_version).tar.gz | openssl base64
echo OWNCLOUD-------------------------------------------
openssl dgst -sha512 -sign $(cert_dir_own)/$(app_name).key $(build_dir_own)/$(app_name)-$(app_version).tar.gz | openssl base64