summaryrefslogtreecommitdiff
path: root/knock/knock.spec
blob: e8f4e33b82f76b552c57d94b32cc9f89570922c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# $Id$
# Authority: dag
# Upstream: Judd Vinet <jvinet$zeroflux,org>


%{!?dtag:%define _with_libpcapdevel 1}
%{?el5:%define _with_libpcapdevel 1}
%{?el6:%define _with_libpcapdevel 1}
%{?fc6:%define _with_libpcapdevel 1}

Summary: Port-knocking server
Name: knock
Version: 0.7
Release: 3%{?dist}
License: GPL
Group: Applications/Internet
URL: http://www.zeroflux.org/knock/

Packager: Dag Wieers <dag@wieers.com>
Vendor: Dag Apt Repository, http://dag.wieers.com/apt/

Source0: http://www.zeroflux.org/knock/files/knock-%{version}.tar.gz
Source1: knockd.service
Source2: knockd.logrotate
%{?el6:Patch0: knock-el6-compilation-error.patch}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: libpcap systemd
%{?_with_libpcapdevel:BuildRequires:libpcap-devel}

%description
knockd is a port-knock server. It listens to all traffic on an ethernet
interface, looking for special "knock" sequences of port-hits. A client
makes these port-hits by sending a TCP (or UDP) packet to a port on the
server. This port need not be open -- since knockd listens at the link-
layer level, it sees all traffic even if it's 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.

%prep
%setup
%{?el6:%patch0 -p1}

%build
%configure
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR="%{buildroot}"
install -m 0755 -d %{buildroot}/%{_unitdir}/
install -m 0644 %{_sourcedir}/knockd.service %{buildroot}/%{_unitdir}/
install -m 0755 -d %{buildroot}/%{_sysconfdir}/logrotate.d
install -m 0644 %{_sourcedir}/knockd.logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/knockd

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-, root, root, 0755)
%doc ChangeLog COPYING TODO
%doc %{_mandir}/man?/*
%config(noreplace) %{_sysconfdir}/knockd.conf
%{_sysconfdir}/logrotate.d/knockd
%{_unitdir}/knockd.service
%{_bindir}/knock
%{_sbindir}/knockd

%post
%systemd_post knockd.service

%preun
%systemd_preun knockd.service

%postun
%systemd_postun_with_restart knockd.service 

%changelog
* Mon Dec 08 2014 Christoph J. Thompson <cjsthompson@gmail.com>
- Updated to release 0.7.
- Add systemd and logrotate support

* Thu Jan 03 2013 Jan Horacek <jahor@jhr.cz> - 0.5-3
- patch for building on EL6

* Fri Dec 16 2011 Jan Horacek <jahor@jhr.cz> - 0.5-2
- EL6 has libpcap-devel

* Tue Sep 26 2006 Dries Verachtert <dries@ulyssis.org> - 0.5-1
- Updated to release 0.5.

* Thu Apr 15 2004 Dag Wieers <dag@wieers.com> - 0.1-1
- Initial package. (using DAR)