1 %define template synflood-defender
2 %include /usr/lib/rpm/macros.php
3 Summary: Template for Cacti - Synflood-Defender
4 Name: cacti-template-%{template}
8 Group: Applications/WWW
9 Source0: http://synflood-defender.net/_media/download/synflooddefender-%{version}-linux.tar.gz
10 # Source0-md5: d744ae65a69edbf893c86e36498be85a
11 Source1: http://synflood-defender.net/_media/download/synflooddefender_cacti_tpls.tar.gz
12 # Source1-md5: f0002aa57955008dc5e51b11c1c3cdc6
14 URL: http://synflood-defender.net/
15 BuildRequires: rpm-php-pearprov >= 4.4.2-11
16 BuildRequires: rpmbuild(macros) >= 1.554
17 Requires: cacti >= 0.8.7e-8
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define cactidir /usr/share/cacti
22 %define resourcedir %{cactidir}/resource
23 %define scriptsdir %{cactidir}/scripts
24 %define _libdir %{_prefix}/lib
25 %define snmpdconfdir /etc/snmp
26 %define snmpdextend synflooddefender
29 Synflood-Defender is an extension for SNMP protocol, which is used for
30 monitoring SYN-queue and protection the host if SYN-flood attack
34 - monitoring SYN-queue
35 - changing TCP kernel parameters "on-the-fly" when threshold is
37 - 2 protection modes: dynamic and force
38 - the ability to specify kernel parameters you want to change
39 - templates for Cacti are available for download
40 - the ability to integrate with any monitoring system which supports
43 %package -n net-snmp-agent-synflood-defender
44 Summary: SNMPd agent to for Synflood Defender
45 Group: Networking/Daemons
50 %description -n net-snmp-agent-synflood-defender
51 SNMPd agent to for Synflood Defender.
54 %setup -qn synflooddefender-%{version}-linux -a1
55 mv synflooddefender_cacti_tpls/*.xml .
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT{%{resourcedir},%{scriptsdir},%{_sysconfdir}/%{template},%{_libdir}}
61 cp -p *.xml $RPM_BUILD_ROOT%{resourcedir}
63 cp -p %{template}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{template}
64 cp -p state $RPM_BUILD_ROOT%{_sysconfdir}/%{template}
65 cp -p %{template}.sh $RPM_BUILD_ROOT%{_libdir}/%{template}
68 %cacti_import_template %{resourcedir}/cacti_data_template_%{template}.xml
69 %cacti_import_template %{resourcedir}/cacti_graph_template_%{template}.xml
72 rm -rf $RPM_BUILD_ROOT
74 %post -n net-snmp-agent-%{template}
75 if ! grep -qF %{snmpdextend} %{snmpdconfdir}/snmpd.local.conf; then
76 echo "extend %{snmpdextend} %{_libdir}/%{template}" >> %{snmpdconfdir}/snmpd.local.conf
78 %service -q snmpd reload
81 %preun -n net-snmp-agent-%{template}
83 if [ -f %{snmpdconfdir}/snmpd.local.conf ]; then
84 %{__sed} -i -e "/extend %{snmpdextend}/d" %{snmpdconfdir}/snmpd.local.conf
85 %service -q snmpd reload
90 %defattr(644,root,root,755)
91 %{resourcedir}/cacti_data_template_%{template}.xml
92 %{resourcedir}/cacti_graph_template_%{template}.xml
94 %files -n net-snmp-agent-%{template}
95 %defattr(644,root,root,755)
96 %dir %{_sysconfdir}/%{template}
97 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{template}/%{template}.conf
98 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{template}/state
99 %attr(755,root,root) %{_libdir}/%{template}