1 %include /usr/lib/rpm/macros.perl
2 Summary: Cacti is a PHP frontend for rrdtool
3 Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
8 Group: Applications/WWW
9 Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
10 # Source0-md5: 63ffca5735b60bc33c68bc880f0e8042
11 Source1: %{name}.cfg.php
12 Source2: %{name}.crontab
13 Source3: http://cactiusers.org/downloads/%{name}-plugin-arch.tar.gz
14 # Source3-md5: 7079c1f366e8ea1b26c7e251e6373226
15 Source4: %{name}-apache.conf
16 Source5: %{name}-lighttpd.conf
17 Patch1: %{name}-upgrade_from_086k_fix.patch
18 Patch2: http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch
19 Patch3: http://www.cacti.net/downloads/patches/0.8.7b/reset_each_patch.patch
20 Patch4: %{name}-config.patch
21 Patch5: %{name}-adodb.patch
22 Patch6: %{name}-ioerror.patch
23 Patch7: %{name}-webroot.patch
24 URL: http://www.cacti.net/
25 BuildRequires: rpm-perlprov
26 BuildRequires: sed >= 4.0
27 Requires(postun): /usr/sbin/userdel
28 Requires(pre): /bin/id
29 Requires(pre): /usr/sbin/useradd
30 Requires: adodb >= 4.67-1.17
33 Requires: net-snmp-utils
43 Requires: webserver(php)
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 %define _webapps /etc/webapps
50 %define _webapp %{name}
51 %define _sysconfdir %{_webapps}/%{_webapp}
52 %define _appdir /usr/share/%{name}
55 Cacti is a complete frondend to rrdtool, it stores all of the
56 nessesary information to create graphs and populate them with data in
59 The frontend is completely PHP driven. Along with being able to
60 maintain Graphs, Data Sources, and Round Robin Archives in a database,
61 cacti handles the data gathering also. There is also SNMP support for
62 those used to creating traffic graphs with MRTG.
64 %description -l pl.UTF-8
65 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
66 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
69 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
70 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
71 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
72 tworzeniu wykresów ruchu przy użyciu MRTG.
75 Summary: Cacti setup package
76 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
77 Group: Applications/WWW
78 Requires: %{name} = %{version}-%{release}
79 Suggests: %{name}-doc = %{version}-%{release}
82 Install this package to configure initial Cacti installation. You
83 should uninstall this package when you're done, as it considered
84 insecure to keep the setup files in place.
87 Summary: HTML Documentation for Cacti
89 Requires: %{name} = %{version}-%{release}
92 HTML Documentation for Cacti.
99 %{__patch} -p1 -s < cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff
108 mv cacti-plugin-arch/pa.sql sql
109 rm -rf cacti-plugin-arch
112 rm -f rra/.placeholder
113 rm -f plugins/index.php
115 %{__sed} -i -e '1i#!%{_bindir}/php' scripts/*.php
118 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/cron.d,%{_sbindir}}
123 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
125 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
126 cp -a cli images include install lib plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
127 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
128 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
130 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
131 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
133 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
134 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
136 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
137 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
138 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
141 rm -rf $RPM_BUILD_ROOT
144 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
147 if [ ! -f /var/log/%{name}/cacti.log ]; then
148 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
152 if [ "$1" = "0" ]; then
156 %triggerin -- apache1 < 1.3.37-3, apache1-base
157 %webapp_register apache %{_webapp}
159 %triggerun -- apache1 < 1.3.37-3, apache1-base
160 %webapp_unregister apache %{_webapp}
162 %triggerin -- apache < 2.2.0, apache-base
163 %webapp_register httpd %{_webapp}
165 %triggerun -- apache < 2.2.0, apache-base
166 %webapp_unregister httpd %{_webapp}
168 %triggerin -- lighttpd
169 %webapp_register lighttpd %{_webapp}
171 %triggerun -- lighttpd
172 %webapp_unregister lighttpd %{_webapp}
174 %triggerpostun -- %{name} < 0.8.7b-9.5
175 if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
176 cp -f %{_sysconfdir}/config.php{,.rpmnew}
177 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
181 %defattr(644,root,root,755)
182 %doc docs/CHANGELOG docs/CONTRIB docs/README docs/text/manual.txt
183 %dir %attr(750,root,http) %{_sysconfdir}
184 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
185 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
186 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
187 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
188 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
189 %attr(755,root,root) %{_sbindir}/cacti-poller
191 %exclude %{_appdir}/install
192 %exclude %{_appdir}/docs
202 %dir %{_appdir}/scripts
203 %attr(755,root,root) %{_appdir}/scripts/*
205 %attr(750,root,http) %dir /var/lib/%{name}
206 %attr(770,root,http) %dir /var/lib/%{name}/rra
207 %attr(730,root,http) %dir /var/log/%{name}
208 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
211 %defattr(644,root,root,755)
215 %defattr(644,root,root,755)