# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=snac
pkgver=2.58
pkgrel=0
pkgdesc="Simple, minimalistic ActivityPub instance written in portable C"
url="https://codeberg.org/grunfink/snac2"
arch="all"
license="MIT"
makedepends="curl-dev openssl-dev"
install="$pkgname.pre-install"
pkgusers="snac"
pkggroups="snac"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/grunfink/snac2/archive/$pkgver.tar.gz
	snac.initd
	"
builddir="$srcdir/snac2"
options="!check" # no test suite

build() {
	make
}

package() {
	make install \
		PREFIX="$pkgdir"/usr \
		PREFIX_MAN="$pkgdir"/usr/share/man

	install -dm750 -o snac -g snac "$pkgdir"/var/lib/snac

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/

	install -Dm755 "$srcdir"/snac.initd "$pkgdir"/etc/init.d/snac
}

sha512sums="
57bbf68f006008bba2f28d31dbc5eb1b41513463b340dafb747012141c2ef9f766308e570cccf124b21d03472493bb4e5676ec74d042d3d61a6a36e7c9d2cdc3  snac-2.58.tar.gz
8451eb37e5135b926a1a36b7f69d63cb76aa617ca3f9b9167f2284223582dcf66723ee67c51c6abc2d1605c41678d26f67ec6cb1bf920c61379dbf63f7852e1a  snac.initd
"
