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: a4da682dab9a88a2e0edb1728bf531ae
11 Source2: %{name}.crontab
12 Source3: %{name}-apache.conf
13 Source4: %{name}-lighttpd.conf
14 Source5: %{name}-rrdpath.sql
15 Source7: %{name}.logrotate
16 Patch0: mysql-socket.patch
17 Patch1: %{name}-config.patch
18 Patch2: %{name}-adodb.patch
19 Patch3: %{name}-ioerror.patch
20 Patch4: %{name}-webroot.patch
21 Patch5: %{name}-linux_memory.patch
22 Patch6: %{name}-log-verbosity.patch
23 Patch7: %{name}-ss_disk-array-indices.patch
24 Patch8: host_name-url.patch
25 # http://www.cacti.net/download_patches.php
26 URL: http://www.cacti.net/
27 BuildRequires: sed >= 4.0
28 Requires(postun): /usr/sbin/userdel
29 Requires(pre): /bin/id
30 Requires(pre): /usr/sbin/useradd
31 Requires: adodb >= 4.67-1.17
32 Requires: cacti-plugin-boost >= 5.0
35 Requires: net-snmp-utils
36 Requires: php(core) >= 5.2.13-10
39 Requires: php(session)
45 Requires: webserver(access)
46 Requires: webserver(alias)
47 Requires: webserver(indexfile)
48 Requires: webserver(php)
51 Provides: cacti(pia) = %{pia_ver}
53 Obsoletes: cacti-add_template
54 Obsoletes: cacti-plugin-update
55 Conflicts: logrotate < 3.8.0
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 %define _webapps /etc/webapps
60 %define _webapp %{name}
61 %define _sysconfdir %{_webapps}/%{_webapp}
62 %define _appdir /usr/share/%{name}
65 Cacti is a complete frondend to rrdtool, it stores all of the
66 nessesary information to create graphs and populate them with data in
69 The frontend is completely PHP driven. Along with being able to
70 maintain Graphs, Data Sources, and Round Robin Archives in a database,
71 cacti handles the data gathering also. There is also SNMP support for
72 those used to creating traffic graphs with MRTG.
74 %description -l pl.UTF-8
75 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
76 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
79 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
80 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
81 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
82 tworzeniu wykresów ruchu przy użyciu MRTG.
85 Summary: Cacti setup package
86 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
87 Group: Applications/WWW
88 Requires: %{name} = %{version}-%{release}
89 Suggests: %{name}-doc = %{version}-%{release}
92 Install this package to configure initial Cacti installation. You
93 should uninstall this package when you're done, as it considered
94 insecure to keep the setup files in place.
96 %description setup -l pl.UTF-8
97 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
98 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
99 obecność może być niebezpieczna.
102 Summary: HTML Documentation for Cacti
103 Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
105 Requires: %{name} = %{version}-%{release}
108 HTML Documentation for Cacti.
110 %description doc -l pl.UTF-8
111 Dokumentacja do Cacti w formacie HTML.
129 # you should run this sql if your database contains path to %{_datadir}...
133 %{__rm} log/.htaccess
134 %{__rm} cli/.htaccess
135 %{__rm} rra/.htaccess
137 # must require libs to get fatals on missing files, not include
139 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
140 s,include_once,require_once,
143 # make sure scripts have php shebang
145 /bin.php/!i#!%{_bindir}/php
146 }' scripts/*.php cli/*.php
148 chmod a+rx scripts/*.php cli/*.php
150 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
152 # make sure cacti runs out of the box
153 %{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
156 rm -rf $RPM_BUILD_ROOT
157 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/{cron.d,logrotate.d},%{_sbindir}}
158 install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
160 cp -p *.php $RPM_BUILD_ROOT%{_appdir}
161 cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
162 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
163 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
165 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
166 install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
167 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
169 mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
170 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
171 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
173 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
174 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
175 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
178 rm -rf $RPM_BUILD_ROOT
181 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
184 if [ ! -f /var/log/%{name}/cacti.log ]; then
185 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
188 %{_appdir}/cli/upgrade_database.php || :
191 if [ "$1" = "0" ]; then
195 %triggerin -- apache1 < 1.3.37-3, apache1-base
196 %webapp_register apache %{_webapp}
198 %triggerun -- apache1 < 1.3.37-3, apache1-base
199 %webapp_unregister apache %{_webapp}
201 %triggerin -- apache < 2.2.0, apache-base
202 %webapp_register httpd %{_webapp}
204 %triggerun -- apache < 2.2.0, apache-base
205 %webapp_unregister httpd %{_webapp}
207 %triggerin -- lighttpd
208 %webapp_register lighttpd %{_webapp}
210 %triggerun -- lighttpd
211 %webapp_unregister lighttpd %{_webapp}
213 %triggerpostun -- %{name} < 0.8.7b-9.5
214 if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
215 cp -f %{_sysconfdir}/config.php{,.rpmnew}
216 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
220 %defattr(644,root,root,755)
221 %doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt
222 %dir %attr(750,root,http) %{_sysconfdir}
223 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
224 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
225 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
226 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
227 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
228 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
229 %attr(755,root,root) %{_sbindir}/cacti-poller
231 %exclude %{_appdir}/install
232 %exclude %{_appdir}/docs
242 %attr(755,root,root) %{_appdir}/cli/*
244 %dir %{_appdir}/scripts
245 %attr(755,root,root) %{_appdir}/scripts/*
247 %attr(750,root,http) %dir /var/lib/%{name}
248 %attr(770,root,http) %dir /var/lib/%{name}/rra
249 %attr(730,root,http) %dir /var/log/%{name}
250 %attr(750,root,logs) %dir /var/log/archive/%{name}
251 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
252 %attr(730,root,http) %dir /var/cache/%{name}
255 %defattr(644,root,root,755)
259 %defattr(644,root,root,755)