2 # - patch source to use adodb system path instead of symlinking
3 # - shouldn't files in scripts dir be executable?
4 %include /usr/lib/rpm/macros.perl
5 Summary: Cacti is a PHP frontend for rrdtool
6 Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
11 Group: Applications/WWW
12 Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
13 # Source0-md5: 63ffca5735b60bc33c68bc880f0e8042
14 Source1: %{name}.cfg.php
15 Patch1: %{name}-upgrade_from_086k_fix.patch
16 Patch2: http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch
17 Patch10: %{name}-plugin-%{version}.diff
18 Patch11: %{name}-config.patch
19 Patch12: %{name}-adodb.patch
20 Patch13: %{name}-url_path.patch
21 URL: http://www.cacti.net/
22 BuildRequires: rpm-perlprov
23 Requires(postun): /usr/sbin/userdel
24 Requires(pre): /bin/id
25 Requires(pre): /usr/sbin/useradd
26 Requires: adodb >= 4.67-1.17
29 Requires: net-snmp-utils
38 Requires: webserver(php)
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 %define webadminroot /usr/share/%{name}
47 Cacti is a complete frondend to rrdtool, it stores all of the
48 nessesary information to create graphs and populate them with data in
51 The frontend is completely PHP driven. Along with being able to
52 maintain Graphs, Data Sources, and Round Robin Archives in a database,
53 cacti handles the data gathering also. There is also SNMP support for
54 those used to creating traffic graphs with MRTG.
56 %description -l pl.UTF-8
57 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
58 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
61 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
62 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
63 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
64 tworzeniu wykresów ruchu przy użyciu MRTG.
77 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT%{webadminroot}
82 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/cron.d}
83 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
84 cp -a * $RPM_BUILD_ROOT%{webadminroot}
86 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
88 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
90 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
91 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
93 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
94 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
95 ln -sf %{_datadir}/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
97 # TODO: switch to user cacti here
98 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
99 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
103 rm -rf $RPM_BUILD_ROOT
106 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
109 if [ "$1" = "0" ]; then
114 %defattr(644,root,root,755)
115 %doc docs/CHANGELOG docs/CONTRIB docs/README
116 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
117 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
118 %attr(770,root,http) %dir /var/log/%{name}
119 %attr(660,root,http) %ghost /var/log/%{name}/*.log
120 %attr(750,root,http) %dir /var/lib/%{name}
121 %attr(770,root,http) %dir /var/lib/%{name}/rra
122 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}