]> git.pld-linux.org Git - packages/cacti.git/blame - cacti.spec
- uses php filter json mbstring modules
[packages/cacti.git] / cacti.spec
CommitLineData
bc79e792 1%define pia_ver 3.1
4780a883
ER
2%define php_min_version 5.2.13-10
3%include /usr/lib/rpm/macros.php
9f35c748 4Summary: Cacti is a PHP frontend for rrdtool
bf643d4f 5Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola
94614147 6Name: cacti
4dc8dfe7 7Version: 1.1.28
81fd7803 8Release: 0.1
bc79e792 9License: GPL v2
94614147 10Group: Applications/WWW
ffbcce38 11Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
4dc8dfe7 12# Source0-md5: 8ad64ec03da234a207bcb50e97ad8cc9
a1abeca3 13Source2: %{name}.crontab
de4cec3c
GS
14Source3: %{name}-apache.conf
15Source4: %{name}-lighttpd.conf
16Source5: %{name}-rrdpath.sql
af389505 17Source7: %{name}.logrotate
81fd7803 18
de4cec3c 19Patch1: %{name}-config.patch
81fd7803 20
de4cec3c
GS
21Patch3: %{name}-ioerror.patch
22Patch4: %{name}-webroot.patch
23Patch5: %{name}-linux_memory.patch
24Patch6: %{name}-log-verbosity.patch
25Patch7: %{name}-ss_disk-array-indices.patch
ac01d3f9 26Patch8: host_name-url.patch
e79e3b18 27# http://www.cacti.net/download_patches.php
08cf4295 28# Patch100: ..
855dc8ae 29URL: http://www.cacti.net/
344e658b 30BuildRequires: sed >= 4.0
f4a0dd1f
ER
31Requires(postun): /usr/sbin/userdel
32Requires(pre): /bin/id
33Requires(pre): /usr/sbin/useradd
bc79e792 34Requires: cacti-plugin-boost >= 5.0
e9300b9e 35Requires: crondaemon
f4a0dd1f 36Requires: group(http)
94614147 37Requires: net-snmp-utils
4780a883 38Requires: php(core) >= %{php_min_version}
a9ce9d89
AM
39Requires: php(filter)
40Requires: php(json)
41Requires: php(mbstring)
6e11204f 42Requires: php(pcre)
fc151646 43Requires: php(pdo-mysql)
6e11204f
ER
44Requires: php(session)
45Requires: php(snmp)
46Requires: php(xml)
c8f292cd 47Requires: rrdtool
4b6cd69a 48Requires: webapps
e4f2f951 49Requires: webserver
cce68540 50Requires: webserver(access)
7d4ec5c1 51Requires: webserver(alias)
09dccb3a 52Requires: webserver(indexfile)
f5a0e42f 53Requires: webserver(php)
578edcb5 54Suggests: cacti-spine
e38b8207
ER
55Suggests: php(bcmath)
56Suggests: php(ftp)
57Suggests: php(gd)
d839b321 58Provides: cacti(pia) = %{pia_ver}
f4a0dd1f 59Provides: user(cacti)
33c70cd1 60Obsoletes: cacti-add_template
9f8f6fd2 61Obsoletes: cacti-plugin-update
aa6fbcd1 62%if "%{pld_release}" != "ac"
6e11204f 63Conflicts: logrotate < 3.8.0
aa6fbcd1 64%endif
6587a5d5 65BuildArch: noarch
94614147
JB
66BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
4b6cd69a
ER
68%define _webapps /etc/webapps
69%define _webapp %{name}
70%define _sysconfdir %{_webapps}/%{_webapp}
71%define _appdir /usr/share/%{name}
6587a5d5 72
4780a883
ER
73# bad depsolver
74%define _noautopear pear
d6d94c67
ER
75# optional
76%define _noautophp php-ftp php-bcmath
4780a883
ER
77
78# put it together for rpmbuild
79%define _noautoreq %{?_noautophp} %{?_noautopear}
80
6587a5d5
JB
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
ffbcce38 131%setup -q
4a9821cf 132
482f9753 133# official patches
4a9821cf
ER
134%if 0%{?PATCH100:1}
135%patch100 -p1
136%endif
482f9753 137
0482abbd 138%patch1 -p1
81fd7803 139
14544804 140%patch3 -p1
d6d42868
ER
141%patch4 -p1
142%patch5 -p1
143%patch6 -p1
5e8efd1f 144%patch7 -p1
81fd7803
AM
145# ?
146# %patch8 -p1
6587a5d5 147
4b6cd69a
ER
148mkdir -p sql
149mv *.sql sql
86a72dca 150# you should run this sql if your database contains path to %{_datadir}...
3d0c4fef 151cp -p %{SOURCE5} sql
4b6cd69a 152
af389505
ER
153%{__rm} log/.htaccess
154%{__rm} cli/.htaccess
af389505 155%{__rm} rra/.htaccess
344e658b 156
93d2fa9c
ER
157# must require libs to get fatals on missing files, not include
158%{__sed} -i -e '
159 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
160 s,include_once,require_once,
161' cli/*.php
162
c68d3a6e
ER
163# make sure scripts have php shebang
164%{__sed} -i -e '1{
165 /bin.php/!i#!%{_bindir}/php
166}' scripts/*.php cli/*.php
6587a5d5 167
c68d3a6e 168chmod a+rx scripts/*.php cli/*.php
ebacb7e6 169
f4a0dd1f
ER
170find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
171
a0b0ee8a 172# make sure cacti runs out of the box
af389505 173%{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
a0b0ee8a 174
6587a5d5 175%install
94614147 176rm -rf $RPM_BUILD_ROOT
b2c7c665 177install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/{cron.d,logrotate.d},%{_sbindir}}
8c6ff4ca 178install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
e9300b9e 179
3d0c4fef 180cp -p *.php $RPM_BUILD_ROOT%{_appdir}
b2c7c665
AM
181# dirs that contain index.php are likely to be installed
182# ls -1d */index.php | cut -d"/" -f1 | xargs
0e54cf19 183cp -a cache cli formats images include install lib locales mibs plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
4b6cd69a
ER
184cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
185mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
e9300b9e 186
4b6cd69a 187cp -a log $RPM_BUILD_ROOT/var/log/%{name}
81fd7803 188:> $RPM_BUILD_ROOT/var/log/%{name}/%{name}.log
b53d6410 189install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
4b6cd69a 190cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
e9300b9e 191
caa81993 192mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
3d0c4fef
ER
193cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
194cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
4b6cd69a 195
aa6fbcd1
ER
196%if "%{pld_release}" == "ac"
197%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
198%endif
199
3d0c4fef 200cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
e61341ec 201cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
3d0c4fef 202cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
6587a5d5
JB
203
204%clean
94614147 205rm -rf $RPM_BUILD_ROOT
6587a5d5 206
f4a0dd1f
ER
207%pre
208%useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
209
4b6cd69a
ER
210%post
211if [ ! -f /var/log/%{name}/cacti.log ]; then
212 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
213fi
214
f4a0dd1f
ER
215%postun
216if [ "$1" = "0" ]; then
217 %userremove cacti
218fi
219
5e284e3e
AM
220%post setup
221%{_appdir}/cli/upgrade_database.php || :
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
e61341ec 229%triggerin -- apache < 2.2.0, apache-base
4b6cd69a
ER
230%webapp_register httpd %{_webapp}
231
e61341ec 232%triggerun -- apache < 2.2.0, apache-base
4b6cd69a
ER
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)
81fd7803 249%doc README.md docs/CHANGELOG 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
b2c7c665
AM
261%{_appdir}/cache
262%{_appdir}/formats
344e658b 263%{_appdir}/images
b2c7c665
AM
264%{_appdir}/include
265%{_appdir}/lib
0e54cf19 266%{_appdir}/locales
fcd3cd85 267%{_appdir}/mibs
344e658b 268%{_appdir}/plugins
b2c7c665
AM
269%{_appdir}/resource
270%{_appdir}/sql
344e658b
ER
271%{_appdir}/*.php
272
ebacb7e6
ER
273%dir %{_appdir}/cli
274%attr(755,root,root) %{_appdir}/cli/*
275
344e658b
ER
276%dir %{_appdir}/scripts
277%attr(755,root,root) %{_appdir}/scripts/*
4b6cd69a 278
ea4c4a5f
AM
279%attr(750,root,http) %dir /var/lib/%{name}
280%attr(770,root,http) %dir /var/lib/%{name}/rra
4b6cd69a 281%attr(730,root,http) %dir /var/log/%{name}
b53d6410 282%attr(750,root,logs) %dir /var/log/archive/%{name}
4b6cd69a 283%attr(660,root,http) %ghost /var/log/%{name}/cacti.log
8c6ff4ca 284%attr(730,root,http) %dir /var/cache/%{name}
4b6cd69a
ER
285
286%files setup
287%defattr(644,root,root,755)
288%{_appdir}/install
289
290%files doc
291%defattr(644,root,root,755)
adf6e05d 292%{_appdir}/docs
This page took 0.174926 seconds and 4 git commands to generate.