]> git.pld-linux.org Git - packages/cacti.git/blame - cacti.spec
- added temporary patch for 0.8.7g fixing some XSS and SQLI vulnerabilities
[packages/cacti.git] / cacti.spec
CommitLineData
bb0e5568
ER
1#
2# Conditional build:
3%bcond_without pa # without plugin archidecture patch
4
d839b321 5%define pia_ver 2.9
e90043f8 6%include /usr/lib/rpm/macros.perl
9f35c748 7Summary: Cacti is a PHP frontend for rrdtool
bf643d4f 8Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
94614147 9Name: cacti
bb0e5568 10Version: 0.8.7g
3f7a5bd0 11Release: 11
6587a5d5 12License: GPL
94614147 13Group: Applications/WWW
761b4fb2 14Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
bb0e5568 15# Source0-md5: 268421cb1a58d3444f7ecbddb4c4b016
a1abeca3 16Source2: %{name}.crontab
de4cec3c
GS
17Source3: %{name}-apache.conf
18Source4: %{name}-lighttpd.conf
19Source5: %{name}-rrdpath.sql
817cc464 20Source6: %{name}-pa.sql
af389505 21Source7: %{name}.logrotate
d7378ed4 22# http://docs.cacti.net/manual:087:1_installation.9_pia
d839b321
ER
23Source8: http://www.cacti.net/downloads/pia/%{name}-plugin-%{version}-PA-v%{pia_ver}.tar.gz
24# Source8-md5: a508cf859577afccb6555557d4ec90f1
8466638a 25# NOTE: update provides: cacti(pia) when updating the patch
8514c08f 26Patch0: %{name}-PA.patch
de4cec3c
GS
27Patch1: %{name}-config.patch
28Patch2: %{name}-adodb.patch
29Patch3: %{name}-ioerror.patch
30Patch4: %{name}-webroot.patch
31Patch5: %{name}-linux_memory.patch
32Patch6: %{name}-log-verbosity.patch
33Patch7: %{name}-ss_disk-array-indices.patch
ac01d3f9
AZ
34Patch8: host_name-url.patch
35Patch9: cli-relpath.patch
e79e3b18 36# http://www.cacti.net/download_patches.php
af389505
ER
37Patch10: data_source_deactivate.patch
38Patch11: graph_list_view.patch
39Patch12: html_output.patch
40Patch13: ldap_group_authenication.patch
41Patch14: script_server_command_line_parse.patch
42Patch15: ping.patch
43Patch16: poller_interval.patch
3f7a5bd0 44Patch17: %{name}-0.8.7g-sqli-xss.patch
761b4fb2 45URL: http://www.cacti.net/
89aea3b3 46BuildRequires: rpm-perlprov
344e658b 47BuildRequires: sed >= 4.0
f4a0dd1f
ER
48Requires(postun): /usr/sbin/userdel
49Requires(pre): /bin/id
50Requires(pre): /usr/sbin/useradd
f44cea91 51Requires: adodb >= 4.67-1.17
e9300b9e 52Requires: crondaemon
f4a0dd1f 53Requires: group(http)
94614147 54Requires: net-snmp-utils
4e25427a 55Requires: php-cli
c5421ef6 56Requires: php-common >= 4:5.2.13-10
c5421ef6
ER
57Requires: php-mysql
58Requires: php-pcre
59Requires: php-session
60Requires: php-snmp
61Requires: php-xml
c8f292cd 62Requires: rrdtool
4b6cd69a 63Requires: webapps
e4f2f951 64Requires: webserver
cce68540 65Requires: webserver(access)
7d4ec5c1 66Requires: webserver(alias)
09dccb3a 67Requires: webserver(indexfile)
f5a0e42f 68Requires: webserver(php)
578edcb5 69Suggests: cacti-spine
24fa0556 70Suggests: php-gd
d839b321 71Provides: cacti(pia) = %{pia_ver}
f4a0dd1f 72Provides: user(cacti)
6587a5d5 73BuildArch: noarch
94614147
JB
74BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
4b6cd69a
ER
76%define _webapps /etc/webapps
77%define _webapp %{name}
78%define _sysconfdir %{_webapps}/%{_webapp}
79%define _appdir /usr/share/%{name}
6587a5d5
JB
80
81%description
82Cacti is a complete frondend to rrdtool, it stores all of the
94614147
JB
83nessesary information to create graphs and populate them with data in
84a MySQL database.
6587a5d5 85
94614147
JB
86The frontend is completely PHP driven. Along with being able to
87maintain Graphs, Data Sources, and Round Robin Archives in a database,
88cacti handles the data gathering also. There is also SNMP support for
89those used to creating traffic graphs with MRTG.
6587a5d5 90
41840fab 91%description -l pl.UTF-8
350cedee 92Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
bf643d4f
ER
93informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
94bazie MySQL.
c9dfb888 95
350cedee 96Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
bf643d4f
ER
97źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
98także gromadzenie danych. Ma także obsługę SNMP przydatną przy
99tworzeniu wykresów ruchu przy użyciu MRTG.
c9dfb888 100
4b6cd69a
ER
101%package setup
102Summary: Cacti setup package
103Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
104Group: Applications/WWW
105Requires: %{name} = %{version}-%{release}
d6d42868 106Suggests: %{name}-doc = %{version}-%{release}
4b6cd69a
ER
107
108%description setup
109Install this package to configure initial Cacti installation. You
110should uninstall this package when you're done, as it considered
111insecure to keep the setup files in place.
112
a40c4ad5
JB
113%description setup -l pl.UTF-8
114Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
115Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
116obecność może być niebezpieczna.
117
4b6cd69a
ER
118%package doc
119Summary: HTML Documentation for Cacti
a40c4ad5 120Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
4b6cd69a
ER
121Group: Documentation
122Requires: %{name} = %{version}-%{release}
123
124%description doc
125HTML Documentation for Cacti.
126
a40c4ad5
JB
127%description doc -l pl.UTF-8
128Dokumentacja do Cacti w formacie HTML.
129
6587a5d5 130%prep
8466638a 131%setup -q %{?with_pa:-a8}
482f9753 132# official patches
af389505
ER
133%patch10 -p1
134%patch11 -p1
135%patch12 -p1
136%patch13 -p1
137%patch14 -p1
138%patch15 -p1
139%patch16 -p1
3f7a5bd0 140%patch17 -p1
e79e3b18 141
8466638a
ER
142%if %{with pa}
143%patch0 -p1
144# copy images and drop the rest
145mv cacti-plugin-arch/files-%{version}/images/* images
146%{__rm} -r cacti-plugin-arch
147%endif
482f9753 148
0482abbd 149%patch1 -p1
f23be293 150%patch2 -p1
14544804 151%patch3 -p1
d6d42868
ER
152%patch4 -p1
153%patch5 -p1
154%patch6 -p1
5e8efd1f 155%patch7 -p1
de4cec3c 156%patch8 -p1
fe418db4 157%patch9 -p1
6587a5d5 158
4b6cd69a
ER
159mkdir -p sql
160mv *.sql sql
86a72dca 161# you should run this sql if your database contains path to %{_datadir}...
de4cec3c 162cp %{SOURCE5} sql
817cc464 163cp %{SOURCE6} sql
4b6cd69a 164
af389505
ER
165%{__rm} -r lib/adodb
166%{__rm} log/.htaccess
167%{__rm} cli/.htaccess
af389505 168%{__rm} rra/.htaccess
344e658b 169
93d2fa9c
ER
170# must require libs to get fatals on missing files, not include
171%{__sed} -i -e '
172 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
173 s,include_once,require_once,
174' cli/*.php
175
c68d3a6e
ER
176# make sure scripts have php shebang
177%{__sed} -i -e '1{
178 /bin.php/!i#!%{_bindir}/php
179}' scripts/*.php cli/*.php
6587a5d5 180
c68d3a6e 181chmod a+rx scripts/*.php cli/*.php
ebacb7e6 182
f4a0dd1f
ER
183find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
184
a0b0ee8a 185# make sure cacti runs out of the box
af389505 186%{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
a0b0ee8a 187
6587a5d5 188%install
94614147 189rm -rf $RPM_BUILD_ROOT
af389505 190install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/{cron.d,logrotate.d},%{_sbindir}}
8c6ff4ca 191install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
e9300b9e 192
4b6cd69a 193cp -a *.php $RPM_BUILD_ROOT%{_appdir}
de4cec3c 194cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
4b6cd69a
ER
195cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
196mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
e9300b9e 197
4b6cd69a 198cp -a log $RPM_BUILD_ROOT/var/log/%{name}
b53d6410 199install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
4b6cd69a 200cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
e9300b9e 201
caa81993 202mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
4b6cd69a 203cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
af389505 204cp -a %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
4b6cd69a 205
de4cec3c
GS
206cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
207cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
208cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
6587a5d5
JB
209
210%clean
94614147 211rm -rf $RPM_BUILD_ROOT
6587a5d5 212
f4a0dd1f
ER
213%pre
214%useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
215
4b6cd69a
ER
216%post
217if [ ! -f /var/log/%{name}/cacti.log ]; then
218 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
219fi
220
f4a0dd1f
ER
221%postun
222if [ "$1" = "0" ]; then
223 %userremove cacti
224fi
225
4b6cd69a
ER
226%triggerin -- apache1 < 1.3.37-3, apache1-base
227%webapp_register apache %{_webapp}
228
229%triggerun -- apache1 < 1.3.37-3, apache1-base
230%webapp_unregister apache %{_webapp}
231
232%triggerin -- apache < 2.2.0, apache-base
233%webapp_register httpd %{_webapp}
234
235%triggerun -- apache < 2.2.0, apache-base
236%webapp_unregister httpd %{_webapp}
237
238%triggerin -- lighttpd
239%webapp_register lighttpd %{_webapp}
240
241%triggerun -- lighttpd
242%webapp_unregister lighttpd %{_webapp}
243
244%triggerpostun -- %{name} < 0.8.7b-9.5
245if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
246 cp -f %{_sysconfdir}/config.php{,.rpmnew}
247 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
248fi
249
6587a5d5 250%files
94614147 251%defattr(644,root,root,755)
e4aad445 252%doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt
4b6cd69a
ER
253%dir %attr(750,root,http) %{_sysconfdir}
254%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
255%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
256%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
257%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
258%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
af389505 259%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
4b6cd69a 260%attr(755,root,root) %{_sbindir}/cacti-poller
344e658b 261%dir %{_appdir}
4b6cd69a
ER
262%exclude %{_appdir}/install
263%exclude %{_appdir}/docs
344e658b
ER
264%{_appdir}/resource
265%{_appdir}/sql
266%{_appdir}/lib
267%{_appdir}/include
268%{_appdir}/images
344e658b
ER
269%{_appdir}/plugins
270%{_appdir}/*.php
271
ebacb7e6
ER
272%dir %{_appdir}/cli
273%attr(755,root,root) %{_appdir}/cli/*
274
344e658b
ER
275%dir %{_appdir}/scripts
276%attr(755,root,root) %{_appdir}/scripts/*
4b6cd69a 277
ea4c4a5f
AM
278%attr(750,root,http) %dir /var/lib/%{name}
279%attr(770,root,http) %dir /var/lib/%{name}/rra
4b6cd69a 280%attr(730,root,http) %dir /var/log/%{name}
b53d6410 281%attr(750,root,logs) %dir /var/log/archive/%{name}
4b6cd69a 282%attr(660,root,http) %ghost /var/log/%{name}/cacti.log
8c6ff4ca 283%attr(730,root,http) %dir /var/cache/%{name}
4b6cd69a
ER
284
285%files setup
286%defattr(644,root,root,755)
287%{_appdir}/install
288
289%files doc
290%defattr(644,root,root,755)
adf6e05d 291%{_appdir}/docs
This page took 0.131544 seconds and 4 git commands to generate.