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.UTF-8): Cacti - frontend w PHP do rrdtoola
10 Group: Applications/WWW
11 Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
12 # Source0-md5: 29436be46b289d13dfce48e7618129e2
13 Patch10: %{name}-plugin-%{version}.diff
14 Patch11: %{name}-config.patch
15 URL: http://www.cacti.net/
16 BuildRequires: rpm-perlprov
17 Requires: adodb >= 4.67-1.17
19 Requires: net-snmp-utils
28 Requires: webserver(php)
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define webadminroot /usr/share/%{name}
35 Cacti is a complete frondend to rrdtool, it stores all of the
36 nessesary information to create graphs and populate them with data in
39 The frontend is completely PHP driven. Along with being able to
40 maintain Graphs, Data Sources, and Round Robin Archives in a database,
41 cacti handles the data gathering also. There is also SNMP support for
42 those used to creating traffic graphs with MRTG.
44 %description -l pl.UTF-8
45 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
46 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
49 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
50 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
51 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
52 tworzeniu wykresów ruchu przy użyciu MRTG.
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT%{webadminroot}
64 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{%{name},cron.d}
65 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
66 cp -aRf * $RPM_BUILD_ROOT%{webadminroot}
67 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
69 # TODO: move this to SOURCES. it's a lot better to backtrack changes
70 # if it's a separate file.
71 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
73 $database_type = 'mysql';
74 $database_default = 'cacti';
75 $database_hostname = 'localhost';
76 $database_username = 'cactiuser';
77 $database_password = 'cactiuser';
80 // $plugins[] = 'thold';
81 // $plugins[] = 'monitor';
82 // $plugins[] = 'discovery';
84 /* Do not edit this line */
87 /* This is full URL Path to the Cacti installation
88 For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
89 as the url path. For just http://server/ use '/'
91 $config['url_path'] = '/cacti/';
96 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
97 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
99 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
100 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
101 ln -sf /usr/share/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
103 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
104 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
108 rm -rf $RPM_BUILD_ROOT
111 %defattr(644,root,root,755)
112 %doc docs/CHANGELOG docs/CONTRIB docs/README
113 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
114 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
115 %attr(770,root,http) %dir /var/log/%{name}
116 %attr(660,root,http) %ghost /var/log/%{name}/*.log
117 %attr(750,root,http) %dir /var/lib/%{name}
118 %attr(770,root,http) %dir /var/lib/%{name}/rra
119 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}