]>
Commit | Line | Data |
---|---|---|
bb0e5568 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without pa # without plugin archidecture patch | |
4 | ||
e90043f8 | 5 | %include /usr/lib/rpm/macros.perl |
9f35c748 | 6 | Summary: Cacti is a PHP frontend for rrdtool |
bf643d4f | 7 | Summary(pl.UTF-8): Cacti - frontend w PHP do rrdtoola |
94614147 | 8 | Name: cacti |
bb0e5568 | 9 | Version: 0.8.7g |
8466638a | 10 | Release: 8 |
6587a5d5 | 11 | License: GPL |
94614147 | 12 | Group: Applications/WWW |
761b4fb2 | 13 | Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz |
bb0e5568 | 14 | # Source0-md5: 268421cb1a58d3444f7ecbddb4c4b016 |
a1abeca3 | 15 | Source2: %{name}.crontab |
de4cec3c GS |
16 | Source3: %{name}-apache.conf |
17 | Source4: %{name}-lighttpd.conf | |
18 | Source5: %{name}-rrdpath.sql | |
817cc464 | 19 | Source6: %{name}-pa.sql |
af389505 | 20 | Source7: %{name}.logrotate |
d7378ed4 | 21 | # http://docs.cacti.net/manual:087:1_installation.9_pia |
8466638a | 22 | Source8: http://mirror.cactiusers.org/downloads/plugins/%{name}-plugin-%{version}-PA-v2.8.tar.gz |
9b55ac11 | 23 | # Source8-md5: de8cbd06fc0d3a6bdc9f0a66da85660d |
8466638a | 24 | # NOTE: update provides: cacti(pia) when updating the patch |
8514c08f | 25 | Patch0: %{name}-PA.patch |
de4cec3c GS |
26 | Patch1: %{name}-config.patch |
27 | Patch2: %{name}-adodb.patch | |
28 | Patch3: %{name}-ioerror.patch | |
29 | Patch4: %{name}-webroot.patch | |
30 | Patch5: %{name}-linux_memory.patch | |
31 | Patch6: %{name}-log-verbosity.patch | |
32 | Patch7: %{name}-ss_disk-array-indices.patch | |
ac01d3f9 AZ |
33 | Patch8: host_name-url.patch |
34 | Patch9: cli-relpath.patch | |
e79e3b18 | 35 | # http://www.cacti.net/download_patches.php |
af389505 ER |
36 | Patch10: data_source_deactivate.patch |
37 | Patch11: graph_list_view.patch | |
38 | Patch12: html_output.patch | |
39 | Patch13: ldap_group_authenication.patch | |
40 | Patch14: script_server_command_line_parse.patch | |
41 | Patch15: ping.patch | |
42 | Patch16: poller_interval.patch | |
761b4fb2 | 43 | URL: http://www.cacti.net/ |
89aea3b3 | 44 | BuildRequires: rpm-perlprov |
344e658b | 45 | BuildRequires: sed >= 4.0 |
f4a0dd1f ER |
46 | Requires(postun): /usr/sbin/userdel |
47 | Requires(pre): /bin/id | |
48 | Requires(pre): /usr/sbin/useradd | |
f44cea91 | 49 | Requires: adodb >= 4.67-1.17 |
e9300b9e | 50 | Requires: crondaemon |
f4a0dd1f | 51 | Requires: group(http) |
94614147 | 52 | Requires: net-snmp-utils |
4e25427a | 53 | Requires: php-cli |
c5421ef6 | 54 | Requires: php-common >= 4:5.2.13-10 |
c5421ef6 ER |
55 | Requires: php-mysql |
56 | Requires: php-pcre | |
57 | Requires: php-session | |
58 | Requires: php-snmp | |
59 | Requires: php-xml | |
c8f292cd | 60 | Requires: rrdtool |
4b6cd69a | 61 | Requires: webapps |
e4f2f951 | 62 | Requires: webserver |
cce68540 | 63 | Requires: webserver(access) |
7d4ec5c1 | 64 | Requires: webserver(alias) |
09dccb3a | 65 | Requires: webserver(indexfile) |
f5a0e42f | 66 | Requires: webserver(php) |
578edcb5 | 67 | Suggests: cacti-spine |
24fa0556 | 68 | Suggests: php-gd |
57305745 | 69 | Provides: cacti(pia) = 2.8 |
f4a0dd1f | 70 | Provides: user(cacti) |
6587a5d5 | 71 | BuildArch: noarch |
94614147 JB |
72 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
73 | ||
4b6cd69a ER |
74 | %define _webapps /etc/webapps |
75 | %define _webapp %{name} | |
76 | %define _sysconfdir %{_webapps}/%{_webapp} | |
77 | %define _appdir /usr/share/%{name} | |
6587a5d5 JB |
78 | |
79 | %description | |
80 | Cacti is a complete frondend to rrdtool, it stores all of the | |
94614147 JB |
81 | nessesary information to create graphs and populate them with data in |
82 | a MySQL database. | |
6587a5d5 | 83 | |
94614147 JB |
84 | The frontend is completely PHP driven. Along with being able to |
85 | maintain Graphs, Data Sources, and Round Robin Archives in a database, | |
86 | cacti handles the data gathering also. There is also SNMP support for | |
87 | those used to creating traffic graphs with MRTG. | |
6587a5d5 | 88 | |
41840fab | 89 | %description -l pl.UTF-8 |
350cedee | 90 | Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie |
bf643d4f ER |
91 | informacje potrzebne do tworzenia wykresów i wypełniające je danymi w |
92 | bazie MySQL. | |
c9dfb888 | 93 | |
350cedee | 94 | Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami, |
bf643d4f ER |
95 | źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje |
96 | także gromadzenie danych. Ma także obsługę SNMP przydatną przy | |
97 | tworzeniu wykresów ruchu przy użyciu MRTG. | |
c9dfb888 | 98 | |
4b6cd69a ER |
99 | %package setup |
100 | Summary: Cacti setup package | |
101 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti | |
102 | Group: Applications/WWW | |
103 | Requires: %{name} = %{version}-%{release} | |
d6d42868 | 104 | Suggests: %{name}-doc = %{version}-%{release} |
4b6cd69a ER |
105 | |
106 | %description setup | |
107 | Install this package to configure initial Cacti installation. You | |
108 | should uninstall this package when you're done, as it considered | |
109 | insecure to keep the setup files in place. | |
110 | ||
a40c4ad5 JB |
111 | %description setup -l pl.UTF-8 |
112 | Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację | |
113 | Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego | |
114 | obecność może być niebezpieczna. | |
115 | ||
4b6cd69a ER |
116 | %package doc |
117 | Summary: HTML Documentation for Cacti | |
a40c4ad5 | 118 | Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML |
4b6cd69a ER |
119 | Group: Documentation |
120 | Requires: %{name} = %{version}-%{release} | |
121 | ||
122 | %description doc | |
123 | HTML Documentation for Cacti. | |
124 | ||
a40c4ad5 JB |
125 | %description doc -l pl.UTF-8 |
126 | Dokumentacja do Cacti w formacie HTML. | |
127 | ||
6587a5d5 | 128 | %prep |
8466638a | 129 | %setup -q %{?with_pa:-a8} |
482f9753 | 130 | # official patches |
af389505 ER |
131 | %patch10 -p1 |
132 | %patch11 -p1 | |
133 | %patch12 -p1 | |
134 | %patch13 -p1 | |
135 | %patch14 -p1 | |
136 | %patch15 -p1 | |
137 | %patch16 -p1 | |
e79e3b18 | 138 | |
8466638a ER |
139 | %if %{with pa} |
140 | %patch0 -p1 | |
141 | # copy images and drop the rest | |
142 | mv cacti-plugin-arch/files-%{version}/images/* images | |
143 | %{__rm} -r cacti-plugin-arch | |
144 | %endif | |
482f9753 | 145 | |
0482abbd | 146 | %patch1 -p1 |
f23be293 | 147 | %patch2 -p1 |
14544804 | 148 | %patch3 -p1 |
d6d42868 ER |
149 | %patch4 -p1 |
150 | %patch5 -p1 | |
151 | %patch6 -p1 | |
5e8efd1f | 152 | %patch7 -p1 |
de4cec3c | 153 | %patch8 -p1 |
fe418db4 | 154 | %patch9 -p1 |
6587a5d5 | 155 | |
4b6cd69a ER |
156 | mkdir -p sql |
157 | mv *.sql sql | |
86a72dca | 158 | # you should run this sql if your database contains path to %{_datadir}... |
de4cec3c | 159 | cp %{SOURCE5} sql |
817cc464 | 160 | cp %{SOURCE6} sql |
4b6cd69a | 161 | |
af389505 ER |
162 | %{__rm} -r lib/adodb |
163 | %{__rm} log/.htaccess | |
164 | %{__rm} cli/.htaccess | |
af389505 | 165 | %{__rm} rra/.htaccess |
344e658b | 166 | |
93d2fa9c ER |
167 | # must require libs to get fatals on missing files, not include |
168 | %{__sed} -i -e ' | |
169 | s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");, | |
170 | s,include_once,require_once, | |
171 | ' cli/*.php | |
172 | ||
c68d3a6e ER |
173 | # make sure scripts have php shebang |
174 | %{__sed} -i -e '1{ | |
175 | /bin.php/!i#!%{_bindir}/php | |
176 | }' scripts/*.php cli/*.php | |
6587a5d5 | 177 | |
c68d3a6e | 178 | chmod a+rx scripts/*.php cli/*.php |
ebacb7e6 | 179 | |
f4a0dd1f ER |
180 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
181 | ||
a0b0ee8a | 182 | # make sure cacti runs out of the box |
af389505 | 183 | %{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql |
a0b0ee8a | 184 | |
6587a5d5 | 185 | %install |
94614147 | 186 | rm -rf $RPM_BUILD_ROOT |
af389505 | 187 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/{cron.d,logrotate.d},%{_sbindir}} |
8c6ff4ca | 188 | install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}} |
e9300b9e | 189 | |
4b6cd69a | 190 | cp -a *.php $RPM_BUILD_ROOT%{_appdir} |
de4cec3c | 191 | cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir} |
4b6cd69a ER |
192 | cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html |
193 | mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller} | |
e9300b9e | 194 | |
4b6cd69a ER |
195 | cp -a log $RPM_BUILD_ROOT/var/log/%{name} |
196 | cp -a rra $RPM_BUILD_ROOT/var/lib/%{name} | |
e9300b9e | 197 | |
caa81993 | 198 | mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php |
4b6cd69a | 199 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name} |
af389505 | 200 | cp -a %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
4b6cd69a | 201 | |
de4cec3c GS |
202 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
203 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
204 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
6587a5d5 JB |
205 | |
206 | %clean | |
94614147 | 207 | rm -rf $RPM_BUILD_ROOT |
6587a5d5 | 208 | |
f4a0dd1f ER |
209 | %pre |
210 | %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti | |
211 | ||
4b6cd69a ER |
212 | %post |
213 | if [ ! -f /var/log/%{name}/cacti.log ]; then | |
214 | install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log | |
215 | fi | |
216 | ||
f4a0dd1f ER |
217 | %postun |
218 | if [ "$1" = "0" ]; then | |
219 | %userremove cacti | |
220 | fi | |
221 | ||
4b6cd69a ER |
222 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
223 | %webapp_register apache %{_webapp} | |
224 | ||
225 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
226 | %webapp_unregister apache %{_webapp} | |
227 | ||
228 | %triggerin -- apache < 2.2.0, apache-base | |
229 | %webapp_register httpd %{_webapp} | |
230 | ||
231 | %triggerun -- apache < 2.2.0, apache-base | |
232 | %webapp_unregister httpd %{_webapp} | |
233 | ||
234 | %triggerin -- lighttpd | |
235 | %webapp_register lighttpd %{_webapp} | |
236 | ||
237 | %triggerun -- lighttpd | |
238 | %webapp_unregister lighttpd %{_webapp} | |
239 | ||
240 | %triggerpostun -- %{name} < 0.8.7b-9.5 | |
241 | if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then | |
242 | cp -f %{_sysconfdir}/config.php{,.rpmnew} | |
243 | mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php | |
244 | fi | |
245 | ||
6587a5d5 | 246 | %files |
94614147 | 247 | %defattr(644,root,root,755) |
e4aad445 | 248 | %doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt |
4b6cd69a ER |
249 | %dir %attr(750,root,http) %{_sysconfdir} |
250 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
251 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
252 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
253 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
254 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name} | |
af389505 | 255 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} |
4b6cd69a | 256 | %attr(755,root,root) %{_sbindir}/cacti-poller |
344e658b | 257 | %dir %{_appdir} |
4b6cd69a ER |
258 | %exclude %{_appdir}/install |
259 | %exclude %{_appdir}/docs | |
344e658b ER |
260 | %{_appdir}/resource |
261 | %{_appdir}/sql | |
262 | %{_appdir}/lib | |
263 | %{_appdir}/include | |
264 | %{_appdir}/images | |
344e658b ER |
265 | %{_appdir}/plugins |
266 | %{_appdir}/*.php | |
267 | ||
ebacb7e6 ER |
268 | %dir %{_appdir}/cli |
269 | %attr(755,root,root) %{_appdir}/cli/* | |
270 | ||
344e658b ER |
271 | %dir %{_appdir}/scripts |
272 | %attr(755,root,root) %{_appdir}/scripts/* | |
4b6cd69a | 273 | |
ea4c4a5f AM |
274 | %attr(750,root,http) %dir /var/lib/%{name} |
275 | %attr(770,root,http) %dir /var/lib/%{name}/rra | |
4b6cd69a ER |
276 | %attr(730,root,http) %dir /var/log/%{name} |
277 | %attr(660,root,http) %ghost /var/log/%{name}/cacti.log | |
8c6ff4ca | 278 | %attr(730,root,http) %dir /var/cache/%{name} |
4b6cd69a ER |
279 | |
280 | %files setup | |
281 | %defattr(644,root,root,755) | |
282 | %{_appdir}/install | |
283 | ||
284 | %files doc | |
285 | %defattr(644,root,root,755) | |
adf6e05d | 286 | %{_appdir}/docs |