]> git.pld-linux.org Git - packages/cacti-template-synflood-defender.git/blame - cacti-template-synflood-defender.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/cacti-template-synflood-defender.git] / cacti-template-synflood-defender.spec
CommitLineData
3be96913 1%define template synflood-defender
3be96913
ER
2Summary: Template for Cacti - Synflood-Defender
3Name: cacti-template-%{template}
4Version: 0.1.0
5Release: 1
6License: GPL v2
7Group: Applications/WWW
8Source0: http://synflood-defender.net/_media/download/synflooddefender-%{version}-linux.tar.gz
9# Source0-md5: d744ae65a69edbf893c86e36498be85a
10Source1: http://synflood-defender.net/_media/download/synflooddefender_cacti_tpls.tar.gz
11# Source1-md5: f0002aa57955008dc5e51b11c1c3cdc6
8f0159ad 12Patch0: iproute.patch
3be96913
ER
13URL: http://synflood-defender.net/
14BuildRequires: rpm-php-pearprov >= 4.4.2-11
15BuildRequires: rpmbuild(macros) >= 1.554
16Requires: cacti >= 0.8.7e-8
17BuildArch: noarch
18BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19
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
26
27%description
28Synflood-Defender is an extension for SNMP protocol, which is used for
29monitoring SYN-queue and protection the host if SYN-flood attack
30happens.
31
32Features:
33- monitoring SYN-queue
34- changing TCP kernel parameters "on-the-fly" when threshold is
35 reached
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
40 SNMP
41
42%package -n net-snmp-agent-synflood-defender
43Summary: SNMPd agent to for Synflood Defender
44Group: Networking/Daemons
45Requires: net-snmp
8f0159ad
ER
46# for ss
47Requires: iproute2
3be96913
ER
48
49%description -n net-snmp-agent-synflood-defender
50SNMPd agent to for Synflood Defender.
51
52%prep
53%setup -qn synflooddefender-%{version}-linux -a1
54mv synflooddefender_cacti_tpls/*.xml .
8f0159ad 55%patch0 -p1
3be96913
ER
56
57%install
58rm -rf $RPM_BUILD_ROOT
59install -d $RPM_BUILD_ROOT{%{resourcedir},%{scriptsdir},%{_sysconfdir}/%{template},%{_libdir}}
60cp -p *.xml $RPM_BUILD_ROOT%{resourcedir}
61
62cp -p %{template}.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{template}
63cp -p state $RPM_BUILD_ROOT%{_sysconfdir}/%{template}
64cp -p %{template}.sh $RPM_BUILD_ROOT%{_libdir}/%{template}
65
66%post
67%cacti_import_template %{resourcedir}/cacti_data_template_%{template}.xml
68%cacti_import_template %{resourcedir}/cacti_graph_template_%{template}.xml
69
70%clean
71rm -rf $RPM_BUILD_ROOT
72
73%post -n net-snmp-agent-%{template}
74if ! grep -qF %{snmpdextend} %{snmpdconfdir}/snmpd.local.conf; then
75 echo "extend %{snmpdextend} %{_libdir}/%{template}" >> %{snmpdconfdir}/snmpd.local.conf
76
77 %service -q snmpd reload
78fi
79
80%preun -n net-snmp-agent-%{template}
81if [ "$1" = 0 ]; then
82 if [ -f %{snmpdconfdir}/snmpd.local.conf ]; then
83 %{__sed} -i -e "/extend %{snmpdextend}/d" %{snmpdconfdir}/snmpd.local.conf
84 %service -q snmpd reload
85 fi
86fi
87
88%files
89%defattr(644,root,root,755)
90%{resourcedir}/cacti_data_template_%{template}.xml
91%{resourcedir}/cacti_graph_template_%{template}.xml
92
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}
This page took 0.097307 seconds and 4 git commands to generate.