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 Source6: %{name}-rrdpath.sql
18 Patch100: http://www.cacti.net/downloads/patches/0.8.7b/upgrade_from_086k_fix.patch
19 Patch101: http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch
20 Patch102: http://www.cacti.net/downloads/patches/0.8.7b/reset_each_patch.patch
21 Patch0: %{name}-config.patch
22 Patch1: %{name}-adodb.patch
23 Patch2: %{name}-ioerror.patch
24 Patch3: %{name}-webroot.patch
25 Patch4: %{name}-linux_memory.patch
26 Patch5: %{name}-log-verbosity.patch
27 Patch6: %{name}-ss_disk-array-indices.patch
28 Patch7: %{name}-rrdtool-1.3.patch
29 Patch8: %{name}-rrdresourcecheck.patch
30 URL: http://www.cacti.net/
31 BuildRequires: rpm-perlprov
32 BuildRequires: sed >= 4.0
33 Requires(postun): /usr/sbin/userdel
34 Requires(pre): /bin/id
35 Requires(pre): /usr/sbin/useradd
36 Requires: adodb >= 4.67-1.17
39 Requires: net-snmp-utils
49 Requires: webserver(alias)
50 Requires: webserver(php)
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 %define _webapps /etc/webapps
57 %define _webapp %{name}
58 %define _sysconfdir %{_webapps}/%{_webapp}
59 %define _appdir /usr/share/%{name}
62 Cacti is a complete frondend to rrdtool, it stores all of the
63 nessesary information to create graphs and populate them with data in
66 The frontend is completely PHP driven. Along with being able to
67 maintain Graphs, Data Sources, and Round Robin Archives in a database,
68 cacti handles the data gathering also. There is also SNMP support for
69 those used to creating traffic graphs with MRTG.
71 %description -l pl.UTF-8
72 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
73 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
76 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
77 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
78 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
79 tworzeniu wykresów ruchu przy użyciu MRTG.
82 Summary: Cacti setup package
83 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
84 Group: Applications/WWW
85 Requires: %{name} = %{version}-%{release}
86 Suggests: %{name}-doc = %{version}-%{release}
89 Install this package to configure initial Cacti installation. You
90 should uninstall this package when you're done, as it considered
91 insecure to keep the setup files in place.
93 %description setup -l pl.UTF-8
94 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
95 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
96 obecność może być niebezpieczna.
99 Summary: HTML Documentation for Cacti
100 Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
102 Requires: %{name} = %{version}-%{release}
105 HTML Documentation for Cacti.
107 %description doc -l pl.UTF-8
108 Dokumentacja do Cacti w formacie HTML.
115 %{__patch} -p1 -s < cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff
128 # you should run this sql if your database contains path to %{_datadir}...
131 mv cacti-plugin-arch/pa.sql sql
132 rm -rf cacti-plugin-arch
136 rm -f rra/.placeholder
137 rm -f plugins/index.php
139 %{__sed} -i -e '1i#!%{_bindir}/php' scripts/*.php
142 %{__sed} -i -e '1i#!%{_bindir}/php' cli/*.php
145 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/cron.d,%{_sbindir}}
150 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
152 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
153 cp -a cli images include install lib plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
154 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
155 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
157 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
158 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
160 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
161 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
163 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
164 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
165 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
168 rm -rf $RPM_BUILD_ROOT
171 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
174 if [ ! -f /var/log/%{name}/cacti.log ]; then
175 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
179 if [ "$1" = "0" ]; then
183 %triggerin -- apache1 < 1.3.37-3, apache1-base
184 %webapp_register apache %{_webapp}
186 %triggerun -- apache1 < 1.3.37-3, apache1-base
187 %webapp_unregister apache %{_webapp}
189 %triggerin -- apache < 2.2.0, apache-base
190 %webapp_register httpd %{_webapp}
192 %triggerun -- apache < 2.2.0, apache-base
193 %webapp_unregister httpd %{_webapp}
195 %triggerin -- lighttpd
196 %webapp_register lighttpd %{_webapp}
198 %triggerun -- lighttpd
199 %webapp_unregister lighttpd %{_webapp}
201 %triggerpostun -- %{name} < 0.8.7b-9.5
202 if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
203 cp -f %{_sysconfdir}/config.php{,.rpmnew}
204 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
208 %defattr(644,root,root,755)
209 %doc docs/CHANGELOG docs/CONTRIB docs/README docs/text/manual.txt
210 %dir %attr(750,root,http) %{_sysconfdir}
211 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
212 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
213 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
214 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
215 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
216 %attr(755,root,root) %{_sbindir}/cacti-poller
218 %exclude %{_appdir}/install
219 %exclude %{_appdir}/docs
229 %attr(755,root,root) %{_appdir}/cli/*
231 %dir %{_appdir}/scripts
232 %attr(755,root,root) %{_appdir}/scripts/*
234 %attr(750,root,http) %dir /var/lib/%{name}
235 %attr(770,root,http) %dir /var/lib/%{name}/rra
236 %attr(730,root,http) %dir /var/log/%{name}
237 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
240 %defattr(644,root,root,755)
244 %defattr(644,root,root,755)