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