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