# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=mlmym
pkgver=0.0.50
pkgrel=0
pkgdesc="Lemmy frontend offering a familiar desktop experience"
url="https://mlmym.org/"
arch="all"
license="AGPL-3.0-or-later"
makedepends="go"
options="net !check"
install="$pkgname.pre-install"
pkgusers="mlmym"
pkggroups="mlmym"
subpackages="$pkgname-openrc"
source="https://github.com/rystaf/mlmym/archive/$pkgver/mlmym-$pkgver.tar.gz
	mlmym.confd
	mlmym.initd
	dont-get-version-from-git.patch
	"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make
}

package() {
	install -Dm755 mlmym -t "$pkgdir"/usr/bin

	mkdir -p "$pkgdir"/usr/share/webapps/mlmym
	cp -r public templates "$pkgdir"/usr/share/webapps/mlmym/
	echo "$pkgver" > "$pkgdir"/usr/share/webapps/mlmym/VERSION

	install -Dm644 "$srcdir"/mlmym.confd "$pkgdir"/etc/conf.d/mlmym
	install -Dm755 "$srcdir"/mlmym.initd "$pkgdir"/etc/init.d/mlmym
}

sha512sums="
b0c1cbfcb8e7216e98b0c3bdf92d1d6ec54d918731886014c947aec3f52da57b916be39709c74b4186555e44775809b351d5b255d022cb3aab50f21352b4d709  mlmym-0.0.50.tar.gz
0550e887d54352ad57ed3e3229fc5177b7c85903f93bfb98fb9c719727e7586b61eff4dbc604fca18a11b20362c14b83aafd9513d1bea567ff338df911a01eca  mlmym.confd
b1e12a9544507db312084ab652ed7572f03c3be3a92b32003b62ad8dbe04f67aae73e18c0aa3e6a6614bacb99a2a1a5254b1ecb196b69a1165db752526351bd8  mlmym.initd
f0e5069f0f082a4b6e5af98aada1c90395c3d63571d36e332f4a96294146b48f52b0dc31963a757bea90215d1c449160e29a23c536172a65a5ccbd5a42402e35  dont-get-version-from-git.patch
"