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