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