blob: 0d8a5761bc012d9ffa2f5dcdd955ffaa814433f8 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module systemd tmpfiles
DESCRIPTION="soju is a user-friendly IRC bouncer"
HOMEPAGE="https://soju.im/"
SRC_URI="https://codeberg.org/emersion/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://github.com/alfredfo/${PN}-deps/raw/master/${P}-deps.tar.xz"
S="${WORKDIR}/soju"
LICENSE="AGPL-3 Apache-2.0 MIT BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv"
IUSE="moderncsqlite +sqlite pam"
REQUIRED_USE="?? ( moderncsqlite sqlite )"
BDEPEND="
app-text/scdoc
"
RDEPEND="
acct-user/soju
acct-group/soju
sqlite? ( dev-db/sqlite:3 )
"
DEPEND="${RDEPEND}"
src_compile() {
# musl removed legacy LFS64 interfaces in version 1.2.4 temporarily
# reenabled using _LARGEFILE64_SOURCE until this is resolved
# upstream https://github.com/mattn/go-sqlite3/issues/1164
CGO_CFLAGS="${CGO_CFLAGS}"
if use sqlite; then
GOFLAGS+=" -tags=libsqlite3"
CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
elif use moderncsqlite; then
GOFLAGS+=" -tags=moderncsqlite"
CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
else
GOFLAGS+=" -tags=nosqlite"
fi
# Only way to pass CFLAGS to CGO at the
# moment. https://github.com/gentoo/gentoo/pull/33539/
export CGO_CFLAGS
use pam && GOFLAGS+=" -tags=pam"
ego build ${GOFLAGS} ./cmd/soju
ego build ${GOFLAGS} ./cmd/sojudb
ego build ${GOFLAGS} ./cmd/sojuctl
scdoc <doc/soju.1.scd >doc/soju.1 || die
scdoc <doc/sojuctl.1.scd >doc/sojuctl.1 || die
}
src_install() {
dobin soju
dobin sojudb
dobin sojuctl
doman doc/soju.1
doman doc/sojuctl.1
systemd_dounit contrib/soju.service
newtmpfiles "${FILESDIR}/soju.tmpfiles" soju.conf
keepdir /etc/soju
insinto /etc/soju
newins config.in config
newinitd "${FILESDIR}"/soju.initd soju
einstalldocs
}
pkg_postinst() {
tmpfiles_process soju.conf
elog "${PN} requires a user database for authenticating clients."
elog "As the soju user, create a database using:"
elog "$ sojudb -config ${EROOT}/etc/soju/config create-user <username> [-admin]"
}
|