]> git.pld-linux.org Git - packages/cacti.git/blame - cacti.spec
- require php with not broken xml, php5 is now minimum dep; rel 9
[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
c5421ef6 6Release: 9
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
8514c08f
ER
17Patch100: http://www.cacti.net/downloads/patches/0.8.7e/cli_add_graph.patch
18Patch101: http://www.cacti.net/downloads/patches/0.8.7e/snmp_invalid_response.patch
19Patch102: http://www.cacti.net/downloads/patches/0.8.7e/template_duplication.patch
20Patch103: http://www.cacti.net/downloads/patches/0.8.7e/fix_icmp_on_windows_iis_servers.patch
21Patch104: http://www.cacti.net/downloads/patches/0.8.7e/cross_site_fix.patch
22# http://cactiusers.org/wiki/PluginArchitectureInstall
23# http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7e-PA-v2.6.zip
24Patch0: %{name}-PA.patch
de4cec3c
GS
25Patch1: %{name}-config.patch
26Patch2: %{name}-adodb.patch
27Patch3: %{name}-ioerror.patch
28Patch4: %{name}-webroot.patch
29Patch5: %{name}-linux_memory.patch
30Patch6: %{name}-log-verbosity.patch
31Patch7: %{name}-ss_disk-array-indices.patch
32Patch8: %{name}-rrdresourcecheck.patch
fe418db4 33Patch9: host_name-url.patch
90e49c71 34Patch10: cli-relpath.patch
761b4fb2 35URL: http://www.cacti.net/
89aea3b3 36BuildRequires: rpm-perlprov
344e658b 37BuildRequires: sed >= 4.0
f4a0dd1f
ER
38Requires(postun): /usr/sbin/userdel
39Requires(pre): /bin/id
40Requires(pre): /usr/sbin/useradd
f44cea91 41Requires: adodb >= 4.67-1.17
e9300b9e 42Requires: crondaemon
f4a0dd1f 43Requires: group(http)
94614147 44Requires: net-snmp-utils
4e25427a 45Requires: php-cli
c5421ef6
ER
46Requires: php-common >= 4:5.2.13-10
47Requires: php-gd
48Requires: php-mysql
49Requires: php-pcre
50Requires: php-session
51Requires: php-snmp
52Requires: php-xml
c8f292cd 53Requires: rrdtool
4b6cd69a 54Requires: webapps
e4f2f951 55Requires: webserver
cce68540 56Requires: webserver(access)
7d4ec5c1 57Requires: webserver(alias)
09dccb3a 58Requires: webserver(indexfile)
f5a0e42f 59Requires: webserver(php)
578edcb5 60Suggests: cacti-spine
f4a0dd1f 61Provides: user(cacti)
6587a5d5 62BuildArch: noarch
94614147
JB
63BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
4b6cd69a
ER
65%define _webapps /etc/webapps
66%define _webapp %{name}
67%define _sysconfdir %{_webapps}/%{_webapp}
68%define _appdir /usr/share/%{name}
6587a5d5
JB
69
70%description
71Cacti is a complete frondend to rrdtool, it stores all of the
94614147
JB
72nessesary information to create graphs and populate them with data in
73a MySQL database.
6587a5d5 74
94614147
JB
75The frontend is completely PHP driven. Along with being able to
76maintain Graphs, Data Sources, and Round Robin Archives in a database,
77cacti handles the data gathering also. There is also SNMP support for
78those used to creating traffic graphs with MRTG.
6587a5d5 79
41840fab 80%description -l pl.UTF-8
350cedee 81Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
bf643d4f
ER
82informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
83bazie MySQL.
c9dfb888 84
350cedee 85Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
bf643d4f
ER
86źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
87także gromadzenie danych. Ma także obsługę SNMP przydatną przy
88tworzeniu wykresów ruchu przy użyciu MRTG.
c9dfb888 89
4b6cd69a
ER
90%package setup
91Summary: Cacti setup package
92Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti
93Group: Applications/WWW
94Requires: %{name} = %{version}-%{release}
d6d42868 95Suggests: %{name}-doc = %{version}-%{release}
4b6cd69a
ER
96
97%description setup
98Install this package to configure initial Cacti installation. You
99should uninstall this package when you're done, as it considered
100insecure to keep the setup files in place.
101
a40c4ad5
JB
102%description setup -l pl.UTF-8
103Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
104Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
105obecność może być niebezpieczna.
106
4b6cd69a
ER
107%package doc
108Summary: HTML Documentation for Cacti
a40c4ad5 109Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML
4b6cd69a
ER
110Group: Documentation
111Requires: %{name} = %{version}-%{release}
112
113%description doc
114HTML Documentation for Cacti.
115
a40c4ad5
JB
116%description doc -l pl.UTF-8
117Dokumentacja do Cacti w formacie HTML.
118
6587a5d5 119%prep
de4cec3c 120%setup -q
8514c08f
ER
121%patch100 -p1
122%patch101 -p1
123%patch102 -p1
124%patch103 -p1
125%patch104 -p1
ebacb7e6 126%patch0 -p1
0482abbd 127%patch1 -p1
f23be293 128%patch2 -p1
14544804 129%patch3 -p1
d6d42868
ER
130%patch4 -p1
131%patch5 -p1
132%patch6 -p1
5e8efd1f 133%patch7 -p1
de4cec3c 134%patch8 -p1
fe418db4 135%patch9 -p1
90e49c71 136%patch10 -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}...
de4cec3c 141cp %{SOURCE5} sql
817cc464 142cp %{SOURCE6} sql
4b6cd69a 143
4b6cd69a 144rm -rf cacti-plugin-arch
f44cea91 145rm -rf lib/adodb
4b6cd69a 146rm -f log/.htaccess
ebacb7e6 147rm -f cli/.htaccess
4b6cd69a 148rm -f rra/.placeholder
344e658b 149
93d2fa9c
ER
150# must require libs to get fatals on missing files, not include
151%{__sed} -i -e '
152 s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
153 s,include_once,require_once,
154' cli/*.php
155
c68d3a6e
ER
156# make sure scripts have php shebang
157%{__sed} -i -e '1{
158 /bin.php/!i#!%{_bindir}/php
159}' scripts/*.php cli/*.php
6587a5d5 160
c68d3a6e 161chmod a+rx scripts/*.php cli/*.php
ebacb7e6 162
f4a0dd1f
ER
163find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
164
e4aad445
ER
165rm log/.placeholder
166
a0b0ee8a
MM
167# make sure cacti runs out of the box
168sed -e "s,new_install,%{version}," -i sql/cacti.sql
169
6587a5d5 170%install
94614147 171rm -rf $RPM_BUILD_ROOT
de4cec3c 172install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/cron.d,%{_sbindir}}
c7a01fb3 173install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
e9300b9e 174
4b6cd69a 175cp -a *.php $RPM_BUILD_ROOT%{_appdir}
de4cec3c 176cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
4b6cd69a
ER
177cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
178mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
e9300b9e 179
4b6cd69a
ER
180cp -a log $RPM_BUILD_ROOT/var/log/%{name}
181cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
e9300b9e 182
4b6cd69a 183cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
4b6cd69a
ER
184cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
185
de4cec3c
GS
186cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
187cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
188cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
6587a5d5
JB
189
190%clean
94614147 191rm -rf $RPM_BUILD_ROOT
6587a5d5 192
f4a0dd1f
ER
193%pre
194%useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
195
4b6cd69a
ER
196%post
197if [ ! -f /var/log/%{name}/cacti.log ]; then
198 install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
199fi
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
212%triggerin -- apache < 2.2.0, apache-base
213%webapp_register httpd %{_webapp}
214
215%triggerun -- apache < 2.2.0, apache-base
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}
239%attr(755,root,root) %{_sbindir}/cacti-poller
344e658b 240%dir %{_appdir}
4b6cd69a
ER
241%exclude %{_appdir}/install
242%exclude %{_appdir}/docs
344e658b
ER
243%{_appdir}/resource
244%{_appdir}/sql
245%{_appdir}/lib
246%{_appdir}/include
247%{_appdir}/images
344e658b
ER
248%{_appdir}/plugins
249%{_appdir}/*.php
250
ebacb7e6
ER
251%dir %{_appdir}/cli
252%attr(755,root,root) %{_appdir}/cli/*
253
344e658b
ER
254%dir %{_appdir}/scripts
255%attr(755,root,root) %{_appdir}/scripts/*
4b6cd69a 256
ea4c4a5f
AM
257%attr(750,root,http) %dir /var/lib/%{name}
258%attr(770,root,http) %dir /var/lib/%{name}/rra
4b6cd69a
ER
259%attr(730,root,http) %dir /var/log/%{name}
260%attr(660,root,http) %ghost /var/log/%{name}/cacti.log
261
262%files setup
263%defattr(644,root,root,755)
264%{_appdir}/install
265
266%files doc
267%defattr(644,root,root,755)
adf6e05d 268%{_appdir}/docs
This page took 0.183775 seconds and 4 git commands to generate.