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