From fa59bb8057931881cdb6ec9986fd8c8163fe117d Mon Sep 17 00:00:00 2001 From: Feras Bisharat Date: Thu, 26 Sep 2024 13:12:14 +0300 Subject: [PATCH] packaging: fixes for debian and spec files Various fixes for debian and spec files: Changed control to add python3 as dependency Changed changelog to make the package as unstable Changed postint and prerm file names Changed name of package in spec file to strongswan instead of strongswan-bf to align with debian Disabled legacy strongswan-starter service Pumped version to 5.9.10-2.bf Signed-off-by: Feras Bisharat --- configure.ac | 2 ++ debian/changelog | 4 ++-- debian/control | 2 +- debian/postinst | 15 +++++++++++++++ debian/prerm | 11 +++++++++++ debian/strongswan.postinst | 12 ------------ debian/strongswan.prerm | 9 --------- strongswan.spec | 16 +++++++++------- 8 files changed, 40 insertions(+), 31 deletions(-) create mode 100755 debian/postinst create mode 100755 debian/prerm delete mode 100755 debian/strongswan.postinst delete mode 100755 debian/strongswan.prerm diff --git a/configure.ac b/configure.ac index 1a21e6ab21b..df6670e3772 100644 --- a/configure.ac +++ b/configure.ac @@ -1918,6 +1918,8 @@ AM_CONDITIONAL(USE_SWANCTL, test x$swanctl = xtrue) AM_CONDITIONAL(USE_SVC, test x$svc = xtrue) AM_CONDITIONAL(USE_SYSTEMD, test x$systemd = xtrue) AM_CONDITIONAL(USE_LEGACY_SYSTEMD, test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno) +# Disable legacy systemd +AM_CONDITIONAL(USE_LEGACY_SYSTEMD, false) AM_CONDITIONAL(USE_RUBY_GEMS, test x$ruby_gems = xtrue) AM_CONDITIONAL(USE_PYTHON_EGGS, test x$python_eggs = xtrue) AM_CONDITIONAL(USE_PERL_CPAN, test x$perl_cpan = xtrue) diff --git a/debian/changelog b/debian/changelog index e4060a56aa0..a106392ee08 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -strongswan (5.9.10-1.bf) RELEASED; +strongswan (5.9.10-2.bf) unstable; urgency=low * Initial bluefield release. - -- Feras Bisharat Tue, 05 Oct 2023 14:07:36 +0200 + -- Feras Bisharat Thu, 26 Sep 2024 13:09:38 +0300 diff --git a/debian/control b/debian/control index 8a9eb44fb67..f80af322d36 100755 --- a/debian/control +++ b/debian/control @@ -13,7 +13,7 @@ Build-Depends: debhelper (>=11~), gettext, libgmp-dev, perl, - python2, + python3, libssl-dev, libsystemd-dev Standards-Version: 4.1.4 diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 00000000000..06aac7457d3 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +# Use the new strongswan.service instead of the legacy strongswan-starter +# systemctl unmask strongswan-starter.service +# systemctl enable strongswan-starter.service +systemctl stop strongswan-starter.service > /dev/null 2>&1 || true +systemctl disable strongswan-starter.service > /dev/null 2>&1 || true + +# systemctl unmask strongswan.service || true +# systemctl enable strongswan.service || true + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 00000000000..c3f28068ca4 --- /dev/null +++ b/debian/prerm @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +systemctl stop strongswan-starter.service > /dev/null 2>&1 || true +systemctl disable strongswan-starter.service > /dev/null 2>&1 || true +# systemctl stop strongswan.service || true +# systemctl disable strongswan.service || true + +#DEBHELPER# + +exit 0 diff --git a/debian/strongswan.postinst b/debian/strongswan.postinst deleted file mode 100755 index 25461877812..00000000000 --- a/debian/strongswan.postinst +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -# Use the new strongswan.service instead of the legacy strongswan-starter -# systemctl unmask strongswan-starter.service -# systemctl enable strongswan-starter.service -systemctl unmask strongswan.service -systemctl enable strongswan.service - -#DEBHELPER# - -exit 0 diff --git a/debian/strongswan.prerm b/debian/strongswan.prerm deleted file mode 100755 index 08ac4cbfc66..00000000000 --- a/debian/strongswan.prerm +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -systemctl disable strongswan-starter.service -systemctl disable strongswan.service - -#DEBHELPER# - -exit 0 diff --git a/strongswan.spec b/strongswan.spec index e18f3989207..b4157fe9c0c 100644 --- a/strongswan.spec +++ b/strongswan.spec @@ -1,6 +1,6 @@ -Name: strongswan-bf +Name: strongswan Version: 5.9.10 -Release: 1.bf%{?dist} +Release: 2.bf%{?dist} Summary: BlueField Strongswan Package License: BSD and GPLv2+ and MIT and Expat @@ -19,9 +19,6 @@ BuildRequires: flex BuildRequires: libtool BuildRequires: gcc >= 3 -Provides: strongswan -Obsoletes: strongswan - %package -n strongswan-swanctl Summary: Placeholder package for strongswan-swanctl for dependency resolution %description -n strongswan-swanctl @@ -36,11 +33,15 @@ Linux Kernel. %files -n strongswan-swanctl %prep -%setup +rm -rf build/* || rm -rf strongswan-5.9.10 || true + +%setup -q cp -f systemd-conf/strongswan-starter.service.in.centos init/systemd-starter/strongswan-starter.service.in cp -f systemd-conf/strongswan.service.in.centos init/systemd/strongswan.service.in +./autogen.sh %build +export CFLAGS="$CFLAGS -Wformat -Wno-error -Wno-error=format -Wno-error=format-extra-args" %configure \ --enable-openssl \ --disable-random \ @@ -59,7 +60,8 @@ cp -f mlnx-conf/BFL.swanctl.conf $RPM_BUILD_ROOT%{_sysconfdir}/swanctl/conf.d cp -f mlnx-conf/BFR.swanctl.conf $RPM_BUILD_ROOT%{_sysconfdir}/swanctl/conf.d %preun -systemctl disable strongswan-starter.service +systemctl stop strongswan-starter.service > /dev/null 2>&1 || true +systemctl disable strongswan-starter.service > /dev/null 2>&1 || true %post # Use the strongswan.service instead of the legacy strongswan-starter