diff --git a/README.md b/README.md index fb8ec96..7362dcb 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,9 @@ For the CSS we used variables that automatically changed all "pill"-style button # Usage with Custom CSS To be updated at a later time + +# Packaging using the buildscript + +There is a bash script for packaging the application included in the 'code' directory. It makes a tar file using the required file structure, and can optionally sign it. + +The script doesn't require root permissions, just a few packages: ```git, xmlstarlet, tar``` diff --git a/code/MakePackage.sh b/code/MakePackage.sh new file mode 100644 index 0000000..f859941 --- /dev/null +++ b/code/MakePackage.sh @@ -0,0 +1,28 @@ +#!/bin/bash +#Automatic buildscript for Nextcloud apps +#Made by @OliverParoczai +#Requires git, xmlstarlet, tar, and optionally openssl + +REPOURL="https://github.com/OliverParoczai/nextcloud-unroundedcorners.git" #official repo, change if forked +SIGN=FALSE #Sign the file for uploading to the official appstore +SIGNCERT=~/.nextcloud/certificates/unroundedcorners.key #The location of the key + +mkdir tmp + +echo "Cloning $REPOURL" +git clone -q $REPOURL tmp/unroundedcorners/ +VERSION=$(xmlstarlet sel -T -t -m '//info/version' -v . -n tmp/unroundedcorners/appinfo/info.xml) +echo "Version is ${VERSION}" + +echo "Starting compression" +tar --exclude='code' --exclude='differences.png' --exclude=".git" -czf unroundedcorners-v${VERSION}.tar.gz -C tmp unroundedcorners/ + +rm -rf tmp + +if [ $SIGN ]; then + echo "" + echo "The signature:" + echo "" + openssl dgst -sha512 -sign $SIGNCERT unroundedcorners-v${VERSION}.tar.gz | openssl base64 + echo "" +fi