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: 63ffca5735b60bc33c68bc880f0e8042
13 Patch1: %{name}-upgrade_from_086k_fix.patch
14 Patch2: http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch
15 Patch10: %{name}-plugin-%{version}.diff
16 Patch11: %{name}-config.patch
17 Patch12: %{name}-adodb.patch
18 Patch13: %{name}-url_path.patch
19 URL: http://www.cacti.net/
20 BuildRequires: rpm-perlprov
21 Requires: adodb >= 4.67-1.17
23 Requires: net-snmp-utils
32 Requires: webserver(php)
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define webadminroot /usr/share/%{name}
40 Cacti is a complete frondend to rrdtool, it stores all of the
41 nessesary information to create graphs and populate them with data in
44 The frontend is completely PHP driven. Along with being able to
45 maintain Graphs, Data Sources, and Round Robin Archives in a database,
46 cacti handles the data gathering also. There is also SNMP support for
47 those used to creating traffic graphs with MRTG.
49 %description -l pl.UTF-8
50 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
51 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
54 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
55 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
56 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
57 tworzeniu wykresów ruchu przy użyciu MRTG.
71 rm -rf $RPM_BUILD_ROOT
72 install -d $RPM_BUILD_ROOT%{webadminroot}
73 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/cron.d}
74 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
75 cp -aRf * $RPM_BUILD_ROOT%{webadminroot}
76 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
78 # TODO: move this to SOURCES. it's a lot better to backtrack changes
79 # if it's a separate file.
80 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
82 $database_type = 'mysql';
83 $database_default = 'cacti';
84 $database_hostname = 'localhost';
85 $database_username = 'cactiuser';
86 $database_password = 'cactiuser';
89 // $plugins[] = 'thold';
90 // $plugins[] = 'monitor';
91 // $plugins[] = 'discovery';
93 /* Do not edit this line */
96 /* This is full URL Path to the Cacti installation
97 For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
98 as the url path. For just http://server/ use '/'
100 $config['url_path'] = '/cacti/';
105 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
106 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
108 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
109 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
110 ln -sf %{_datadir}/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
112 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
113 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
117 rm -rf $RPM_BUILD_ROOT
120 %defattr(644,root,root,755)
121 %doc docs/CHANGELOG docs/CONTRIB docs/README
122 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
123 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
124 %attr(770,root,http) %dir /var/log/%{name}
125 %attr(660,root,http) %ghost /var/log/%{name}/*.log
126 %attr(750,root,http) %dir /var/lib/%{name}
127 %attr(770,root,http) %dir /var/lib/%{name}/rra
128 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}