]> git.pld-linux.org Git - packages/cacti.git/blame - cacti.spec
Up to 1.2.26
[packages/cacti.git] / cacti.spec
CommitLineData
bc79e792 1%define pia_ver 3.1
466d01a2 2%define php_min_version 5.4.0
9f35c748 3Summary: Cacti is a PHP frontend for rrdtool
bf643d4f 4Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
94614147 5Name: cacti
32a66222 6Version: 1.2.26
8bf83e3a 7Release: 1
bc79e792 8License: GPL v2
94614147 9Group: Applications/WWW
ffbcce38 10Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
32a66222 11# Source0-md5: 53043d8279640a074cc054c7b156375d
a1abeca3 12Source2: %{name}.crontab
de4cec3c
GS
13Source3: %{name}-apache.conf
14Source4: %{name}-lighttpd.conf
15Source5: %{name}-rrdpath.sql
af389505 16Source7: %{name}.logrotate
81fd7803 17
de4cec3c 18Patch1: %{name}-config.patch
e90920b5 19
de4cec3c
GS
20Patch3: %{name}-ioerror.patch
21Patch4: %{name}-webroot.patch
22Patch5: %{name}-linux_memory.patch
23Patch6: %{name}-log-verbosity.patch
2a712e3d 24
ac01d3f9 25Patch8: host_name-url.patch
e79e3b18 26# http://www.cacti.net/download_patches.php
08cf4295 27# Patch100: ..
855dc8ae 28URL: http://www.cacti.net/
344e658b 29BuildRequires: sed >= 4.0
f4a0dd1f
ER
30Requires(postun): /usr/sbin/userdel
31Requires(pre): /bin/id
32Requires(pre): /usr/sbin/useradd
e9300b9e 33Requires: crondaemon
f4a0dd1f 34Requires: group(http)
94614147 35Requires: net-snmp-utils
4780a883 36Requires: php(core) >= %{php_min_version}
587a5678 37Requires: php(ctype)
a9ce9d89 38Requires: php(filter)
15d44e1a 39Requires: php(gd)
a9ce9d89 40Requires: php(json)
15d44e1a 41Requires: php(ldap)
a9ce9d89 42Requires: php(mbstring)
15d44e1a 43Requires: php(openssl)
6e11204f 44Requires: php(pcre)
fc151646 45Requires: php(pdo-mysql)
15d44e1a 46Requires: php(posix)
6e11204f 47Requires: php(session)
15d44e1a 48Requires: php(sockets)
6e11204f 49Requires: php(xml)
15d44e1a 50Requires: php(zlib)
c8f292cd 51Requires: rrdtool
4b6cd69a 52Requires: webapps
e4f2f951 53Requires: webserver
cce68540 54Requires: webserver(access)
7d4ec5c1 55Requires: webserver(alias)
09dccb3a 56Requires: webserver(indexfile)
f5a0e42f 57Requires: webserver(php)
578edcb5 58Suggests: cacti-spine
e38b8207
ER
59Suggests: php(bcmath)
60Suggests: php(ftp)
15d44e1a
AM
61Suggests: php(gmp)
62Suggests: php(snmp)
d839b321 63Provides: cacti(pia) = %{pia_ver}
f4a0dd1f 64Provides: user(cacti)
33c70cd1 65Obsoletes: cacti-add_template
64df0cbe 66Obsoletes: cacti-plugin-boost
9f8f6fd2 67Obsoletes: cacti-plugin-update
aa6fbcd1 68%if "%{pld_release}" != "ac"
6e11204f 69Conflicts: logrotate < 3.8.0
aa6fbcd1 70%endif
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 78
4780a883
ER
79# bad depsolver
80%define _noautopear pear
d6d94c67
ER
81# optional
82%define _noautophp php-ftp php-bcmath
4780a883
ER
83
84# put it together for rpmbuild
85%define _noautoreq %{?_noautophp} %{?_noautopear}
86
6587a5d5
JB
87%description
88Cacti is a complete frondend to rrdtool, it stores all of the
94614147
JB
89nessesary information to create graphs and populate them with data in
90a MySQL database.
6587a5d5 91
94614147
JB
92The frontend is completely PHP driven. Along with being able to
93maintain Graphs, Data Sources, and Round Robin Archives in a database,
94cacti handles the data gathering also. There is also SNMP support for
95those used to creating traffic graphs with MRTG.
6587a5d5 96
41840fab 97%description -l pl.UTF-8
350cedee 98Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
bf643d4f
ER
99informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
100bazie MySQL.
c9dfb888 101
350cedee 102Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
bf643d4f
ER
103źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
104także gromadzenie danych. Ma także obsługę SNMP przydatną przy
105tworzeniu wykresów ruchu przy użyciu MRTG.
c9dfb888 106
4b6cd69a
ER
107%package setup
108Summary: Cacti setup package
109Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
110Group: Applications/WWW
111Requires: %{name} = %{version}-%{release}
d6d42868 112Suggests: %{name}-doc = %{version}-%{release}
4b6cd69a
ER
113
114%description setup
115Install this package to configure initial Cacti installation. You
116should uninstall this package when you're done, as it considered
117insecure to keep the setup files in place.
118
a40c4ad5
JB
119%description setup -l pl.UTF-8
120Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
121Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
122obecność może być niebezpieczna.
123
4b6cd69a
ER
124%package doc
125Summary: HTML Documentation for Cacti
a40c4ad5 126Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
4b6cd69a
ER
127Group: Documentation
128Requires: %{name} = %{version}-%{release}
129
130%description doc
131HTML Documentation for Cacti.
132
a40c4ad5
JB
133%description doc -l pl.UTF-8
134Dokumentacja do Cacti w formacie HTML.
135
6587a5d5 136%prep
ffbcce38 137%setup -q
4a9821cf 138
482f9753 139# official patches
4a9821cf
ER
140%if 0%{?PATCH100:1}
141%patch100 -p1
142%endif
482f9753 143
0482abbd 144%patch1 -p1
e90920b5 145
14544804 146%patch3 -p1
d6d42868
ER
147%patch4 -p1
148%patch5 -p1
149%patch6 -p1
2a712e3d 150
81fd7803
AM
151# ?
152# %patch8 -p1
6587a5d5 153
4b6cd69a
ER
154mkdir -p sql
155mv *.sql sql
86a72dca 156# you should run this sql if your database contains path to %{_datadir}...
3d0c4fef 157cp -p %{SOURCE5} sql
4b6cd69a 158
af389505
ER
159%{__rm} log/.htaccess
160%{__rm} cli/.htaccess
af389505 161%{__rm} rra/.htaccess
344e658b 162
93d2fa9c
ER
163# must require libs to get fatals on missing files, not include
164%{__sed} -i -e '
165 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
166 s,include_once,require_once,
167' cli/*.php
168
436589c5
AM
169%{__sed} -i -e 's,#!/usr/bin/env php,#!/usr/bin/php,' include/vendor/cldr-to-gettext-plural-rules/bin/export-plural-rules *.php */*.php
170
c68d3a6e
ER
171# make sure scripts have php shebang
172%{__sed} -i -e '1{
173 /bin.php/!i#!%{_bindir}/php
174}' scripts/*.php cli/*.php
6587a5d5 175
c68d3a6e 176chmod a+rx scripts/*.php cli/*.php
ebacb7e6 177
f4a0dd1f
ER
178find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
179
a0b0ee8a 180# make sure cacti runs out of the box
af389505 181%{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
a0b0ee8a 182
6587a5d5 183%install
94614147 184rm -rf $RPM_BUILD_ROOT
b2c7c665 185install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/{cron.d,logrotate.d},%{_sbindir}}
8c6ff4ca 186install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
e9300b9e 187
3d0c4fef 188cp -p *.php $RPM_BUILD_ROOT%{_appdir}
b2c7c665
AM
189# dirs that contain index.php are likely to be installed
190# ls -1d */index.php | cut -d"/" -f1 | xargs
71281bc3
AM
191cp -a cache/* $RPM_BUILD_ROOT/var/cache/%{name}
192ln -s /var/cache/%{name} $RPM_BUILD_ROOT%{_appdir}/cache
e90920b5 193cp -a cli docs formats images include install lib locales mibs plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
4b6cd69a 194mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
e9300b9e 195
4b6cd69a 196cp -a log $RPM_BUILD_ROOT/var/log/%{name}
81fd7803 197:> $RPM_BUILD_ROOT/var/log/%{name}/%{name}.log
b53d6410 198install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
4b6cd69a 199cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
e9300b9e 200
caa81993 201mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
3d0c4fef
ER
202cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
203cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
4b6cd69a 204
aa6fbcd1
ER
205%if "%{pld_release}" == "ac"
206%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
207%endif
208
3d0c4fef 209cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
e61341ec 210cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
3d0c4fef 211cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
6587a5d5
JB
212
213%clean
94614147 214rm -rf $RPM_BUILD_ROOT
6587a5d5 215
f4a0dd1f
ER
216%pre
217%useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
218
d5d78058
AM
219%pretrans
220if [ -d "%{_appdir}/cache" ] && [ ! -L "%{_appdir}/cache" ]; then
221 mv -v %{_appdir}/cache{,.rpmsave}
222fi
223exit 0
224
4b6cd69a
ER
225%post
226if [ ! -f /var/log/%{name}/cacti.log ]; then
227 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
228fi
229
f4a0dd1f
ER
230%postun
231if [ "$1" = "0" ]; then
232 %userremove cacti
233fi
234
5e284e3e
AM
235%post setup
236%{_appdir}/cli/upgrade_database.php || :
237
4b6cd69a
ER
238%triggerin -- apache1 < 1.3.37-3, apache1-base
239%webapp_register apache %{_webapp}
240
241%triggerun -- apache1 < 1.3.37-3, apache1-base
242%webapp_unregister apache %{_webapp}
243
e61341ec 244%triggerin -- apache < 2.2.0, apache-base
4b6cd69a
ER
245%webapp_register httpd %{_webapp}
246
e61341ec 247%triggerun -- apache < 2.2.0, apache-base
4b6cd69a
ER
248%webapp_unregister httpd %{_webapp}
249
250%triggerin -- lighttpd
251%webapp_register lighttpd %{_webapp}
252
253%triggerun -- lighttpd
254%webapp_unregister lighttpd %{_webapp}
255
256%triggerpostun -- %{name} < 0.8.7b-9.5
257if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
258 cp -f %{_sysconfdir}/config.php{,.rpmnew}
259 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
260fi
261
6587a5d5 262%files
94614147 263%defattr(644,root,root,755)
e90920b5 264%doc README.md CHANGELOG
4b6cd69a
ER
265%dir %attr(750,root,http) %{_sysconfdir}
266%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
267%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
268%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
269%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
270%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
af389505 271%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
4b6cd69a 272%attr(755,root,root) %{_sbindir}/cacti-poller
344e658b 273%dir %{_appdir}
4b6cd69a
ER
274%exclude %{_appdir}/install
275%exclude %{_appdir}/docs
b2c7c665
AM
276%{_appdir}/cache
277%{_appdir}/formats
344e658b 278%{_appdir}/images
b2c7c665
AM
279%{_appdir}/include
280%{_appdir}/lib
0e54cf19 281%{_appdir}/locales
fcd3cd85 282%{_appdir}/mibs
344e658b 283%{_appdir}/plugins
b2c7c665
AM
284%{_appdir}/resource
285%{_appdir}/sql
344e658b
ER
286%{_appdir}/*.php
287
ebacb7e6
ER
288%dir %{_appdir}/cli
289%attr(755,root,root) %{_appdir}/cli/*
290
344e658b
ER
291%dir %{_appdir}/scripts
292%attr(755,root,root) %{_appdir}/scripts/*
4b6cd69a 293
ea4c4a5f
AM
294%attr(750,root,http) %dir /var/lib/%{name}
295%attr(770,root,http) %dir /var/lib/%{name}/rra
4b6cd69a 296%attr(730,root,http) %dir /var/log/%{name}
b53d6410 297%attr(750,root,logs) %dir /var/log/archive/%{name}
4b6cd69a 298%attr(660,root,http) %ghost /var/log/%{name}/cacti.log
8c6ff4ca 299%attr(730,root,http) %dir /var/cache/%{name}
15d44e1a 300/var/cache/%{name}/index.php
71281bc3
AM
301%attr(730,root,http) %dir /var/cache/%{name}/boost
302%attr(730,root,http) %dir /var/cache/%{name}/mibcache
8cc40219 303%attr(770,root,http) %dir /var/cache/%{name}/realtime
71281bc3 304%attr(730,root,http) %dir /var/cache/%{name}/spikekill
15d44e1a
AM
305/var/cache/%{name}/*/.htaccess
306/var/cache/%{name}/*/index.php
4b6cd69a
ER
307
308%files setup
309%defattr(644,root,root,755)
310%{_appdir}/install
311
312%files doc
313%defattr(644,root,root,755)
adf6e05d 314%{_appdir}/docs
This page took 0.163489 seconds and 4 git commands to generate.