Accepting request 1238523 from network:utilities

OBS-URL: https://build.opensuse.org/request/show/1238523
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/knock?expand=0&rev=20
This commit is contained in:
Ana Guerrero 2025-01-17 17:43:58 +00:00 committed by Git OBS Bridge
commit 4118197233
2 changed files with 6 additions and 39 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jan 13 10:06:09 UTC 2025 - Daniel Donisa <daniel.donisa@suse.com>
- Remove conditionals around systemd as all versions use systemd now.
-------------------------------------------------------------------
Tue Sep 28 13:19:54 UTC 2021 - Johannes Segitz <jsegitz@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package knock
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 1980 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,12 +21,6 @@
%define _fillupdir /var/adm/fillup-templates
%endif
%if 0%{?suse_version} > 1210
%define with_systemd 1
%else
%define with_systemd 0
%endif
Name: knock
Version: 0.8
Release: 0
@ -40,10 +34,7 @@ Source2: %{name}d.init
Source3: %{name}d.conf
Source4: %{name}d.service
BuildRequires: libpcap-devel
%if %{with_systemd}
BuildRequires: systemd-rpm-macros
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The server part (package knockd) listens to all traffic on an ethernet
@ -58,11 +49,7 @@ can be used to open up holes in a firewall for quick access.
%package -n knockd
Summary: A port-knocking server
Group: Productivity/Networking/Security
%if %{with_systemd}
%{?systemd_requires}
%else
Requires(pre): %insserv_prereq %fillup_prereq
%endif
%description -n knockd
It listens to all traffic on an ethernet (or PPP) interface, looking
@ -85,41 +72,21 @@ make %{?_smp_mflags}
make DESTDIR=%{buildroot} install %{?_smp_mflags}
sed -i -e "s:iptables:%{_sbindir}/iptables:" %{SOURCE3}
install -m 600 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}d.conf
%if %{with_systemd}
install -D -m 644 %{SOURCE4} %{buildroot}/%{_unitdir}/%{name}d.service
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}d
%else
install -m 644 -D %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.%{name}d
install -m 755 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name}d
ln -sf ../..%{_initddir}/%{name}d %{buildroot}%{_sbindir}/rc%{name}d
%endif
rm -rf %{buildroot}%{_datadir}/doc
%if %{with_systemd}
%pre -n knockd
%service_add_pre %{name}d.service
%endif
%post -n knockd
%if %{with_systemd}
%service_add_post %{name}d.service
%else
%fillup_only -n %{name}d
%endif
%preun -n knockd
%if %{with_systemd}
%service_del_preun %{name}d.service
%else
%stop_on_removal %{name}d
%endif
%postun -n knockd
%if %{with_systemd}
%service_del_postun %{name}d.service
%else
%insserv_cleanup
%endif
%files
%defattr(-,root,root)
@ -132,12 +99,7 @@ rm -rf %{buildroot}%{_datadir}/doc
%doc README.md ChangeLog TODO
%license COPYING
%{_sbindir}/%{name}d
%if %{with_systemd}
%{_unitdir}/%{name}d.service
%else
%{_sysconfdir}/init.d/%{name}d
%config %{_fillupdir}/*
%endif
%{_sbindir}/rc%{name}d
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/%{name}d.conf
%{_mandir}/man?/%{name}d.*