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