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