]> git.pld-linux.org Git - packages/cacti.git/blame - cacti.spec
make logrotate compatible with ac
[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
7304c27a 7Version: 0.8.8f
08cf4295 8Release: 1
bc79e792 9License: GPL v2
94614147 10Group: Applications/WWW
ffbcce38 11Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
7304c27a 12# Source0-md5: 8d90642b362f80c46c489c5531e2ba90
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
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
f44cea91 34Requires: adodb >= 4.67-1.17
bc79e792 35Requires: cacti-plugin-boost >= 5.0
e9300b9e 36Requires: crondaemon
f4a0dd1f 37Requires: group(http)
94614147 38Requires: net-snmp-utils
4780a883 39Requires: php(core) >= %{php_min_version}
6e11204f
ER
40Requires: php(mysql)
41Requires: php(pcre)
42Requires: php(session)
43Requires: php(snmp)
44Requires: php(xml)
c8f292cd 45Requires: rrdtool
4b6cd69a 46Requires: webapps
e4f2f951 47Requires: webserver
cce68540 48Requires: webserver(access)
7d4ec5c1 49Requires: webserver(alias)
09dccb3a 50Requires: webserver(indexfile)
f5a0e42f 51Requires: webserver(php)
578edcb5 52Suggests: cacti-spine
d6d94c67
ER
53Suggests: php-bcmath
54Suggests: php-ftp
24fa0556 55Suggests: php-gd
d839b321 56Provides: cacti(pia) = %{pia_ver}
f4a0dd1f 57Provides: user(cacti)
33c70cd1 58Obsoletes: cacti-add_template
9f8f6fd2 59Obsoletes: cacti-plugin-update
aa6fbcd1 60%if "%{pld_release}" != "ac"
6e11204f 61Conflicts: logrotate < 3.8.0
aa6fbcd1 62%endif
6587a5d5 63BuildArch: noarch
94614147
JB
64BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
4b6cd69a
ER
66%define _webapps /etc/webapps
67%define _webapp %{name}
68%define _sysconfdir %{_webapps}/%{_webapp}
69%define _appdir /usr/share/%{name}
6587a5d5 70
4780a883
ER
71# bad depsolver
72%define _noautopear pear
d6d94c67
ER
73# optional
74%define _noautophp php-ftp php-bcmath
4780a883
ER
75
76# put it together for rpmbuild
77%define _noautoreq %{?_noautophp} %{?_noautopear}
78
6587a5d5
JB
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
ffbcce38 129%setup -q
4a9821cf 130
482f9753 131# official patches
4a9821cf
ER
132%if 0%{?PATCH100:1}
133%patch100 -p1
134%endif
482f9753 135
cfee1525 136%patch0 -p1
0482abbd 137%patch1 -p1
f23be293 138%patch2 -p1
14544804 139%patch3 -p1
d6d42868
ER
140%patch4 -p1
141%patch5 -p1
142%patch6 -p1
5e8efd1f 143%patch7 -p1
de4cec3c 144%patch8 -p1
6587a5d5 145
4b6cd69a
ER
146mkdir -p sql
147mv *.sql sql
86a72dca 148# you should run this sql if your database contains path to %{_datadir}...
3d0c4fef 149cp -p %{SOURCE5} sql
4b6cd69a 150
af389505
ER
151%{__rm} -r lib/adodb
152%{__rm} log/.htaccess
153%{__rm} cli/.htaccess
af389505 154%{__rm} rra/.htaccess
344e658b 155
93d2fa9c
ER
156# must require libs to get fatals on missing files, not include
157%{__sed} -i -e '
158 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
159 s,include_once,require_once,
160' cli/*.php
161
c68d3a6e
ER
162# make sure scripts have php shebang
163%{__sed} -i -e '1{
164 /bin.php/!i#!%{_bindir}/php
165}' scripts/*.php cli/*.php
6587a5d5 166
c68d3a6e 167chmod a+rx scripts/*.php cli/*.php
ebacb7e6 168
f4a0dd1f
ER
169find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
170
a0b0ee8a 171# make sure cacti runs out of the box
af389505 172%{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
a0b0ee8a 173
6587a5d5 174%install
94614147 175rm -rf $RPM_BUILD_ROOT
af389505 176install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/{cron.d,logrotate.d},%{_sbindir}}
8c6ff4ca 177install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
e9300b9e 178
3d0c4fef 179cp -p *.php $RPM_BUILD_ROOT%{_appdir}
de4cec3c 180cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
4b6cd69a
ER
181cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
182mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
e9300b9e 183
4b6cd69a 184cp -a log $RPM_BUILD_ROOT/var/log/%{name}
b53d6410 185install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
4b6cd69a 186cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
e9300b9e 187
caa81993 188mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
3d0c4fef
ER
189cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
190cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
4b6cd69a 191
aa6fbcd1
ER
192%if "%{pld_release}" == "ac"
193%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
194%endif
195
3d0c4fef 196cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
e61341ec 197cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
3d0c4fef 198cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
6587a5d5
JB
199
200%clean
94614147 201rm -rf $RPM_BUILD_ROOT
6587a5d5 202
f4a0dd1f
ER
203%pre
204%useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
205
4b6cd69a
ER
206%post
207if [ ! -f /var/log/%{name}/cacti.log ]; then
208 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
209fi
210
f4a0dd1f
ER
211%postun
212if [ "$1" = "0" ]; then
213 %userremove cacti
214fi
215
5e284e3e
AM
216%post setup
217%{_appdir}/cli/upgrade_database.php || :
218
4b6cd69a
ER
219%triggerin -- apache1 < 1.3.37-3, apache1-base
220%webapp_register apache %{_webapp}
221
222%triggerun -- apache1 < 1.3.37-3, apache1-base
223%webapp_unregister apache %{_webapp}
224
e61341ec 225%triggerin -- apache < 2.2.0, apache-base
4b6cd69a
ER
226%webapp_register httpd %{_webapp}
227
e61341ec 228%triggerun -- apache < 2.2.0, apache-base
4b6cd69a
ER
229%webapp_unregister httpd %{_webapp}
230
231%triggerin -- lighttpd
232%webapp_register lighttpd %{_webapp}
233
234%triggerun -- lighttpd
235%webapp_unregister lighttpd %{_webapp}
236
237%triggerpostun -- %{name} < 0.8.7b-9.5
238if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
239 cp -f %{_sysconfdir}/config.php{,.rpmnew}
240 mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
241fi
242
6587a5d5 243%files
94614147 244%defattr(644,root,root,755)
e4aad445 245%doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt
4b6cd69a
ER
246%dir %attr(750,root,http) %{_sysconfdir}
247%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
248%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
249%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
250%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
251%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
af389505 252%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
4b6cd69a 253%attr(755,root,root) %{_sbindir}/cacti-poller
344e658b 254%dir %{_appdir}
4b6cd69a
ER
255%exclude %{_appdir}/install
256%exclude %{_appdir}/docs
344e658b
ER
257%{_appdir}/resource
258%{_appdir}/sql
259%{_appdir}/lib
260%{_appdir}/include
261%{_appdir}/images
344e658b
ER
262%{_appdir}/plugins
263%{_appdir}/*.php
264
ebacb7e6
ER
265%dir %{_appdir}/cli
266%attr(755,root,root) %{_appdir}/cli/*
267
344e658b
ER
268%dir %{_appdir}/scripts
269%attr(755,root,root) %{_appdir}/scripts/*
4b6cd69a 270
ea4c4a5f
AM
271%attr(750,root,http) %dir /var/lib/%{name}
272%attr(770,root,http) %dir /var/lib/%{name}/rra
4b6cd69a 273%attr(730,root,http) %dir /var/log/%{name}
b53d6410 274%attr(750,root,logs) %dir /var/log/archive/%{name}
4b6cd69a 275%attr(660,root,http) %ghost /var/log/%{name}/cacti.log
8c6ff4ca 276%attr(730,root,http) %dir /var/cache/%{name}
4b6cd69a
ER
277
278%files setup
279%defattr(644,root,root,755)
280%{_appdir}/install
281
282%files doc
283%defattr(644,root,root,755)
adf6e05d 284%{_appdir}/docs
This page took 0.164359 seconds and 4 git commands to generate.