Mercurial > syslog2iptables
comparison syslog2iptables.spec.in @ 77:c6ba792f1a9a
systemd only
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 15 Jul 2020 13:58:42 -0700 |
parents | c6c8a2102a3e |
children | cc01f2caff37 |
comparison
equal
deleted
inserted
replaced
76:c6c8a2102a3e | 77:c6ba792f1a9a |
---|---|
8 Group: System Environment/Daemons | 8 Group: System Environment/Daemons |
9 Source: http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz | 9 Source: http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz |
10 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) | 10 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
11 URL: http://www.five-ten-sg.com/%{name}/ | 11 URL: http://www.five-ten-sg.com/%{name}/ |
12 | 12 |
13 Requires(post,preun): /sbin/chkconfig | |
14 Requires(post,preun): /sbin/service | |
15 Requires: iptables, coreutils | 13 Requires: iptables, coreutils |
16 BuildRequires: gcc gcc-c++ | 14 BuildRequires: gcc gcc-c++ |
17 %if "%{?dist}" == ".el7" | 15 Requires(pre): systemd-sysv, shadow-utils |
18 Requires(pre): systemd-sysv, shadow-utils | 16 Requires(post): systemd-units |
19 Requires(post): systemd-units | 17 Requires(preun): systemd-units |
20 Requires(preun): systemd-units | 18 Requires(postun): systemd-units |
21 Requires(postun): systemd-units | 19 Requires: rsyslog, systemd-units |
22 Requires: rsyslog, systemd-units | 20 BuildRequires: systemd-units |
23 BuildRequires: systemd-units | |
24 %endif | |
25 | 21 |
26 | 22 |
27 %description | 23 %description |
28 This is a simple adaptive firewall. It maintains the INPUT chain | 24 This is a simple adaptive firewall. It maintains the INPUT chain |
29 of the iptables firewall set based on syslog entries. | 25 of the iptables firewall set based on syslog entries. |
36 make %{?_smp_mflags} | 32 make %{?_smp_mflags} |
37 | 33 |
38 %install | 34 %install |
39 rm -rf %{buildroot} | 35 rm -rf %{buildroot} |
40 make DESTDIR=%{buildroot} install | 36 make DESTDIR=%{buildroot} install |
41 %if "%{?dist}" == ".el7" | 37 install -m 644 -D %{buildroot}%{_sysconfdir}/%{name}.service %{buildroot}%{_unitdir}/%{name}.service |
42 install -m 644 -D %{buildroot}%{_sysconfdir}/%{name}.service \ | |
43 %{buildroot}%{_unitdir}/%{name}.service | |
44 %else | |
45 install -m 755 -D %{buildroot}%{_sysconfdir}/%{name} \ | |
46 %{buildroot}%{_initrddir}/%{name} | |
47 %endif | |
48 rm -f %{buildroot}%{_sysconfdir}/%{name} | 38 rm -f %{buildroot}%{_sysconfdir}/%{name} |
49 rm -f %{buildroot}%{_sysconfdir}/%{name}.service | 39 rm -f %{buildroot}%{_sysconfdir}/%{name}.service |
50 | 40 |
51 | 41 |
52 %clean | 42 %clean |
57 | 47 |
58 | 48 |
59 %post | 49 %post |
60 if [ $1 = 1 ]; then | 50 if [ $1 = 1 ]; then |
61 # initial install | 51 # initial install |
62 %if "%{?dist}" == ".el7" | |
63 /bin/systemctl daemon-reload &>/dev/null || : | 52 /bin/systemctl daemon-reload &>/dev/null || : |
64 %else | |
65 /sbin/chkconfig --add %{name} | |
66 %endif | |
67 (cd %{_sysconfdir}; ./%{name}.conf.make) | 53 (cd %{_sysconfdir}; ./%{name}.conf.make) |
68 fi | 54 fi |
69 | 55 |
70 %preun | 56 %preun |
71 if [ $1 = 0 ]; then | 57 if [ $1 = 0 ]; then |
72 # package removal, not upgrade | 58 # package removal, not upgrade |
73 %if "%{?dist}" == ".el7" | |
74 /bin/systemctl --no-reload disable %{name}.service &>/dev/null || : | 59 /bin/systemctl --no-reload disable %{name}.service &>/dev/null || : |
75 /bin/systemctl stop %{name}.service &>/dev/null || : | 60 /bin/systemctl stop %{name}.service &>/dev/null || : |
76 %else | |
77 /sbin/service %{name} stop || : | |
78 /sbin/chkconfig --del %{name} | |
79 %endif | |
80 fi | 61 fi |
81 | 62 |
82 | 63 |
83 %postun | 64 %postun |
84 if [ $1 -ge 1 ]; then | 65 if [ $1 -ge 1 ]; then |
85 # package upgrade, not uninstall | 66 # package upgrade, not uninstall |
86 (cd %{_sysconfdir}; ./%{name}.conf.make) | 67 (cd %{_sysconfdir}; ./%{name}.conf.make) |
87 %if "%{?dist}" == ".el7" | |
88 /bin/systemctl try-restart %{name}.service &>/dev/null || : | 68 /bin/systemctl try-restart %{name}.service &>/dev/null || : |
89 %else | |
90 /sbin/service %{name} restart || : | |
91 %endif | |
92 fi | 69 fi |
93 | 70 |
94 | 71 |
95 %files | 72 %files |
96 %defattr(-,root,root,-) | 73 %defattr(-,root,root,-) |
101 %{_datadir}/doc/%{name}-%{version} | 78 %{_datadir}/doc/%{name}-%{version} |
102 %config(noreplace) %{_sysconfdir}/%{name}.conf.top | 79 %config(noreplace) %{_sysconfdir}/%{name}.conf.top |
103 %config(noreplace) %{_sysconfdir}/%{name}.conf.httpd | 80 %config(noreplace) %{_sysconfdir}/%{name}.conf.httpd |
104 %config(noreplace) %{_sysconfdir}/%{name}.conf.bottom | 81 %config(noreplace) %{_sysconfdir}/%{name}.conf.bottom |
105 %attr(750,root,root) %{_sysconfdir}/%{name}.conf.make | 82 %attr(750,root,root) %{_sysconfdir}/%{name}.conf.make |
106 %if "%{?dist}" == ".el7" | |
107 %{_unitdir}/%{name}.service | 83 %{_unitdir}/%{name}.service |
108 %else | |
109 %{_initrddir}/%{name} | |
110 %endif | |
111 | 84 |
112 | 85 |
113 %changelog | 86 %changelog |
114 * Wed Jul 15 2020 Carl Byington <carl@five-ten-sg.com> - 1.18-1 | 87 * Wed Jul 15 2020 Carl Byington <carl@five-ten-sg.com> - 1.18-1 |
115 - add more logging when blocked addresses move to higher scale values | 88 - add more logging when blocked addresses move to higher scale values |