blob: cb0528eb3e0b0fb240b01a9c3a85e6767aad8cc6 (
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
|
EAPI=8
DESCRIPTION="Generic modular identity, session, authorization and node-enrollment service"
HOMEPAGE="https://baldeagleos.com/"
SRC_URI="https://distfiles.baldeagleos.com/citadel-0.1.0-r1.tar.zst"
S="${WORKDIR}/citadel"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
RDEPEND="
dev-db/postgresql:18
acct-group/citadel
acct-group/citadel-agent
acct-user/citadel
acct-user/citadel-agent
"
BDEPEND="
dev-lang/rust
net-misc/rsync
"
src_unpack() {
# Portage on this host does not recognize .tar.zst through the generic
# unpack helper; extract explicitly and retain the immutable source root.
mkdir -p "${WORKDIR}" || die
tar --zstd -xf "${DISTDIR}/citadel-0.1.0-r1.tar.zst" -C "${WORKDIR}" || die
local extracted
extracted=$(find "${WORKDIR}" -mindepth 1 -maxdepth 1 -type d -name 'citadel-package-src.*' -print -quit)
[[ -n ${extracted} && -d ${extracted} ]] || die "unexpected Citadel source root"
mv "${extracted}" "${WORKDIR}/citadel" || die
S="${WORKDIR}/citadel"
}
src_compile() {
cd "${S}" || die
cargo build --offline --release --workspace --locked || die
}
src_install() {
newbin target/release/login-server citadeld
newbin target/release/login-admin citadel-admin
dodir /etc/citadel
keepdir /var/lib/citadel /var/log/citadel
insinto /usr/share/citadel
doins -r migrations
doins -r config
insinto /etc/citadel
doins config/callers.example.json
newinitd "${FILESDIR}/citadeld.initd" citadeld
newconfd "${FILESDIR}/citadeld.confd" citadeld
fperms 0750 /etc/citadel /var/lib/citadel /var/log/citadel
}
pkg_postinst() {
einfo "Citadel is installed but not enabled or started."
einfo "Run the explicit migration/bootstrap qualification before production use."
}
|