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