2 %define php_min_version 5.2.13-10
3 %include /usr/lib/rpm/macros.php
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: acb40deae073ca22e5c01a8e3ba389fb
13 Source2: %{name}.crontab
14 Source3: %{name}-apache.conf
15 Source4: %{name}-lighttpd.conf
16 Source5: %{name}-rrdpath.sql
17 Source7: %{name}.logrotate
18 Patch0: mysql-socket.patch
19 Patch1: %{name}-config.patch
20 Patch2: %{name}-adodb.patch
21 Patch3: %{name}-ioerror.patch
22 Patch4: %{name}-webroot.patch
23 Patch5: %{name}-linux_memory.patch
24 Patch6: %{name}-log-verbosity.patch
25 Patch7: %{name}-ss_disk-array-indices.patch
26 Patch8: host_name-url.patch
27 # http://www.cacti.net/download_patches.php
30 URL: http://www.cacti.net/
31 BuildRequires: sed >= 4.0
32 Requires(postun): /usr/sbin/userdel
33 Requires(pre): /bin/id
34 Requires(pre): /usr/sbin/useradd
35 Requires: adodb >= 4.67-1.17
36 Requires: cacti-plugin-boost >= 5.0
39 Requires: net-snmp-utils
40 Requires: php(core) >= %{php_min_version}
43 Requires: php(session)
49 Requires: webserver(access)
50 Requires: webserver(alias)
51 Requires: webserver(indexfile)
52 Requires: webserver(php)
55 Provides: cacti(pia) = %{pia_ver}
57 Obsoletes: cacti-add_template
58 Obsoletes: cacti-plugin-update
59 Conflicts: logrotate < 3.8.0
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 %define _webapps /etc/webapps
64 %define _webapp %{name}
65 %define _sysconfdir %{_webapps}/%{_webapp}
66 %define _appdir /usr/share/%{name}
69 %define _noautopear pear
71 # put it together for rpmbuild
72 %define _noautoreq %{?_noautophp} %{?_noautopear}
75 Cacti is a complete frondend to rrdtool, it stores all of the
76 nessesary information to create graphs and populate them with data in
79 The frontend is completely PHP driven. Along with being able to
80 maintain Graphs, Data Sources, and Round Robin Archives in a database,
81 cacti handles the data gathering also. There is also SNMP support for
82 those used to creating traffic graphs with MRTG.
84 %description -l pl.UTF-8
85 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
86 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
89 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
90 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
91 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
92 tworzeniu wykresów ruchu przy użyciu MRTG.
95 Summary: Cacti setup package
96 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
97 Group: Applications/WWW
98 Requires: %{name} = %{version}-%{release}
99 Suggests: %{name}-doc = %{version}-%{release}
102 Install this package to configure initial Cacti installation. You
103 should uninstall this package when you're done, as it considered
104 insecure to keep the setup files in place.
106 %description setup -l pl.UTF-8
107 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
108 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
109 obecność może być niebezpieczna.
112 Summary: HTML Documentation for Cacti
113 Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
115 Requires: %{name} = %{version}-%{release}
118 HTML Documentation for Cacti.
120 %description doc -l pl.UTF-8
121 Dokumentacja do Cacti w formacie HTML.
140 # you should run this sql if your database contains path to %{_datadir}...
144 %{__rm} log/.htaccess
145 %{__rm} cli/.htaccess
146 %{__rm} rra/.htaccess
148 # must require libs to get fatals on missing files, not include
150 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
151 s,include_once,require_once,
154 # make sure scripts have php shebang
156 /bin.php/!i#!%{_bindir}/php
157 }' scripts/*.php cli/*.php
159 chmod a+rx scripts/*.php cli/*.php
161 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
163 # make sure cacti runs out of the box
164 %{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
167 rm -rf $RPM_BUILD_ROOT
168 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/{cron.d,logrotate.d},%{_sbindir}}
169 install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
171 cp -p *.php $RPM_BUILD_ROOT%{_appdir}
172 cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
173 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
174 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
176 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
177 install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
178 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
180 mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
181 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
182 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
184 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
185 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
186 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
189 rm -rf $RPM_BUILD_ROOT
192 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
195 if [ ! -f /var/log/%{name}/cacti.log ]; then
196 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
199 %{_appdir}/cli/upgrade_database.php || :
202 if [ "$1" = "0" ]; then
206 %triggerin -- apache1 < 1.3.37-3, apache1-base
207 %webapp_register apache %{_webapp}
209 %triggerun -- apache1 < 1.3.37-3, apache1-base
210 %webapp_unregister apache %{_webapp}
212 %triggerin -- apache < 2.2.0, apache-base
213 %webapp_register httpd %{_webapp}
215 %triggerun -- apache < 2.2.0, apache-base
216 %webapp_unregister httpd %{_webapp}
218 %triggerin -- lighttpd
219 %webapp_register lighttpd %{_webapp}
221 %triggerun -- lighttpd
222 %webapp_unregister lighttpd %{_webapp}
224 %triggerpostun -- %{name} < 0.8.7b-9.5
225 if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
226 cp -f %{_sysconfdir}/config.php{,.rpmnew}
227 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
231 %defattr(644,root,root,755)
232 %doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt
233 %dir %attr(750,root,http) %{_sysconfdir}
234 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
235 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
236 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
237 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
238 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
239 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
240 %attr(755,root,root) %{_sbindir}/cacti-poller
242 %exclude %{_appdir}/install
243 %exclude %{_appdir}/docs
253 %attr(755,root,root) %{_appdir}/cli/*
255 %dir %{_appdir}/scripts
256 %attr(755,root,root) %{_appdir}/scripts/*
258 %attr(750,root,http) %dir /var/lib/%{name}
259 %attr(770,root,http) %dir /var/lib/%{name}/rra
260 %attr(730,root,http) %dir /var/log/%{name}
261 %attr(750,root,logs) %dir /var/log/archive/%{name}
262 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
263 %attr(730,root,http) %dir /var/cache/%{name}
266 %defattr(644,root,root,755)
270 %defattr(644,root,root,755)