arch-pkgs/nextcloud-app-client-push/PKGBUILD
2021-11-12 20:23:22 +00:00

67 lines
2.3 KiB
Bash

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=nextcloud-app-client-push
_pkgname=notify_push
pkgver=0.3.0
pkgrel=1
pkgdesc="Push update support for Nextcloud clients"
arch=('x86_64')
url="https://apps.nextcloud.com/apps/notify_push"
license=('AGPL')
depends=('nextcloud')
makedepends=('rust')
optdepends=('redis: use a local redis server')
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/notify_push/archive/v$pkgver.tar.gz"
'pacman.hook'
'systemd.service'
)
sha512sums=('3bfa1a292222e85f0d361dfdf0958aa57ab3469fe7ebe7eb6b4de850cea6ecc8b477a41f0c1268b6e974ec52299081d2129965b1adbbc7e3f390ff49b499f091'
'cfc10cd3855bc35479db17eaf2d0ba25bf6455061c1fef51384443bbfa447e2b23465641a6cfea6203d12d7d5d4a7fb7397bd197e1049ab149a663ffac684b9d'
'0bb33af48e813ae5389df0c731823cd86147bd1d92d937ad6675b0073e09d162ab0e2eaf16ac11a62ed9a7c794ea31e671371cc09f575ea0cf3bcfb8bf6be033')
b2sums=('e012e72bfd5bfcbe60c9dc5daa871a40b489e282e116c75822746992d8e73366900dce64c5f20516b807f682913b2c5962eb60b82d7e959a7a704d90c3676212'
'4ed61b199e995ecd29ef41505e8ce08a7e784c9e08350e2512b6cb6ad3b30d2601052d208e0d2f7d78e025971fa25a3091deb8eed232475bbd7155776ab99400'
'21f677df863f7d52b1fb5689e1270b1df592d4502d63fab21a922fe29191dc82402909b4c4b45b2f3f41e93965312fc375ec492ca44692dcab7aaa884f7300a9')
prepare() {
# kludgy workaround to specify target architecture
sed -i "s/ARCH/$CARCH/" systemd.service
cd "$_pkgname-$pkgver"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$_pkgname-$pkgver"
cargo build --frozen --release --all-features
}
check() {
cd "$_pkgname-$pkgver"
cargo test --frozen --release --all-features
}
package() {
# systemd integration
install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
cd "$_pkgname-$pkgver"
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
install -vDm644 "$srcdir/pacman.hook" \
"$pkgdir/usr/share/doc/$pkgname/$pkgname.hook"
# app files
local _appdir="$pkgdir/usr/share/webapps/nextcloud/apps/$_pkgname"
install -vd "$_appdir"
cp -va . "$_appdir"
# binary
install -vDm755 -t "$_appdir/bin/$CARCH" "target/release/$_pkgname"
# remove unnecessary files & folders
cd "$_appdir"
rm .dockerignore
cat .nextcloudignore | xargs echo rm -rf | sh
}