]> git.pld-linux.org Git - packages/firehol.git/blob - firehol.spec
41e06f76aa2a416232ed5380a2f50da944a3b582
[packages/firehol.git] / firehol.spec
1 # TODO
2 # - pldize initscript
3 # - unbash initscript
4 # - recheck deps
5 # - update configure not to require tools at build time
6 Summary:        Simple and powerful firewall and traffic shaping languages
7 Name:           firehol
8 Version:        3.0.1
9 Release:        0.1
10 License:        GPL v2+
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:  graphviz
18 BuildRequires:  hostname
19 BuildRequires:  iprange >= 1.0.2
20 BuildRequires:  iproute2
21 BuildRequires:  iptables
22 BuildRequires:  procps
23 BuildRequires:  screen
24 BuildRequires:  systemd-devel
25 BuildRequires:  tar >= 1:1.22
26 BuildRequires:  unzip
27 BuildRequires:  wget
28 BuildRequires:  whois
29 BuildRequires:  xz
30 Requires(post,preun):   /sbin/chkconfig
31 Requires:       coreutils
32 Requires:       gawk >= 3.0
33 Requires:       grep >= 2.4.2
34 Requires:       gzip
35 Requires:       hostname
36 Requires:       iproute2 >= 2.2.4
37 Requires:       ipset
38 Requires:       iptables >= 1.2.4
39 Requires:       kmod
40 Requires:       less
41 Requires:       procps
42 Requires:       rc-scripts
43 Requires:       sed
44 Requires:       uname(release) >= 2.4
45 Requires:       util-linux >= 2.11
46 BuildArch:      noarch
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
50 FireHOL is a generic firewall generator, meaning that you can design
51 any kind of local or routing stateful packet filtering firewalls with
52 ease. Install FireHOL if you want an easy way to configure stateful
53 packet filtering firewalls on Linux hosts and routers.
54
55 FireHOL uses an extremely simple but powerful way to define firewall
56 rules which it turns into complete stateful iptables firewalls.
57
58 You can run FireHOL with the 'helpme' argument, to get a configuration
59 file for the system run, which you can modify according to your needs.
60 The default configuration file will allow only client traffic on all
61 interfaces.
62
63 %prep
64 %setup -q
65
66 %build
67 # grep AX_NEED_PROG configure.ac |sort -u|sed -rne 's/.+\(\[([^]]+)\], \[([^]]+)\].+/echo \1=`which \2` \\\\/p'|sh
68 %configure \
69         BASH_SHELL_PATH=/bin/bash \
70         BRIDGE=/sbin/bridge \
71         CAT=/bin/cat \
72         CHMOD=/bin/chmod \
73         CHOWN=/bin/chown \
74         CP=/bin/cp \
75         CURL=/usr/bin/curl \
76         CUT=/usr/bin/cut \
77         DATE=/bin/date \
78         DIFF=/usr/bin/diff \
79         DIRNAME=/usr/bin/dirname \
80         ENV=/usr/bin/env \
81         EXPR=/usr/bin/expr \
82         FIND=/usr/bin/find \
83         FLOCK=/usr/bin/flock \
84         FOLD=/usr/bin/fold \
85         GAWK=/bin/awk \
86         HEAD=/usr/bin/head \
87         IP=/sbin/ip \
88         IPRANGE=/usr/bin/iprange \
89         IPSET=/usr/sbin/ipset \
90         LN=/bin/ln \
91         LOGGER=/usr/bin/logger \
92         LS=/bin/ls \
93         LSMOD=/sbin/lsmod \
94         MKDIR=/bin/mkdir \
95         MKTEMP=/bin/mktemp \
96         MODPROBE=/sbin/insmod \
97         MORE=/bin/cat \
98         MV=/bin/mv \
99         PING6=/usr/bin/ping6 \
100         PING=/usr/bin/ping \
101         RM=/bin/rm \
102         RMMOD=/sbin/rmmod \
103         SEQ=/usr/bin/seq \
104         SH=/bin/ksh \
105         SLEEP=/bin/sleep \
106         SORT=/bin/sort \
107         SYSCTL=/sbin/sysctl \
108         TAIL=/usr/bin/tail \
109         TAR=/bin/tar \
110         TC=/sbin/tc \
111         TOUCH=/bin/touch \
112         TR=/usr/bin/tr \
113         TRACEROUTE=/usr/bin/traceroute \
114         UNAME=/bin/uname \
115         UNIQ=/usr/bin/uniq \
116         WC=/usr/bin/wc \
117         ZCAT=/usr/bin/gzip \
118         %{nil}
119
120 %{__make}
121
122 %install
123 rm -rf $RPM_BUILD_ROOT
124 %{__make} install \
125         DESTDIR=$RPM_BUILD_ROOT
126
127 # Hack for documentation without crufts.
128 rm -frv $RPM_BUILD_ROOT%{_docdir}
129 find examples/ -name "Makefile*" -delete -print
130
131 # Install systemd units.
132 install -d $RPM_BUILD_ROOT%{systemdunitdir}
133 cp -p %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}
134
135 # Install runtime directories.
136 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/services
137 install -d $RPM_BUILD_ROOT%{_localstatedir}/spool/firehol
138
139 # Ghost configurations.
140 touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/firehol.conf \
141       $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/fireqos.conf
142
143 %clean
144 rm -rf $RPM_BUILD_ROOT
145
146 %post
147 /sbin/chkconfig --add firehol
148 %service firehol restart
149 %systemd_post firehol.service
150 %systemd_post fireqos.service
151
152 %preun
153 if [ "$1" = 0 ]; then
154         %service firehol stop
155         /sbin/chkconfig --del firehol
156 fi
157 %systemd_preun firehol.service
158 %systemd_preun fireqos.service
159
160 %postun
161 %systemd_reload
162
163 %files
164 %defattr(644,root,root,755)
165 %doc README THANKS examples
166 %doc doc/firehol/firehol-manual.{pdf,html}
167 %doc doc/fireqos/fireqos-manual.{pdf,html}
168 %dir %{_sysconfdir}/firehol
169 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/firehol.conf
170 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fireqos.conf
171 %{_sysconfdir}/%{name}/*.example
172 %dir %{_sysconfdir}/%{name}/services
173 %{_sysconfdir}/%{name}/services/*.example
174 %attr(755,root,root) %{_sbindir}/firehol
175 %attr(755,root,root) %{_sbindir}/fireqos
176 %{_mandir}/man1/*.1*
177 %{_mandir}/man5/*.5*
178 %{systemdunitdir}/firehol.service
179 %{systemdunitdir}/fireqos.service
180 %{_localstatedir}/spool/%{name}
This page took 0.116212 seconds and 2 git commands to generate.