From 2b69f1b2ef45b4f20d1a093dd98d59889aef6442 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 25 Nov 2020 16:28:04 +0100 Subject: [PATCH] Add target to create appstore package. --- .gitignore | 1 + Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/.gitignore b/.gitignore index 48e084a..d308d35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /pdfjs-*.zip 3rdparty/pdfjs/ +build/ server/config.js server/package-lock.json diff --git a/Makefile b/Makefile index f690f21..c16317d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,15 @@ PDFJS_VERSION=2.0.943 +app_name=pdfdraw + +project_dir=$(CURDIR)/../$(app_name) +build_dir=$(CURDIR)/build/artifacts +appstore_dir=$(build_dir)/appstore +source_dir=$(build_dir)/source +sign_dir=$(build_dir)/sign +package_name=$(app_name) +cert_dir=$(HOME)/.nextcloud/certificates + all: 3rdparty 3rdparty: pdfjs @@ -12,3 +22,38 @@ pdfjs: pdfjs-${PDFJS_VERSION}-dist.zip unzip -qo pdfjs-${PDFJS_VERSION}-dist.zip -d 3rdparty/pdfjs build: 3rdparty + +clean: + rm -rf $(build_dir) + +appstore: clean build + mkdir -p $(sign_dir) + rsync -a \ + --exclude=build \ + --exclude=.eslintignore \ + --exclude=.eslintrc.yml \ + --exclude=.git \ + --exclude=.github \ + --exclude=.gitignore \ + --exclude=.gitmodules \ + --exclude=Makefile \ + --exclude=node_modules \ + --exclude=pdfjs*.zip \ + --exclude=package.json \ + --exclude=run-*lint.sh \ + --exclude=.stylelintrc \ + $(project_dir)/ \ + $(sign_dir)/$(app_name) + @if [ -f $(cert_dir)/$(app_name).key ]; then \ + echo "Signing app files…"; \ + php ../../occ integrity:sign-app \ + --privateKey=$(cert_dir)/$(app_name).key\ + --certificate=$(cert_dir)/$(app_name).crt\ + --path=$(sign_dir)/$(app_name); \ + fi + tar -czf $(build_dir)/$(app_name)-$(version).tar.gz \ + -C $(sign_dir) $(app_name) + @if [ -f $(cert_dir)/$(app_name).key ]; then \ + echo "Signing package…"; \ + openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(version).tar.gz | openssl base64; \ + fi