2 %define _bindir /usr/bin
3 %define _sbindir /usr/sbin
4 %define _includedir /usr/include
6 %define _libdir /usr/lib64
8 %define _libdir /usr/lib
10 %define _sysconfdir /etc
11 %define _localstatedir /var
12 %define _infodir /usr/share/info
13 %define _mandir /usr/share/man
17 # Uncomment this when the version becomes 2.0.0 (without the rcX).
20 Summary: Firewall Knock Operator client. An implementation of Single Packet Authorization.
22 Group: Applications/Internet
24 URL: http://www.cipherdyne.org/fwknop/
25 Source0: fwknop-%{version}.tar.gz
26 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
28 BuildRequires: gpg, gpgme-devel, libpcap-devel, gdbm-devel
35 Summary: The fwknop library
36 Group: Development/Libraries
39 %package -n libfko-devel
41 Summary: The fwknop library header and API docs
42 Group: Development/Libraries
46 Summary: The Firewall Knock Operator server. An implementation of Single Packet Authorization.
47 Group: System Environment/Daemons
48 Requires: libfko, libpcap, gdbm, iptables
52 Fwknop implements an authorization scheme known as Single Packet Authorization
53 (SPA) for Linux systems running iptables. This mechanism requires only a
54 single encrypted and non-replayed packet to communicate various pieces of
55 information including desired access through an iptables policy. The main
56 application of this program is to use iptables in a default-drop stance to
57 protect services such as SSH with an additional layer of security in order
58 to make the exploitation of vulnerabilities (both 0-day and unpatched code)
61 %description -n libfko
62 The Firewall Knock Operator library, libfko, provides the Single Packet
63 Authorization implementation and API for the other fwknop components.
65 %description -n libfko-devel
66 This is the libfko development header and API documentation.
69 The Firewall Knock Operator server component for the FireWall Knock Operator,
70 and is responsible for monitoring Single Packet Authorization (SPA) packets
71 that are generated by fwknop clients, modifying a firewall or acl policy to
72 allow the desired access after decrypting a valid SPA packet, and removing
73 access after a configurable timeout.
82 --sysconfdir=%{_sysconfdir} \
83 --localstatedir=%{_localstatedir} \
90 rm -rf $RPM_BUILD_ROOT
91 make install DESTDIR=$RPM_BUILD_ROOT
92 install -D ./extras/fwknop.init.redhat ${RPM_BUILD_ROOT}/etc/rc.d/init.d/fwknopd
94 [ -d "${RPM_BUILD_ROOT}/usr/share/info" ] \
95 || mkdir -p ${RPM_BUILD_ROOT}/usr/share/info
96 [ -f "${RPM_BUILD_ROOT}/usr/share/info/dir" ] \
97 || touch ${RPM_BUILD_ROOT}/usr/share/info/dir
100 rm -rf $RPM_BUILD_ROOT
102 %post -n libfko-devel
104 /sbin/install-info %{_infodir}/libfko.info* %{_infodir}/dir
106 %post -n fwknop-server
107 /sbin/chkconfig --add fwknopd
108 /sbin/chkconfig fwknopd off
110 %preun -n fwknop-server
111 /sbin/chkconfig --del fwknopd
113 %preun -n libfko-devel
114 if [ "$1" = 0 ]; then
115 /sbin/install-info --delete %{_infodir}/libfko.info* %{_infodir}/dir
122 %defattr(-,root,root,-)
123 %attr(0755,root,root) %{_bindir}/fwknop
124 %attr(0644,root,root) %{_mandir}/man8/fwknop.8*
125 %exclude %{_infodir}/dir
128 %defattr(-,root,root,-)
129 %attr(0644,root,root) %{_libdir}/libfko.*
131 %files -n libfko-devel
132 %defattr(-,root,root,-)
133 %attr(0644,root,root) %{_includedir}/fko.h
134 %attr(0644,root,root) %{_infodir}/libfko.info*
137 %defattr(-,root,root,-)
138 %attr(0755,root,root) %{_sbindir}/fwknopd
139 %attr(0755,root,root) /etc/rc.d/init.d/fwknopd
140 %attr(0644,root,root) %{_mandir}/man8/fwknopd.8*
141 %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/fwknop/fwknopd.conf
142 %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/fwknop/access.conf
145 * Thu Jul 15 2010 Damien Stuart <dstuart@dstuart.org>
146 - Fixed some misplaced depenencies (moved gpgpme from server to libfko).
148 * Wed Jul 7 2010 Damien Stuart <dstuart@dstuart.org>
149 - Made the post and preun steps specific to libfko-devel.
151 * Tue Jul 6 2010 Damien Stuart <dstuart@dstuart.org>
152 - Initial RPMification.