]> git.pld-linux.org Git - packages/cacti-template-synflood-defender.git/blob - 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
1 %define         template synflood-defender
2 %include        /usr/lib/rpm/macros.php
3 Summary:        Template for Cacti - Synflood-Defender
4 Name:           cacti-template-%{template}
5 Version:        0.1.0
6 Release:        1
7 License:        GPL v2
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
13 Patch0:         iproute.patch
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
18 BuildArch:      noarch
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
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
27
28 %description
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
31 happens.
32
33 Features:
34 - monitoring SYN-queue
35 - changing TCP kernel parameters "on-the-fly" when threshold is
36   reached
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
41   SNMP
42
43 %package -n net-snmp-agent-synflood-defender
44 Summary:        SNMPd agent to for Synflood Defender
45 Group:          Networking/Daemons
46 Requires:       net-snmp
47 # for ss
48 Requires:       iproute2
49
50 %description -n net-snmp-agent-synflood-defender
51 SNMPd agent to for Synflood Defender.
52
53 %prep
54 %setup -qn synflooddefender-%{version}-linux -a1
55 mv synflooddefender_cacti_tpls/*.xml .
56 %patch0 -p1
57
58 %install
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}
62
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}
66
67 %post
68 %cacti_import_template %{resourcedir}/cacti_data_template_%{template}.xml
69 %cacti_import_template %{resourcedir}/cacti_graph_template_%{template}.xml
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
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
77
78         %service -q snmpd reload
79 fi
80
81 %preun -n net-snmp-agent-%{template}
82 if [ "$1" = 0 ]; then
83         if [ -f %{snmpdconfdir}/snmpd.local.conf ]; then
84                 %{__sed} -i -e "/extend %{snmpdextend}/d" %{snmpdconfdir}/snmpd.local.conf
85                 %service -q snmpd reload
86         fi
87 fi
88
89 %files
90 %defattr(644,root,root,755)
91 %{resourcedir}/cacti_data_template_%{template}.xml
92 %{resourcedir}/cacti_graph_template_%{template}.xml
93
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}
This page took 0.092916 seconds and 3 git commands to generate.