Skip to content

Commit

Permalink
packaging: fixes for debian and spec files
Browse files Browse the repository at this point in the history
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 <fbisharat@nvidia.com>
  • Loading branch information
ferasbi committed Oct 8, 2024
1 parent 3e0b6fe commit fa59bb8
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 31 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <fbisharat@nvidia.com> Tue, 05 Oct 2023 14:07:36 +0200
-- Feras Bisharat <fbisharat@nvidia.com> Thu, 26 Sep 2024 13:09:38 +0300
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Build-Depends: debhelper (>=11~),
gettext,
libgmp-dev,
perl,
python2,
python3,
libssl-dev,
libsystemd-dev
Standards-Version: 4.1.4
Expand Down
15 changes: 15 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions debian/prerm
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions debian/strongswan.postinst

This file was deleted.

9 changes: 0 additions & 9 deletions debian/strongswan.prerm

This file was deleted.

16 changes: 9 additions & 7 deletions strongswan.spec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit fa59bb8

Please sign in to comment.