aboutsummaryrefslogtreecommitdiff
blob: 9c37289a49fc1dabd1d6b9e3507be2ad979787f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit systemd toolchain-funcs

MY_PN="snac2"
DESCRIPTION="A simple, minimalistic ActivityPub instance"
HOMEPAGE="https://codeberg.org/grunfink/snac2"
SRC_URI="https://codeberg.org/grunfink/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${MY_PN}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
	dev-libs/openssl:=
	net-misc/curl
"
RDEPEND="${DEPEND}
	acct-user/snac
"

DOCS=( {README,RELEASE_NOTES,TODO}.md )

src_configure() {
	tc-export CC
}

src_install() {
	local mymakeflags=(
		PREFIX="${ED}/usr"
		PREFIX_MAN="${ED}/usr/share/man"
	)

	emake "${mymakeflags[@]}" install
	einstalldocs

	doinitd "${FILESDIR}"/snac
	systemd_dounit "${FILESDIR}"/snac.service

	diropts --owner snac --group snac
	keepdir /var/lib/snac
}

pkg_postinst() {
	if [[ -z ${REPLACING_VERSIONS} ]]; then
		einfo "To finish the installation, please run:"
		einfo " # rc-service snac init"
	fi
}