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