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