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