2 # - patch source to use adodb system path instead of symlinking
3 %include /usr/lib/rpm/macros.perl
4 Summary: Cacti is a PHP frontend for rrdtool
5 Summary(pl): Cacti - frontend w PHP do rrdtoola
10 Group: Applications/WWW
11 Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
12 # Source0-md5: 341b5828d95db91f81f5fbba65411d63
13 Patch1: http://www.cacti.net/downloads/patches/0.8.6i/dec06-vulnerability-poller-0.8.6i.patch
14 Patch2: http://www.cacti.net/downloads/patches/0.8.6i/dec06-vulnerability-scripts-0.8.6i.patch
15 Patch3: http://www.cacti.net/downloads/patches/0.8.6i/import_template_argument_space_removal.patch
16 Patch10: %{name}-plugin-%{version}.diff
17 Patch11: %{name}-config.patch
18 URL: http://www.cacti.net/
19 BuildRequires: rpm-perlprov
20 Requires: adodb >= 4.67-1.17
22 Requires: net-snmp-utils
31 Requires: webserver(php)
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 %define webadminroot /usr/share/%{name}
38 Cacti is a complete frondend to rrdtool, it stores all of the
39 nessesary information to create graphs and populate them with data in
42 The frontend is completely PHP driven. Along with being able to
43 maintain Graphs, Data Sources, and Round Robin Archives in a database,
44 cacti handles the data gathering also. There is also SNMP support for
45 those used to creating traffic graphs with MRTG.
48 Cacti to pe³ny frontend do rrdtoola, zapamiêtuj±cy wszystkie
49 informacje potrzebne do tworzenia wykresów i wype³niaj±ce je danymi w
52 Frontend jest w pe³ni oparty na PHP. Oprócz zarz±dzania wykresami,
53 ¼ród³ami danych, archiwami Round Robin w bazie danych, cacti obs³uguje
54 tak¿e gromadzenie danych. Ma tak¿e obs³ugê SNMP przydatn± przy
55 tworzeniu wykresów ruchu przy u¿yciu MRTG.
68 rm -rf $RPM_BUILD_ROOT
69 install -d $RPM_BUILD_ROOT%{webadminroot}
70 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{%{name},cron.d}
71 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
72 cp -aRf * $RPM_BUILD_ROOT%{webadminroot}
73 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
75 # TODO: move this to SOURCES. it's a lot better to backtrack changes
76 # if it's a separate file.
77 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
79 $database_type = 'mysql';
80 $database_default = 'cacti';
81 $database_hostname = 'localhost';
82 $database_username = 'cactiuser';
83 $database_password = 'cactiuser';
86 // $plugins[] = 'thold';
87 // $plugins[] = 'monitor';
88 // $plugins[] = 'discovery';
90 /* Do not edit this line */
93 /* This is full URL Path to the Cacti installation
94 For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
95 as the url path. For just http://server/ use '/'
97 $config['url_path'] = '/cacti/';
102 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
103 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
105 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
106 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
107 ln -sf /usr/share/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
109 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
110 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
114 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
118 %doc docs/CHANGELOG docs/CONTRIB docs/README
119 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
120 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
121 %attr(770,root,http) %dir /var/log/%{name}
122 %attr(660,root,http) %ghost /var/log/%{name}/*.log
123 %attr(750,root,http) %dir /var/lib/%{name}
124 %attr(770,root,http) %dir /var/lib/%{name}/rra
125 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}