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: 7563a58a57d2c6cc0da28cc341a30969
11 Source1: %{name}.cfg.php
12 Source2: %{name}.crontab
13 Source3: %{name}-apache.conf
14 Source4: %{name}-lighttpd.conf
15 Source5: %{name}-rrdpath.sql
16 Source6: %{name}-pa.sql
17 Patch100: http://www.cacti.net/downloads/patches/0.8.7e/cli_add_graph.patch
18 Patch101: http://www.cacti.net/downloads/patches/0.8.7e/snmp_invalid_response.patch
19 Patch102: http://www.cacti.net/downloads/patches/0.8.7e/template_duplication.patch
20 Patch103: http://www.cacti.net/downloads/patches/0.8.7e/fix_icmp_on_windows_iis_servers.patch
21 Patch104: http://www.cacti.net/downloads/patches/0.8.7e/cross_site_fix.patch
22 # http://cactiusers.org/wiki/PluginArchitectureInstall
23 # http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7e-PA-v2.6.zip
24 Patch0: %{name}-PA.patch
25 Patch1: %{name}-config.patch
26 Patch2: %{name}-adodb.patch
27 Patch3: %{name}-ioerror.patch
28 Patch4: %{name}-webroot.patch
29 Patch5: %{name}-linux_memory.patch
30 Patch6: %{name}-log-verbosity.patch
31 Patch7: %{name}-ss_disk-array-indices.patch
32 Patch8: %{name}-rrdresourcecheck.patch
33 Patch9: host_name-url.patch
34 Patch10: cli-relpath.patch
35 URL: http://www.cacti.net/
36 BuildRequires: rpm-perlprov
37 BuildRequires: sed >= 4.0
38 Requires(postun): /usr/sbin/userdel
39 Requires(pre): /bin/id
40 Requires(pre): /usr/sbin/useradd
41 Requires: adodb >= 4.67-1.17
44 Requires: net-snmp-utils
46 Requires: php-common >= 4:5.2.13-10
56 Requires: webserver(access)
57 Requires: webserver(alias)
58 Requires: webserver(indexfile)
59 Requires: webserver(php)
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 %define _webapps /etc/webapps
66 %define _webapp %{name}
67 %define _sysconfdir %{_webapps}/%{_webapp}
68 %define _appdir /usr/share/%{name}
71 Cacti is a complete frondend to rrdtool, it stores all of the
72 nessesary information to create graphs and populate them with data in
75 The frontend is completely PHP driven. Along with being able to
76 maintain Graphs, Data Sources, and Round Robin Archives in a database,
77 cacti handles the data gathering also. There is also SNMP support for
78 those used to creating traffic graphs with MRTG.
80 %description -l pl.UTF-8
81 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
82 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
85 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
86 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
87 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
88 tworzeniu wykresów ruchu przy użyciu MRTG.
91 Summary: Cacti setup package
92 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
93 Group: Applications/WWW
94 Requires: %{name} = %{version}-%{release}
95 Suggests: %{name}-doc = %{version}-%{release}
98 Install this package to configure initial Cacti installation. You
99 should uninstall this package when you're done, as it considered
100 insecure to keep the setup files in place.
102 %description setup -l pl.UTF-8
103 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
104 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
105 obecność może być niebezpieczna.
108 Summary: HTML Documentation for Cacti
109 Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
111 Requires: %{name} = %{version}-%{release}
114 HTML Documentation for Cacti.
116 %description doc -l pl.UTF-8
117 Dokumentacja do Cacti w formacie HTML.
140 # you should run this sql if your database contains path to %{_datadir}...
144 rm -rf cacti-plugin-arch
148 rm -f rra/.placeholder
150 # must require libs to get fatals on missing files, not include
152 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
153 s,include_once,require_once,
156 # make sure scripts have php shebang
158 /bin.php/!i#!%{_bindir}/php
159 }' scripts/*.php cli/*.php
161 chmod a+rx scripts/*.php cli/*.php
163 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
167 # make sure cacti runs out of the box
168 sed -e "s,new_install,%{version}," -i sql/cacti.sql
171 rm -rf $RPM_BUILD_ROOT
172 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/cron.d,%{_sbindir}}
173 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
175 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
176 cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
177 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
178 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
180 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
181 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
183 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
184 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
186 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
187 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
188 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
191 rm -rf $RPM_BUILD_ROOT
194 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
197 if [ ! -f /var/log/%{name}/cacti.log ]; then
198 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
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(755,root,root) %{_sbindir}/cacti-poller
241 %exclude %{_appdir}/install
242 %exclude %{_appdir}/docs
252 %attr(755,root,root) %{_appdir}/cli/*
254 %dir %{_appdir}/scripts
255 %attr(755,root,root) %{_appdir}/scripts/*
257 %attr(750,root,http) %dir /var/lib/%{name}
258 %attr(770,root,http) %dir /var/lib/%{name}/rra
259 %attr(730,root,http) %dir /var/log/%{name}
260 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
263 %defattr(644,root,root,755)
267 %defattr(644,root,root,755)