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: 0822068bfa547278e94d3143ef9279e0
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 Source5: %{name}-rrdpath.sql
17 Source6: %{name}-pa.sql
18 Patch0: cacti-plugin-%{version}-PA-v2.4.diff
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: %{name}-rrdresourcecheck.patch
27 URL: http://www.cacti.net/
28 BuildRequires: rpm-perlprov
29 BuildRequires: sed >= 4.0
30 Requires(postun): /usr/sbin/userdel
31 Requires(pre): /bin/id
32 Requires(pre): /usr/sbin/useradd
33 Requires: adodb >= 4.67-1.17
36 Requires: net-snmp-utils
46 Requires: webserver(access)
47 Requires: webserver(alias)
48 Requires: webserver(indexfile)
49 Requires: webserver(php)
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define _webapps /etc/webapps
56 %define _webapp %{name}
57 %define _sysconfdir %{_webapps}/%{_webapp}
58 %define _appdir /usr/share/%{name}
61 Cacti is a complete frondend to rrdtool, it stores all of the
62 nessesary information to create graphs and populate them with data in
65 The frontend is completely PHP driven. Along with being able to
66 maintain Graphs, Data Sources, and Round Robin Archives in a database,
67 cacti handles the data gathering also. There is also SNMP support for
68 those used to creating traffic graphs with MRTG.
70 %description -l pl.UTF-8
71 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
72 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
75 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
76 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
77 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
78 tworzeniu wykresów ruchu przy użyciu MRTG.
81 Summary: Cacti setup package
82 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
83 Group: Applications/WWW
84 Requires: %{name} = %{version}-%{release}
85 Suggests: %{name}-doc = %{version}-%{release}
88 Install this package to configure initial Cacti installation. You
89 should uninstall this package when you're done, as it considered
90 insecure to keep the setup files in place.
92 %description setup -l pl.UTF-8
93 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
94 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
95 obecność może być niebezpieczna.
98 Summary: HTML Documentation for Cacti
99 Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
101 Requires: %{name} = %{version}-%{release}
104 HTML Documentation for Cacti.
106 %description doc -l pl.UTF-8
107 Dokumentacja do Cacti w formacie HTML.
123 # you should run this sql if your database contains path to %{_datadir}...
127 rm -rf cacti-plugin-arch
131 rm -f rra/.placeholder
133 %{__sed} -i -e '1i#!%{_bindir}/php' scripts/*.php
136 %{__sed} -i -e '1i#!%{_bindir}/php' cli/*.php
139 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/cron.d,%{_sbindir}}
144 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
146 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
147 cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
148 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
149 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
151 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
152 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
154 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
155 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
157 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
158 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
159 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
162 rm -rf $RPM_BUILD_ROOT
165 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
168 if [ ! -f /var/log/%{name}/cacti.log ]; then
169 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
173 if [ "$1" = "0" ]; then
177 %triggerin -- apache1 < 1.3.37-3, apache1-base
178 %webapp_register apache %{_webapp}
180 %triggerun -- apache1 < 1.3.37-3, apache1-base
181 %webapp_unregister apache %{_webapp}
183 %triggerin -- apache < 2.2.0, apache-base
184 %webapp_register httpd %{_webapp}
186 %triggerun -- apache < 2.2.0, apache-base
187 %webapp_unregister httpd %{_webapp}
189 %triggerin -- lighttpd
190 %webapp_register lighttpd %{_webapp}
192 %triggerun -- lighttpd
193 %webapp_unregister lighttpd %{_webapp}
195 %triggerpostun -- %{name} < 0.8.7b-9.5
196 if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
197 cp -f %{_sysconfdir}/config.php{,.rpmnew}
198 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
202 %defattr(644,root,root,755)
203 %doc docs/CHANGELOG docs/CONTRIB docs/README docs/text/manual.txt
204 %dir %attr(750,root,http) %{_sysconfdir}
205 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
206 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
207 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
208 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
209 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
210 %attr(755,root,root) %{_sbindir}/cacti-poller
212 %exclude %{_appdir}/install
213 %exclude %{_appdir}/docs
223 %attr(755,root,root) %{_appdir}/cli/*
225 %dir %{_appdir}/scripts
226 %attr(755,root,root) %{_appdir}/scripts/*
228 %attr(750,root,http) %dir /var/lib/%{name}
229 %attr(770,root,http) %dir /var/lib/%{name}/rra
230 %attr(730,root,http) %dir /var/log/%{name}
231 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
234 %defattr(644,root,root,755)
238 %defattr(644,root,root,755)