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