# Maintainer: Joshua <joshua at joshicodes dot de>
pkgname=knock-bin
pkgver=0.1.0
pkgrel=1
pkgdesc="Offline desktop API client for REST, GraphQL and WebSocket with plain-file collections (binary release)"
arch=('x86_64')
url="https://github.com/JoshiCodes/knock"
license=('MIT')
depends=('webkit2gtk-4.1' 'gtk3' 'libsecret' 'hicolor-icon-theme')
optdepends=('kwallet: store secrets in KWallet' 'gnome-keyring: store secrets in GNOME Keyring')
provides=('knock')
conflicts=('knock')
source=("knock_${pkgver}_amd64.deb::$url/releases/download/v$pkgver/knock_${pkgver}_amd64.deb")
sha256sums=('SKIP')

package() {
	bsdtar -xf data.tar.* -C "$pkgdir"
	# KDE matches the window (app id knock-app) to the desktop file by name.
	if [ -f "$pkgdir/usr/share/applications/knock.desktop" ]; then
		mv "$pkgdir/usr/share/applications/knock.desktop" "$pkgdir/usr/share/applications/knock-app.desktop"
	fi
	install -Dm644 "$pkgdir/usr/share/doc/knock/copyright" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" 2>/dev/null || true
}
