# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=phodav
pkgver=3.0
pkgrel=3
pkgdesc='WebDav server implementation using libsoup (RFC 4918)'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://wiki.gnome.org/phodav'
license=('LGPL-2.1-or-later')
depends=('avahi' 'glib2' 'glibc' 'libsoup3' 'libxml2' 'systemd')
makedepends=('asciidoc' 'gtk-doc' 'meson' 'xmlto')
backup=('etc/conf.d/spice-webdavd')
source=("https://download.gnome.org/sources/$pkgname/$pkgver/$pkgname-$pkgver.tar.xz")
sha256sums=('392ec2d06d50300dcff1ef269a2a985304e29bce3520002fca29f2edc1d138d1')

prepare() {
	cd $pkgname-$pkgver
	sed -i 's|/etc/sysconfig/spice-webdavd|/etc/conf.d/spice-webdavd|
	        s|/usr/sbin/spice-webdavd|/usr/bin/spice-webdavd|' data/spice-webdavd.service
}

build() {
	arch-meson $pkgname-$pkgver build
	meson compile -C build
}

package() {
	meson install -C build --destdir "$pkgdir"

	install -dm755 "$pkgdir/etc/conf.d/"
	echo 'SPICE_WEBDAVD_EXTRA_ARGS=""' > "$pkgdir/etc/conf.d/spice-webdavd"
}
