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