5 # - update configure not to require tools at build time
6 Summary: Simple and powerful firewall and traffic shaping languages
11 Group: Applications/Networking
12 Source0: https://firehol.org/download/firehol/releases/v%{version}/%{name}-%{version}.tar.xz
13 # Source0-md5: afee409b698ad0707340112ff0e811b2
14 Source1: %{name}.service
15 Source2: fireqos.service
16 URL: https://firehol.org/
17 BuildRequires: hostname
18 BuildRequires: iprange >= 1.0.2
19 BuildRequires: tar >= 1:1.22
22 Requires(post,preun): /sbin/chkconfig
25 Requires: grep >= 2.4.2
28 Requires: iproute2 >= 2.2.4
30 Requires: iptables >= 1.2.4
36 Requires: uname(release) >= 2.4
37 Requires: util-linux >= 2.11
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 %define _libdir %{_prefix}/lib
44 FireHOL is a generic firewall generator, meaning that you can design
45 any kind of local or routing stateful packet filtering firewalls with
46 ease. Install FireHOL if you want an easy way to configure stateful
47 packet filtering firewalls on Linux hosts and routers.
49 FireHOL uses an extremely simple but powerful way to define firewall
50 rules which it turns into complete stateful iptables firewalls.
52 You can run FireHOL with the 'helpme' argument, to get a configuration
53 file for the system run, which you can modify according to your needs.
54 The default configuration file will allow only client traffic on all
61 # grep -E 'AX_NEED_PROG|AX_CHECK_PROG' configure.ac |sort -u|sed -rne 's/.+\(\[([^]]+)\], \[([^]]+)\].+/echo \1=`PATH=$PATH:\/usr\/sbin which \2` \\\\/p'|sh
63 FIREHOL_AUTOSAVE=/etc/sysconfig/iptables \
64 FIREHOL_AUTOSAVE6=/etc/sysconfig/ip6tables \
66 BASH_SHELL_PATH=/bin/bash \
76 DIRNAME=/usr/bin/dirname \
80 FLOCK=/usr/bin/flock \
82 FUNZIP=/usr/bin/funzip \
86 HOSTNAMECMD=/bin/hostname \
87 IP6TABLES=/usr/sbin/ip6tables \
88 IP6TABLES_RESTORE=/usr/sbin/ip6tables-restore \
89 IP6TABLES_SAVE=/usr/sbin/ip6tables-save \
91 IPRANGE=/usr/bin/iprange \
92 IPSET=/usr/sbin/ipset \
93 IPTABLES=/usr/sbin/iptables \
94 IPTABLES_RESTORE=/usr/sbin/iptables-restore \
95 IPTABLES_SAVE=/usr/sbin/iptables-save \
97 LOGGER=/usr/bin/logger \
102 MODPROBE=/sbin/insmod \
103 MODPROBE=/sbin/modprobe \
106 NEATO=/usr/bin/neato \
107 PING6=/usr/bin/ping6 \
109 RENICE=/usr/bin/renice \
112 SCREEN=/usr/bin/screen \
119 SYSCTL=/sbin/sysctl \
123 TCPDUMP=/usr/sbin/tcpdump \
127 TRACEROUTE=/usr/bin/traceroute \
130 UNZIP=/usr/bin/unzip \
133 WHOIS=/usr/bin/whois \
140 rm -rf $RPM_BUILD_ROOT
142 DESTDIR=$RPM_BUILD_ROOT
144 # Hack for documentation without crufts.
145 rm -frv $RPM_BUILD_ROOT%{_docdir}
146 find examples/ -name "Makefile*" -delete -print
148 # Install systemd units.
149 install -d $RPM_BUILD_ROOT%{systemdunitdir}
150 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}
152 # Install runtime directories.
153 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/services
154 install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/firehol
156 # Ghost configurations.
157 touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/firehol.conf \
158 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/fireqos.conf
161 rm -rf $RPM_BUILD_ROOT
164 /sbin/chkconfig --add firehol
165 %service firehol restart
166 %systemd_post firehol.service
167 %systemd_post fireqos.service
170 if [ "$1" = 0 ]; then
171 %service firehol stop
172 /sbin/chkconfig --del firehol
174 %systemd_preun firehol.service
175 %systemd_preun fireqos.service
181 %defattr(644,root,root,755)
182 %doc README THANKS examples
183 %doc doc/firehol/firehol-manual.{pdf,html}
184 %doc doc/fireqos/fireqos-manual.{pdf,html}
185 %dir %{_sysconfdir}/firehol
186 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/firehol.conf
187 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fireqos.conf
188 %{_sysconfdir}/%{name}/*.example
189 %dir %{_sysconfdir}/%{name}/services
190 %{_sysconfdir}/%{name}/services/*.example
191 %attr(755,root,root) %{_sbindir}/firehol
192 %attr(755,root,root) %{_sbindir}/fireqos
193 %attr(755,root,root) %{_sbindir}/link-balancer
194 %attr(755,root,root) %{_sbindir}/update-ipsets
195 %attr(755,root,root) %{_sbindir}/vnetbuild
196 %dir %{_libdir}/firehol
197 %{_libdir}/firehol/functions.common.sh
198 %{_datadir}/update-ipsets
201 %{systemdunitdir}/firehol.service
202 %{systemdunitdir}/fireqos.service
203 %{_localstatedir}/spool/%{name}