blob: e1da8124114eb43ef27bfade6c6695862bdbad7e (
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake eapi9-ver systemd
DESCRIPTION="onak is an OpenPGP keyserver"
HOMEPAGE="
https://www.earth.li/projectpurple/progs/onak.html
https://github.com/u1f35c/onak
"
SRC_URI="https://github.com/u1f35c/onak/archive/${P}.tar.gz"
S="${WORKDIR}/${PN}-${P}"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+berkdb +daemon hkp postgres systemd"
RDEPEND="
acct-group/onak
acct-user/onak
dev-libs/nettle:=
dev-libs/gmp:=
berkdb? ( sys-libs/db:= )
daemon? (
systemd? ( sys-apps/systemd:= )
)
hkp? ( net-misc/curl )
postgres? ( dev-db/postgresql:= )
"
DEPEND="${RDEPEND}"
DOCS=(
README.md onak.sql
)
PATCHES=(
"${FILESDIR}/${PN}-0.5.0-musl-strtouq-fix.patch"
"${FILESDIR}/${PN}-0.6.3-cmake.patch"
)
src_prepare() {
cmake_src_prepare
# use a subdir to handle permissions
sed -e 's:log/onak.log:log/onak/onak.log:' \
-i onak.ini.in || die
sed -e "s:/var/log/onak.log:${EPREFIX}/var/log/onak/onak.log:" \
-i debian/onak.logrotate || die
if ! use systemd; then
sed -e 's:^pkg_check_modules.*libsystemd:#&:' \
-i CMakeLists.txt || die
fi
}
src_configure() {
# The GENTOO_BACKENDS variable is controlled from the ebuild, therefore
# it can be synchronised with users USE preference, unlike the BACKENDS
# which is filled automagically based on detected libraries.
# Initialize backends with default values.
local backends=( file fs keyring stacked )
use berkdb && backends+=( db4 )
use daemon && backends+=( keyd )
use hkp && backends+=( hkp )
use postgres && backends+=( pg )
local mycmakeargs=(
-DCMAKE_DISABLE_FIND_PACKAGE_Git="ON"
-DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
# force shared libs backends or only one backend will be available.
-DDBTYPE=dynamic
-DGENTOO_BACKENDS=$(IFS=';'; echo "${backends[*]}")
-DKEYD=$(usex daemon ON OFF)
)
cmake_src_configure
}
src_install() {
cmake_src_install
if use daemon; then
newinitd "${FILESDIR}"/onak.init onak
systemd_dounit debian/onak.service
systemd_dounit debian/onak.socket
fi
insinto /etc/logrotate.d
newins debian/onak.logrotate onak
keepdir /var/{lib,log}/${PN}
fowners -R onak:onak /var/{lib,log}/${PN}
insinto /usr/$(get_libdir)/cgi-bin/pks
doins "${BUILD_DIR}"/cgi/{add,gpgwww,hashquery,lookup}
docinto examples
dodoc doc/{apache2,mathopd.conf}
}
pkg_postinst() {
if ver_replacing -lt 0.6.4; then
ewarn "The key daemon is now handled by the useflag 'daemon'."
ewarn "This package provides the init scripts for both OpenRC and systemd."
if use daemon; then
ewarn " "
ewarn "The binaries for the key daemon has been renamed:"
ewarn "keyd -> onak-keyd"
ewarn "keydctl -> onak-keydctl"
ewarn "Consider adapt your scripts!"
fi
if [[ $(get_libdir) != "lib" ]]; then
ewarn " "
ewarn "The binaries for cgi has been moved:"
ewarn "${EPREFIX}/usr/lib/cgi-bin/ -> ${EPREFIX}/usr/$(get_libdir)/cgi-bin/"
ewarn "Consider adapt your scripts!"
fi
fi
}
|