Mercurial > syslog2iptables
annotate syslog2iptables.spec.in @ 71:79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 09 Feb 2017 12:44:31 -0800 |
parents | 0e736950a117 |
children | 4685767c0c85 |
rev | line source |
---|---|
11 | 1 %define localstatedir /var/lib |
2 | |
10 | 3 Summary: Syslog to iptables dynamic firewall |
4 Name: @PACKAGE@ | |
5 Version: @VERSION@ | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
6 Release: 1%{?dist} |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
7 License: GPLv3+ |
10 | 8 Group: System Environment/Daemons |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
9 Source: http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
10 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
11 URL: http://www.five-ten-sg.com/%{name}/ |
18 | 12 |
13 Requires(post,preun): /sbin/chkconfig | |
14 Requires(post,preun): /sbin/service | |
10 | 15 Requires: iptables |
16 Requires: coreutils | |
17 BuildRequires: gcc gcc-c++ | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
18 %if "%{?dist}" == ".el7" |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
19 Requires(pre): systemd-sysv, shadow-utils |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
20 Requires(post): systemd-units |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
21 Requires(preun): systemd-units |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
22 Requires(postun): systemd-units |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
23 Requires: coreutils |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
24 Requires: systemd-units |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
25 BuildRequires: systemd-units |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
26 %endif |
10 | 27 |
28 | |
29 %description | |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
30 This is a simple adaptive firewall. It maintains the INPUT chain |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
31 of the iptables firewall set based on syslog entries. |
10 | 32 |
33 %prep | |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
34 %setup -q |
10 | 35 |
36 %build | |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
37 %configure |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
38 make %{?_smp_mflags} |
10 | 39 |
40 %install | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
41 rm -rf %{buildroot} |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
42 make DESTDIR=%{buildroot} install |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
43 %if "%{?dist}" == ".el7" |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
44 install -m 644 -D %{buildroot}%{_sysconfdir}/%{name}.service \ |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
45 %{buildroot}%{_unitdir}/%{name}.service |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
46 %else |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
47 install -m 755 -D %{buildroot}%{_sysconfdir}/%{name} \ |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
48 %{buildroot}%{_initrddir}/%{name} |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
49 %endif |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
50 rm -f %{buildroot}%{_sysconfdir}/%{name} |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
51 rm -f %{buildroot}%{_sysconfdir}/%{name}.service |
10 | 52 |
53 | |
54 %clean | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
55 rm -rf %{buildroot} |
10 | 56 |
57 | |
58 %pre | |
59 | |
60 | |
61 %post | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
62 if [ $1 = 1 ]; then |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
63 # initial install |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
64 %if "%{?dist}" == ".el7" |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
65 /bin/systemctl daemon-reload &>/dev/null || : |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
66 %else |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
67 /sbin/chkconfig --add %{name} |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
68 %endif |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
69 (cd %{_sysconfdir}; ./%{name}.conf.make) |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
70 fi |
10 | 71 |
72 %preun | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
73 if [ $1 = 0 ]; then |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
74 # package removal, not upgrade |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
75 %if "%{?dist}" == ".el7" |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
76 /bin/systemctl --no-reload disable %{name}.service &>/dev/null || : |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
77 /bin/systemctl stop %{name}.service &>/dev/null || : |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
78 %else |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
79 /sbin/service %{name} stop || : |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
80 /sbin/chkconfig --del %{name} |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
81 %endif |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
82 fi |
10 | 83 |
84 | |
85 %postun | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
86 if [ $1 -ge 1 ]; then |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
87 # package upgrade, not uninstall |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
88 %if "%{?dist}" == ".el7" |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
89 /bin/systemctl try-restart %{name}.service &>/dev/null || : |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
90 %else |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
91 /sbin/service %{name} restart || : |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
92 %endif |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
93 fi |
10 | 94 |
95 | |
96 %files | |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
97 %defattr(-,root,root,-) |
10 | 98 %{_sbindir}/* |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
99 %{_mandir}/man1/* |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
100 %{_mandir}/man5/* |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
101 %docdir %{_datadir}/doc/%{name}-%{version} |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
102 %{_datadir}/doc/%{name}-%{version} |
61
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
103 %config(noreplace) %{_sysconfdir}/%{name}.conf.top |
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
104 %config(noreplace) %{_sysconfdir}/%{name}.conf.httpd |
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
105 %config(noreplace) %{_sysconfdir}/%{name}.conf.bottom |
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
106 %attr(750,root,root) %{_sysconfdir}/%{name}.conf.make |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
107 %if "%{?dist}" == ".el7" |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
108 %{_unitdir}/%{name}.service |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
109 %else |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
110 %{_initrddir}/%{name} |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
111 %endif |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
112 |
10 | 113 |
114 %changelog | |
71
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
115 * Thu Feb 09 2017 Carl Byington <carl@five-ten-sg.com> - 1.17-1 |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
116 - RHEL7 systemd and /var/run is on tmpfs |
79f310d1bc46
RHEL7 systemd and /var/run on tmpfs
Carl Byington <carl@five-ten-sg.com>
parents:
69
diff
changeset
|
117 |
69
0e736950a117
fix post uninstall script; allow config bucket count zero to disable a pattern
Carl Byington <carl@five-ten-sg.com>
parents:
67
diff
changeset
|
118 * Mon Dec 21 2015 Carl Byington <carl@five-ten-sg.com> - 1.16-3 |
0e736950a117
fix post uninstall script; allow config bucket count zero to disable a pattern
Carl Byington <carl@five-ten-sg.com>
parents:
67
diff
changeset
|
119 - fix post uninstall script |
0e736950a117
fix post uninstall script; allow config bucket count zero to disable a pattern
Carl Byington <carl@five-ten-sg.com>
parents:
67
diff
changeset
|
120 - allow config bucket count zero to disable a pattern |
0e736950a117
fix post uninstall script; allow config bucket count zero to disable a pattern
Carl Byington <carl@five-ten-sg.com>
parents:
67
diff
changeset
|
121 |
67 | 122 * Sat Dec 19 2015 Carl Byington <carl@five-ten-sg.com> - 1.16-2 |
123 - fix default config regular expressions | |
124 | |
63
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
61
diff
changeset
|
125 * Sat Dec 19 2015 Carl Byington <carl@five-ten-sg.com> - 1.16-1 |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
61
diff
changeset
|
126 - good authentication prevents ip blocking for awhile |
60f59936fabb
good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents:
61
diff
changeset
|
127 |
61
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
128 * Thu Oct 02 2014 Carl Byington <carl@five-ten-sg.com> - 1.15-1 |
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
129 - add script to build syslog2iptables.conf |
d80641be405b
add script to build syslog2iptables.conf
Carl Byington <carl@five-ten-sg.com>
parents:
58
diff
changeset
|
130 |
58
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
56
diff
changeset
|
131 * Tue Jun 10 2014 Carl Byington <carl@five-ten-sg.com> - 1.14-1 |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
56
diff
changeset
|
132 - Add exponential increase in penalty for repeat offenders. |
b45dddebe8fc
Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents:
56
diff
changeset
|
133 |
56
73dd2daeaf8e
switch to auto requires
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
134 * Wed Aug 17 2011 Carl Byington <carl@five-ten-sg.com> - 1.13-2 |
73dd2daeaf8e
switch to auto requires
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
135 - switch to auto requires |
73dd2daeaf8e
switch to auto requires
Carl Byington <carl@five-ten-sg.com>
parents:
53
diff
changeset
|
136 |
53
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
51
diff
changeset
|
137 * Sun Jan 25 2009 Carl Byington <carl@five-ten-sg.com> - 1.13-1 |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
51
diff
changeset
|
138 - Document multiple contexts. |
d6fb7fca0394
Document multiple contexts
Carl Byington <carl@five-ten-sg.com>
parents:
51
diff
changeset
|
139 |
51
206448c00b55
Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
140 * Sat Jan 24 2009 Carl Byington <carl@five-ten-sg.com> - 1.12-1 |
206448c00b55
Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
141 - Allow multiple contexts with independent add/remove commands. |
206448c00b55
Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
142 |
48
ba0259c9e411
Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
143 * Thu May 29 2008 Carl Byington <carl@five-ten-sg.com> - 1.11-1 |
ba0259c9e411
Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
144 - Fix to compile on Fedora 9 and for const correctness. |
ba0259c9e411
Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
145 |
ba0259c9e411
Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
146 * Sat Mar 22 2008 Carl Byington <carl@five-ten-sg.com> - 1.10 |
ba0259c9e411
Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
147 - Fix to compile on Solaris. |
ba0259c9e411
Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents:
42
diff
changeset
|
148 |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
149 * Fri Mar 21 2008 Carl Byington <carl@five-ten-sg.com> - 1.9 |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
150 - changes for Fedora packaging guidelines |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
151 |
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
152 * Thu Aug 30 2007 Carl Byington <carl@five-ten-sg.com> - 1.5 |
31 | 153 - Fix pre/post scripts |
154 | |
42
d9ae11033b4b
Add default config to firewall systems that send bounces to non-existant accounts.
Carl Byington <carl@five-ten-sg.com>
parents:
33
diff
changeset
|
155 * Thu Dec 08 2005 Carl Byington <carl@five-ten-sg.com> - 1.0 |
10 | 156 - initial revision based on dnsbl spec file |
157 - and http://www.fedora.us/docs/rpm-packaging-guidelines.html |