From patchwork Tue Feb 28 10:23:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6641 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PQtkp2PJqz3wk3 for ; Tue, 28 Feb 2023 10:24:02 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PQtkl5J5Vz2cG; Tue, 28 Feb 2023 10:23:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PQtkl1Qd6z30GQ; Tue, 28 Feb 2023 10:23:59 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PQtkj1nyhz2y1X for ; Tue, 28 Feb 2023 10:23:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PQtkh5NTkztZ; Tue, 28 Feb 2023 10:23:56 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1677579836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bNK26YlRr2vRsLJfypmemFtwTvZ8hJFR8f8eJxHqYVo=; b=tLGU8wLlualRc6jZju8xdbMHH83HJ3q5TL3BZdykrJZQoBZCXI4+1fOZqeE2pxDvbMjaGu tzY/D5Y4NYg7K5DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1677579836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bNK26YlRr2vRsLJfypmemFtwTvZ8hJFR8f8eJxHqYVo=; b=P8cPxxLuZgPK2RCARzEjFY9jodV7sLqqJiZwQYrJprLBQ4T/sdnkY+HVPqnzNPdAS717tM GDpBR2ttRaSp9MsXL+CjT6x/TjO065Z3LoO5OkKOute0W0s5nBkUzLSecUafyk7AhQ05vq givyf5I6d+9ZNyByWiKEEPeGK7cFQ52Hp8OfIMUT49xKvPQ5ySNeaz/B/6VmHHXCzZUnkB ltLUek98m2PaogrZPI8TL0Sdji3dF87H6YoxhpRNOf3tyhc0QEc877kwwdFmiSytKveoLE 8HAzP7eNirkBoSx2jZqsgIicVbhZMqJ4dRM2/IJdXpy4qKGBwnmwV+3N5NKXPg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/2] kea: New package Date: Tue, 28 Feb 2023 11:23:47 +0100 Message-Id: <20230228102347.188481-2-stefan.schantl@ipfire.org> In-Reply-To: <20230228102347.188481-1-stefan.schantl@ipfire.org> References: <20230228102347.188481-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- kea/kea.nm | 113 ++++++++++++++++++ kea/kea.tmpfiles | 1 + ...-2.2.0-configure-fix-python3-version.patch | 12 ++ kea/systemd/kea-ctrl-agent.service | 13 ++ kea/systemd/kea-dhcp-ddns.service | 13 ++ kea/systemd/kea-dhcp4.service | 13 ++ kea/systemd/kea-dhcp6.service | 13 ++ 7 files changed, 178 insertions(+) create mode 100644 kea/kea.nm create mode 100644 kea/kea.tmpfiles create mode 100644 kea/patches/kea-2.2.0-configure-fix-python3-version.patch create mode 100644 kea/systemd/kea-ctrl-agent.service create mode 100644 kea/systemd/kea-dhcp-ddns.service create mode 100644 kea/systemd/kea-dhcp4.service create mode 100644 kea/systemd/kea-dhcp6.service diff --git a/kea/kea.nm b/kea/kea.nm new file mode 100644 index 000000000..c4e23a23f --- /dev/null +++ b/kea/kea.nm @@ -0,0 +1,113 @@ +############################################################################### +# IPFire.org - An Open Source Firewall Solution # +# Copyright (C) - IPFire Development Team # +############################################################################### + +name = kea +version = 2.3.5 +release = 1 + +groups = System/Daemons +url = http://kea.isc.org +license = MPLv2.0 and Boost +summary = DHCPv4, DHCPv6 and DDNS server from ISC + +description + DHCP implementation from Internet Systems Consortium, Inc. that features + fully functional DHCPv4, DHCPv6 and Dynamic DNS servers. + + Both DHCP servers fully support server discovery, address assignment, + renewal, rebinding and release. The DHCPv6 server supports prefix delegation. + Both servers support DNS Update mechanism, using stand-alone DDNS daemon. +end + +source_dl = https://ftp.isc.org/isc/kea/%{version}/ +sources = %{thisapp}.tar.gz + +build + requires + gcc-c++ + bison + boost-devel + flex + log4cplus-devel + openssl-devel + end + + configure_options += \ + --disable-dependency-tracking \ + --disable-rpath \ + --disable-silent-rules \ + --disable-static \ + --enable-generate-parser \ + --enable-shell \ + --with-openssl \ + --with-log4cplus + + install_cmds + # Start empty lease databases + mkdir -pv %{BUILDROOT}%{sharedstatedir}/kea/ + touch %{BUILDROOT}%{sharedstatedir}/kea/kea-leases4.csv + touch %{BUILDROOT}%{sharedstatedir}/kea/kea-leases6.csv + end +end + +packages + package %{name} + prerequires + systemd + end + + configfiles + %{sysconfdir}/kea/kea-ctrl-agent.conf + %{sysconfdir}/kea/kea-dhcp-ddns.conf + %{sysconfdir}/kea/kea-dhcp4.conf + %{sysconfdir}//kea/kea-dhcp6.conf + %{sysconfdir}/kea/keactrl.conf + end + + datafiles + %{sharedstatedir}/kea/kea-leases4.csv + %{sharedstatedir}/kea/kea-leases6.csv + end + + script postin + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : + end + + script preun + /usr/bin/systemctl --no-reload disable kea-ctrl-agent.service >/dev/null 2>&1 || : + /usr/bin/systemctl --no-reload disable kea-dhcp4.service >/dev/null 2>&1 || : + /usr/bin/systemctl --no-reload disable kea-dhcp6.service >/dev/null 2>&1 || : + /usr/bin/systemctl --no-reload disable kea-dhcp-ddns.service >/dev/null 2>&1 || : + /usr/bin/systemctl stop kea-ctrl-agent.service >/dev/null 2>&1 || : + /usr/bin/systemctl stop kea-dhcp4.service >/dev/null 2>&1 || : + /usr/bin/systemctl stop kea-dhcp6.service >/dev/null 2>&1 || : + /usr/bin/systemctl stop kea-dhcp-ddns.service >/dev/null 2>&1 || : + end + + script postun + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : + end + + script postup + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : + /usr/bin/systemctl try-restart kea-ctrl-agent.service >/dev/null 2>&1 || : + /usr/bin/systemctl try-restart kea-dhcp4.service >/dev/null 2>&1 || : + /usr/bin/systemctl try-restart kea-dhcp6.service >/dev/null 2>&1 || : + /usr/bin/systemctl try-restart kea-dhcp-ddns.service >/dev/null 2>&1 || : + end + end + + package %{name}-libs + template LIBS + end + + package %{name}-devel + template DEVEL + end + + package %{name}-debuginfo + template DEBUGINFO + end +end diff --git a/kea/kea.tmpfiles b/kea/kea.tmpfiles new file mode 100644 index 000000000..0b3abeb75 --- /dev/null +++ b/kea/kea.tmpfiles @@ -0,0 +1 @@ +d /run/kea 0755 root root - diff --git a/kea/patches/kea-2.2.0-configure-fix-python3-version.patch b/kea/patches/kea-2.2.0-configure-fix-python3-version.patch new file mode 100644 index 000000000..97a3f3aa1 --- /dev/null +++ b/kea/patches/kea-2.2.0-configure-fix-python3-version.patch @@ -0,0 +1,12 @@ +diff -Nur a/configure b/configure +--- a/configure 2023-02-28 07:56:13.629233758 +0000 ++++ b/configure 2023-02-28 07:53:19.994816726 +0000 +@@ -22765,7 +22765,7 @@ + if ${am_cv_python_version+:} false; then : + $as_echo_n "(cached) " >&6 + else +- am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` ++ am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:4])"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 + $as_echo "$am_cv_python_version" >&6; } diff --git a/kea/systemd/kea-ctrl-agent.service b/kea/systemd/kea-ctrl-agent.service new file mode 100644 index 000000000..b5c860ca7 --- /dev/null +++ b/kea/systemd/kea-ctrl-agent.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kea Control Agent +Documentation=man:kea-ctrl-agent(8) +Wants=network-online.target +After=network-online.target +After=time-sync.target + +[Service] +ExecStart=/usr/sbin/kea-ctrl-agent -c /etc/kea/kea-ctrl-agent.conf +Environment=KEA_PIDFILE_DIR=/var/run/kea + +[Install] +WantedBy=multi-user.target diff --git a/kea/systemd/kea-dhcp-ddns.service b/kea/systemd/kea-dhcp-ddns.service new file mode 100644 index 000000000..5fdbe0bbf --- /dev/null +++ b/kea/systemd/kea-dhcp-ddns.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kea DHCP-DDNS Server +Documentation=man:kea-dhcp-ddns(8) +Wants=network-online.target +After=network-online.target +After=time-sync.target + +[Service] +ExecStart=/usr/sbin/kea-dhcp-ddns -c /etc/kea/kea-dhcp-ddns.conf +Environment=KEA_PIDFILE_DIR=/var/run/kea + +[Install] +WantedBy=multi-user.target diff --git a/kea/systemd/kea-dhcp4.service b/kea/systemd/kea-dhcp4.service new file mode 100644 index 000000000..0a72768f3 --- /dev/null +++ b/kea/systemd/kea-dhcp4.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kea DHCPv4 Server +Documentation=man:kea-dhcp4(8) +Wants=network-online.target +After=network-online.target +After=time-sync.target + +[Service] +ExecStart=/usr/sbin/kea-dhcp4 -c /etc/kea/kea-dhcp4.conf +Environment=KEA_PIDFILE_DIR=/var/run/kea + +[Install] +WantedBy=multi-user.target diff --git a/kea/systemd/kea-dhcp6.service b/kea/systemd/kea-dhcp6.service new file mode 100644 index 000000000..e1fc05a34 --- /dev/null +++ b/kea/systemd/kea-dhcp6.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kea DHCPv6 Server +Documentation=man:kea-dhcp6(8) +Wants=network-online.target +After=network-online.target +After=time-sync.target + +[Service] +ExecStart=/usr/sbin/kea-dhcp6 -c /etc/kea/kea-dhcp6.conf +Environment=KEA_PIDFILE_DIR=/var/run/kea + +[Install] +WantedBy=multi-user.target