From 511e623042aa8be9805b3414850a9c3abc85a129 Mon Sep 17 00:00:00 2001 From: George Rawlinson Date: Fri, 17 Sep 2021 21:15:54 +0000 Subject: [PATCH] upgpkg: nextcloud-app-client-push Simplify package. --- nextcloud-app-client-push/PKGBUILD | 37 +++++++++---------- .../nextcloud-app-client-push.conf | 17 --------- .../nextcloud-app-client-push.install | 7 ---- ...cloud-app-client-push.hook => pacman.hook} | 2 +- ...pp-client-push.service => systemd.service} | 1 + 5 files changed, 20 insertions(+), 44 deletions(-) delete mode 100644 nextcloud-app-client-push/nextcloud-app-client-push.conf delete mode 100644 nextcloud-app-client-push/nextcloud-app-client-push.install rename nextcloud-app-client-push/{nextcloud-app-client-push.hook => pacman.hook} (76%) rename nextcloud-app-client-push/{nextcloud-app-client-push.service => systemd.service} (91%) diff --git a/nextcloud-app-client-push/PKGBUILD b/nextcloud-app-client-push/PKGBUILD index 197b7f4..cba4448 100644 --- a/nextcloud-app-client-push/PKGBUILD +++ b/nextcloud-app-client-push/PKGBUILD @@ -6,24 +6,23 @@ pkgver=0.2.4 pkgrel=1 pkgdesc="Push update support for Nextcloud clients" arch=('x86_64') -url="https://github.com/nextcloud/notify_push" +url="https://apps.nextcloud.com/apps/notify_push" license=('AGPL') depends=('nextcloud') makedepends=('rust') optdepends=('redis: use a local redis server') -install="$pkgname.install" source=( - "$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" - "$pkgname.hook" - "$pkgname.service" + "$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/notify_push/archive/v$pkgver.tar.gz" + 'pacman.hook' + 'systemd.service' ) b2sums=('5136f254c51994924f89eb986ae77f0034b51ac9f8c09e5acb17cd9070e3a5f1241e9795d8fde05ce17ee383b56a95c92f84f871d2471ea5f5ec401578421dcf' - '1dd7720beba1482e1759f7dea8e9c07ae32f2107fc45fe94388993e66ad9a442771209af086b36e0cc50ab36e7a3990c6f3a120e24a525292f906e0d1a3434cd' - '28f2c102b1370ef7d9bc5bc736f71ccb4708e50285a1f6592535efe2ad0c301e99707021bdc4fe2be131082b1589329334b30ad0ad1e6a6764c189fb4f287170') + '4ed61b199e995ecd29ef41505e8ce08a7e784c9e08350e2512b6cb6ad3b30d2601052d208e0d2f7d78e025971fa25a3091deb8eed232475bbd7155776ab99400' + '21f677df863f7d52b1fb5689e1270b1df592d4502d63fab21a922fe29191dc82402909b4c4b45b2f3f41e93965312fc375ec492ca44692dcab7aaa884f7300a9') prepare() { # kludgy workaround to specify target architecture - sed -i "s/ARCH/$CARCH/" "$pkgname.service" + sed -i "s/ARCH/$CARCH/" systemd.service cd "$_pkgname-$pkgver" cargo fetch --locked --target "$CARCH-unknown-linux-gnu" @@ -40,25 +39,25 @@ check() { } package() { - local _appdir="$pkgdir/usr/share/webapps/nextcloud/apps/$_pkgname" + # systemd integration + install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service" + cd "$_pkgname-$pkgver" # documentation - install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" \ - README.md \ - "$srcdir/$pkgname.hook" + install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md + install -vDm644 "$srcdir/pacman.hook" \ + "$pkgdir/usr/share/doc/$pkgname/$pkgname.hook" # app files - install -d "$_appdir" - cp -a . "$_appdir" + local _appdir="$pkgdir/usr/share/webapps/nextcloud/apps/$_pkgname" + install -vd "$_appdir" + cp -va . "$_appdir" # binary - install -Dm755 -t "$_appdir/bin/$CARCH" "target/release/$_pkgname" + install -vDm755 -t "$_appdir/bin/$CARCH" "target/release/$_pkgname" - # systemd integration - install -Dm644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/$pkgname.service" - - # cleanup + # remove unnecessary files & folders cd "$_appdir" rm .dockerignore cat .nextcloudignore | xargs echo rm -rf | sh diff --git a/nextcloud-app-client-push/nextcloud-app-client-push.conf b/nextcloud-app-client-push/nextcloud-app-client-push.conf deleted file mode 100644 index 0b659a0..0000000 --- a/nextcloud-app-client-push/nextcloud-app-client-push.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Specify path to Nextcloud's config.php -NC_CLIENT_PUSH_ARGS="/etc/webapps/nextcloud/config/config.php" - -# If using the config.php isn't possible, you can configure the push server by -# setting the following environment variables: -#PORT=7867 Listen port for push server -#SOCKET_PATH=/run/nextcloud/push.sock -#DATABASE_URL connection url for the Nextcloud database, e.g. postgres://user:password@db_host/db_name -#DATABASE_PREFIX database prefix configured in Nextcloud, e.g. oc_ -#REDIS_URL connection url for redis, e.g. redis://redis_host -#NEXTCLOUD_URL url for the nextcloud instance, e.g. https://cloud.example.com -#LOG log level of the push server, e.g. error, warn, info, debug or trace -#METRICS_PORT Exposes Prometheus-compatible metrics on configured port if set -#ALLOW_SELF_SIGNED Disable certificate verification by setting this to true - -# If both the config.php and environment variables are provided, the environment -# variables will overwrite the value from config.php diff --git a/nextcloud-app-client-push/nextcloud-app-client-push.install b/nextcloud-app-client-push/nextcloud-app-client-push.install deleted file mode 100644 index e8d92cb..0000000 --- a/nextcloud-app-client-push/nextcloud-app-client-push.install +++ /dev/null @@ -1,7 +0,0 @@ -post_install() { - echo "Run systemctl enable --now nextcloud-app-client-push.service" - echo "Enable the Nextcloud app via 'occ app:enable notify_push'" - echo "Set up the push server via 'occ notify_push:setup https://cloud.example.com/push'" - echo "Perform a self check via 'occ notify_push:self-test" - echo "See /usr/share/doc/nextcloud-app-client-push for README.md and a pacman hook" -} diff --git a/nextcloud-app-client-push/nextcloud-app-client-push.hook b/nextcloud-app-client-push/pacman.hook similarity index 76% rename from nextcloud-app-client-push/nextcloud-app-client-push.hook rename to nextcloud-app-client-push/pacman.hook index 7b7581d..2b9aeab 100644 --- a/nextcloud-app-client-push/nextcloud-app-client-push.hook +++ b/nextcloud-app-client-push/pacman.hook @@ -1,4 +1,4 @@ -# Copy, move or symlink this file in /usr/share/libalpm/hooks/ to force a +# Copy or symlink this file in /usr/share/libalpm/hooks/ to force a # restart when nextcloud-app-client-push is updated. [Trigger] diff --git a/nextcloud-app-client-push/nextcloud-app-client-push.service b/nextcloud-app-client-push/systemd.service similarity index 91% rename from nextcloud-app-client-push/nextcloud-app-client-push.service rename to nextcloud-app-client-push/systemd.service index 3d1b293..f9f76ec 100644 --- a/nextcloud-app-client-push/nextcloud-app-client-push.service +++ b/nextcloud-app-client-push/systemd.service @@ -1,5 +1,6 @@ [Unit] Description=Push daemon for Nextcloud clients +Documentation=https://apps.nextcloud.com/apps/notify_push https://github.com/nextcloud/notify_push [Service] # If NC_CLIENT_PUSH_ARGS needs to be adjusted, it should be adjusted