2 # - Edit the MySQL options on line 143 of /cacti/plugins/npc/neb/inserter.c
4 %include /usr/lib/rpm/macros.perl
5 Summary: Plugin for Cacti - NPC
6 Summary(pl.UTF-8): Wtyczka do Cacti - NPC
11 Group: Applications/WWW
12 Source0: http://forums.cacti.net/files/%{plugin}-%{version}.tar.gz
13 # Source0-md5: 325f2e49070420346b55b7b4e2994d34
14 Patch0: %{name}-path_headers.patch
15 # inserter.c patch for nagios 3.0b6 from http://forums.cacti.net/about10327-0-asc-150.html
16 #Patch1: http://forums.cacti.net/files/neb_159.patch
17 # from http://forums.cacti.net/about10327-0-asc-135.html
18 Patch1: %{name}-extinfo.patch
19 URL: http://forums.cacti.net/about10327.html
20 BuildRequires: glib2-devel
21 BuildRequires: mysql-devel >= 4.1.0
22 BuildRequires: nagios-devel >= 2.1
23 BuildRequires: pkgconfig
24 BuildRequires: rpm-perlprov
25 Requires: cacti >= 0.8.6h
26 Requires: nagios >= 2.1
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define cactidir /usr/share/cacti
30 %define plugindir %{cactidir}/plugins/%{plugin}
31 %define moduledir %{_libdir}/nagios/modules
34 Plugin for Cacti - A UI replacement for Nagios integrated into Cacti.
36 %description -l pl.UTF-8
37 Wtyczka do Cacti - zamiennik interfejsu użytkownika dla Nagiosa
41 %setup -q -n %{plugin}
47 %{__cc} %{rpmcflags} -Wall -o inserter.o inserter.c -shared -I../include $(pkg-config glib-2.0 --cflags) $(mysql_config --cflags --libs) -fPIC
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT{%{plugindir},%{moduledir}}
52 install neb/inserter.o $RPM_BUILD_ROOT%{moduledir}
53 cp -a . $RPM_BUILD_ROOT%{plugindir}
54 rm -rf $RPM_BUILD_ROOT%{plugindir}/neb
56 # Edit nagios.cfg and set:
58 # retain_state_information=0
59 # event_broker_options=-1
60 # broker_module=%{moduledir}/inserter.o
62 # Setting retain_state_information=0 causes all hosts and services to
63 # go to a pending state until rechecked by Nagios. Without this setting
64 # the inserter module will never update any data in NPC. Its a minor
65 # inconvenience that I will try to fix in the inserter module.
68 rm -rf $RPM_BUILD_ROOT
71 %defattr(644,root,root,755)
74 %attr(755,root,root) %{moduledir}/inserter.o