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