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