Accepting request 347257 from network:utilities

1

OBS-URL: https://build.opensuse.org/request/show/347257
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/knock?expand=0&rev=16
This commit is contained in:
2015-12-09 18:50:31 +00:00
committed by Git OBS Bridge
parent 8b9bab2087
commit d8188c99a4
7 changed files with 109 additions and 71 deletions

View File

@@ -1,10 +0,0 @@
--- src/knockd.c
+++ src/knockd.c
@@ -46,6 +46,7 @@
#include <syslog.h>
#include <pcap.h>
#include <errno.h>
+#include <sys/param.h>
#include "list.h"
static char version[] = "0.5";

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c437db83f30aee3a6bf922c12dceef6d26ab670a63895f74af5f9ecf03832a6
size 73767

3
knock-0.7.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9938479c321066424f74c61f6bee46dfd355a828263dc89561a1ece3f56578a4
size 110791

10
knock-include.patch Normal file
View File

@@ -0,0 +1,10 @@
--- src/knockd.c
+++ src/knockd.c
@@ -41,6 +41,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
+#include <sys/param.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <getopt.h>

View File

@@ -1,3 +1,25 @@
-------------------------------------------------------------------
Tue Dec 1 14:49:38 UTC 2015 - p.drouand@gmail.com
- Update to version 0.7
* Document the 'target' configuration directive.
* Merging OS-specific networking code to reduce LOCs and the
sea of #ifdefs.
* Added 50ms timeout to pcap_open_live() to reduce CPU usage
on network-heavy hosts. Pcap recommends we not use zero.
- Changes from version 0.6
* Cleanup: Don't null-check before free
* Cleanup: Consolidate flag-check logic
* Accept single-knock sequences
* Introduce a 'target' configuration directive, enabling knockd to
react to connect attempts to a target host. Useful in cases where
knockd is on a router and you want to send a target a wakeup packet.
- Add systemd support for openSUSE > 12.1
- Update knock-include.patch > knock-0.5-include.patch
- Remove obsolete AUTHORS section
- Use download Url as source
- Perform a spec-cleaner
-------------------------------------------------------------------
Mon Jun 15 11:53:12 CEST 2009 - aj@suse.de

View File

@@ -1,7 +1,7 @@
#
# spec file for package knock (Version 0.5)
# spec file for package spec
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,23 +15,30 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%if 0%{?suse_version} > 1210
%define with_systemd 1
%else
%define with_systemd 0
%endif
Name: knock
BuildRequires: libpcap-devel
Version: 0.7
Release: 0
Summary: A Port-Knocking Client
Version: 0.5
Release: 139
License: GPL-2.0+
Group: Productivity/Networking/Security
Url: http://www.zeroflux.org/knock/
Source0: %{name}-%{version}.tar.bz2
Source0: http://www.zeroflux.org/proj/knock/files/%{name}-%{version}.tar.gz
Source1: %{name}d.sysconfig
Source2: %{name}d.init
Source3: %{name}d.conf
Patch: %{name}-%{version}.patch
Patch1: %{name}-%{version}-include.patch
Source4: %{name}d.service
Patch0: %{name}-0.5.patch
Patch1: %{name}-include.patch
BuildRequires: libpcap-devel
%if %{with_systemd}
BuildRequires: systemd-rpm-macros
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -44,17 +51,15 @@ destined for a closed port. When the server detects a specific sequence
of port hits, it runs a command defined in its configuration file. This
can be used to open up holes in a firewall for quick access.
Authors:
--------
Judd Vinet <jvinet@zeroflux.org>
%package -n knockd
Summary: A port-knocking server
License: GPL-2.0+
Group: Productivity/Networking/Security
Summary: A port-knocking server
PreReq: %fillup_prereq
%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
@@ -66,70 +71,72 @@ closed port. When the server detects a specific sequence of port-hits,
it runs a command defined in its configuration file. This can be used
to open up holes in a firewall for quick access.
Authors:
--------
Judd Vinet <jvinet@zeroflux.org>
%prep
%setup -q
%patch
%patch0
%patch1
%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%_libdir --mandir=%_mandir
make
%configure
make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install
install -m 644 -D %{S:1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}d
install -m 755 -D %{S:2} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/%{name}d
sed -i -e "s:iptables:%{_sbindir}/iptables:" %{S:3}
install -m 600 -D %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}d.conf
ln -sf ../../etc/init.d/%{name}d $RPM_BUILD_ROOT/usr/sbin/rc%{name}d
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}%{_localstatedir}/adm/fillup-templates/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
%clean
rm -rf $RPM_BUILD_ROOT
%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)
%attr(0755,root,root) %{_bindir}/%{name}
%{_mandir}/man?/%{name}.*
%files -n knockd
%files -n knockd
%defattr(-,root,root)
%doc README COPYING ChangeLog TODO
%_sbindir/%{name}d
%_sbindir/rc%{name}d
%_sysconfdir/init.d/%{name}d
%doc README.md COPYING ChangeLog TODO
%{_sbindir}/%{name}d
%if %{with_systemd}
%{_unitdir}/%{name}d.service
%else
%{_sysconfdir}/init.d/%{name}d
%config %{_localstatedir}/adm/fillup-templates/*
%endif
%{_sbindir}/rc%{name}d
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/%{name}d.conf
%{_mandir}/man?/%{name}d.*
%config /var/adm/fillup-templates/*
%changelog
* Mon Jun 15 2009 aj@suse.de
- Add knock-0.5-include.patch to fix build failure.
* Thu Jul 26 2007 prusnak@suse.cz
- changed libpcap to libpcap-devel in BuildRequires
* Tue Nov 14 2006 mskibbe@suse.de
- fix bug #220355 (iptables call is wrong)
* Wed Oct 04 2006 mskibbe@suse.de
- fix bug in iptables call
* Mon Sep 25 2006 mskibbe@suse.de
- fix iptables call in config
* Fri Sep 22 2006 mskibbe@suse.de
- fix sysconfig file
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Jun 30 2005 hvogel@suse.de
- Initial Package, Version 0.5
%changelog

9
knockd.service Normal file
View File

@@ -0,0 +1,9 @@
[Unit]
Description=Port-Knocking Daemon
After=network.target
[Service]
ExecStart=/usr/sbin/knockd
[Install]
WantedBy=multi-user.target