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