summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/kea')
-rw-r--r--net-misc/kea/Manifest1
-rw-r--r--net-misc/kea/files/kea-confd-r110
-rw-r--r--net-misc/kea/files/kea-initd-r180
-rw-r--r--net-misc/kea/kea-1.8.1.ebuild74
4 files changed, 165 insertions, 0 deletions
diff --git a/net-misc/kea/Manifest b/net-misc/kea/Manifest
index 027c01c2bff1..e957c1a45dd4 100644
--- a/net-misc/kea/Manifest
+++ b/net-misc/kea/Manifest
@@ -1,2 +1,3 @@
DIST kea-1.7.10.tar.gz 7513433 BLAKE2B 7b7accccf1200c8673669d4db7ae5efa628a409661b3f82d6dc85c191578cb73fc85866307a1626a0c4a48f81df4f4ad3f5a2b9d8d5f682de2e8fc5750b56ff5 SHA512 b5f6c7c6538f767b604ff59e4cb8acb0a85bfa7611f9dbdc1b17cc70d483d6fcdc4978ccda8dd010623b2126d0b8ddf4275012f492b1c57f7b210bfd946e4a68
DIST kea-1.7.9.tar.gz 7481156 BLAKE2B eef2561b79ad83c18d42a0d23e97fc27205190475c24bb871112050b5ec0a134c4c448c03c4f1b678aadf7d54c7f96481c43485187408f8bfebe6f2c6edbc832 SHA512 180e80dbf21789e9c18c69b9e03a2ad4519eb3386cf8c4221a283883eb8151443e888b6a95d1affb0790ef25d6174582448bf590eb2ddadb12b965cba7dc8717
+DIST kea-1.8.1.tar.gz 9001243 BLAKE2B f121c173b915b82055048fb05dcde622ef3f7ee1d113604d94c7df737f9de1b15e5cedbe414ea583f6a6c9e9ceca615eaad2778a2736addc21b27fe45521aa3e SHA512 0f0972d63a1e146623dd30b8acab9a72af2d10c25fbdf9cf31e66ed25dee14f6b7602226c475f574a723415ba5569b04e13a97711bd933448e1045636ca6b96f
diff --git a/net-misc/kea/files/kea-confd-r1 b/net-misc/kea/files/kea-confd-r1
new file mode 100644
index 000000000000..ef7b2f49dd9d
--- /dev/null
+++ b/net-misc/kea/files/kea-confd-r1
@@ -0,0 +1,10 @@
+# Which services should be taken into account?
+DHCP4="true"
+DHCP6="false"
+DDNS="false"
+
+# Define your config files here. Otherwise we default to files in /etc/kea
+# (see init script)
+#DHCP4_CONFIG="/etc/kea/dhcp4.conf"
+#DHCP6_CONFIG="/etc/kea/dhcp6.conf"
+#DDNS_CONFIG="/etc/kea/ddns.conf"
diff --git a/net-misc/kea/files/kea-initd-r1 b/net-misc/kea/files/kea-initd-r1
new file mode 100644
index 000000000000..57711b3c9d36
--- /dev/null
+++ b/net-misc/kea/files/kea-initd-r1
@@ -0,0 +1,80 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="kea dhcp services"
+
+dhcp4_command="/usr/sbin/kea-dhcp4"
+dhcp6_command="/usr/sbin/kea-dhcp6"
+ddns_command="/usr/sbin/kea-dhcp-ddns"
+dhcp4_config="${DHCP4_CONFIG:-/etc/kea/dhcp4.conf}"
+dhcp6_config="${DHCP6_CONFIG:-/etc/kea/dhcp6.conf}"
+ddns_config="${DDNS_CONFIG:-/etc/kea/ddns.conf}"
+dhcp4_pidfile="/run/kea-dhcp4.pid"
+dhcp6_pidfile="/run/kea-dhcp6.pid"
+ddns_pidfile="/run/kea-ddns.pid"
+
+depend() {
+ use net
+}
+
+start_pre() {
+ if [ ! -f "${config_file}" ] ; then
+ eerror "Please create a ${config_file} config file."
+ return 1
+ fi
+
+ if ${DHCP4:-false} ; then
+ if ! ${dhcp4_command} -t ${dhcp4_config} 1>/dev/null 2>/dev/null ; then
+ eerror "Error in config file ${dhcp4_config}"
+ return 1
+ fi
+ fi
+ if ${DHCP6:-false} ; then
+ if ! ${dhcp6_command} -t ${dhcp6_config} 1>/dev/null 2>/dev/null ; then
+ eerror "Error in config file ${dhcp6_config}"
+ return 1
+ fi
+ fi
+ if ${DDNS:-false} ; then
+ if ! ${ddns_command} -t ${ddns_config} 1>/dev/null 2>/dev/null ; then
+ eerror "Error in config file ${ddns_config}"
+ return 1
+ fi
+ fi
+}
+
+start() {
+ einfo "Starting kea dhcp services"
+ if ${DHCP4:-false} ; then
+ start-stop-daemon -m -b -p ${dhcp4_pidfile} \
+ -x ${dhcp4_command} -- -c ${dhcp4_config} \
+ || return 1
+ fi
+ if ${DHCP6:-false} ; then
+ start-stop-daemon -m -b -p ${dhcp6_pidfile} \
+ -x ${dhcp6_command} -- -c ${dhcp6_config} \
+ || return 1
+ fi
+ if ${DDNS:-false} ; then
+ start-stop-daemon -m -b -p ${ddns_pidfile} \
+ -x ${ddns_command} -- -c ${ddns_config} \
+ || return 1
+ fi
+}
+
+stop() {
+ einfo "Stopping kea dhcp services"
+ if ${DHCP4:-false} ; then
+ start-stop-daemon --stop -p ${dhcp4_pidfile} \
+ || return 1
+ fi
+ if ${DHCP6:-false} ; then
+ start-stop-daemon --stop -p ${dhcp6_pidfile} \
+ || return 1
+ fi
+ if ${DDNS:-false} ; then
+ start-stop-daemon --stop -p ${ddns_pidfile} \
+ || return 1
+ fi
+}
diff --git a/net-misc/kea/kea-1.8.1.ebuild b/net-misc/kea/kea-1.8.1.ebuild
new file mode 100644
index 000000000000..3e20776fe7e7
--- /dev/null
+++ b/net-misc/kea/kea-1.8.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+MY_PV="${PV//_p/-P}"
+MY_PV="${MY_PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="High-performance production grade DHCPv4 & DHCPv6 server"
+HOMEPAGE="http://www.isc.org/kea/"
+if [[ ${PV} = 9999* ]] ; then
+ inherit autotools git-r3
+ EGIT_REPO_URI="https://github.com/isc-projects/kea.git"
+else
+ SRC_URI="ftp://ftp.isc.org/isc/kea/${MY_P}.tar.gz
+ ftp://ftp.isc.org/isc/kea/${MY_PV}/${MY_P}.tar.gz"
+ [[ "${PV}" == *_beta* ]] || [[ "${PV}" == *_rc* ]] || \
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+IUSE="mysql +openssl postgres samples"
+
+DEPEND="
+ dev-libs/boost:=
+ dev-cpp/gtest
+ dev-libs/log4cplus
+ mysql? ( dev-db/mysql-connector-c )
+ !openssl? ( dev-libs/botan:2= )
+ openssl? ( dev-libs/openssl:0= )
+ postgres? ( dev-db/postgresql:* )
+"
+RDEPEND="${DEPEND}
+ acct-group/dhcp
+ acct-user/dhcp"
+BDEPEND="virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ default
+ [[ ${PV} = *9999 ]] && eautoreconf
+ # Brand the version with Gentoo
+ sed -i \
+ -e "/VERSION=/s:'$: Gentoo-${PR}':" \
+ configure || die
+}
+
+src_configure() {
+ local myeconfargs=(
+ --disable-static
+ --enable-perfdhcp
+ --localstatedir="${EPREFIX}/var"
+ --without-werror
+ $(use_with mysql)
+ $(use_with openssl)
+ $(use_with postgres pgsql)
+ $(use_enable samples install-configurations)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+ newconfd "${FILESDIR}"/${PN}-confd-r1 ${PN}
+ newinitd "${FILESDIR}"/${PN}-initd-r1 ${PN}
+ keepdir /var/lib/${PN} /var/log
+ rm -rf "${ED}"/var/run || die
+ find "${ED}" -type f -name "*.la" -delete || die
+}