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