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