]>
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 |
50df8396 | 5 | Version: 0.8.7b |
65956105 | 6 | Release: 10 |
6587a5d5 | 7 | License: GPL |
94614147 | 8 | Group: Applications/WWW |
761b4fb2 | 9 | Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz |
50df8396 | 10 | # Source0-md5: 63ffca5735b60bc33c68bc880f0e8042 |
f4a0dd1f | 11 | Source1: %{name}.cfg.php |
a1abeca3 | 12 | Source2: %{name}.crontab |
4b6cd69a | 13 | Source3: http://cactiusers.org/downloads/%{name}-plugin-arch.tar.gz |
42ad0a97 | 14 | # Source3-md5: 7079c1f366e8ea1b26c7e251e6373226 |
4b6cd69a ER |
15 | Source4: %{name}-apache.conf |
16 | Source5: %{name}-lighttpd.conf | |
86a72dca | 17 | Source6: %{name}-rrdpath.sql |
de000c48 | 18 | Patch1: %{name}-upgrade_from_086k_fix.patch |
f23be293 | 19 | Patch2: http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch |
14544804 | 20 | Patch3: http://www.cacti.net/downloads/patches/0.8.7b/reset_each_patch.patch |
d6d42868 ER |
21 | Patch4: %{name}-config.patch |
22 | Patch5: %{name}-adodb.patch | |
23 | Patch6: %{name}-ioerror.patch | |
30aaaddb | 24 | Patch7: %{name}-webroot.patch |
7d9bb249 | 25 | Patch8: %{name}-linux_memory.patch |
86a72dca | 26 | Patch9: %{name}-log-verbosity.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) | |
40 | Requires: php(snmp) | |
41 | Requires: php(xml) | |
4e25427a | 42 | Requires: php-cli |
94614147 | 43 | Requires: rrdtool |
4b6cd69a | 44 | Requires: webapps |
e4f2f951 | 45 | Requires: webserver |
f5a0e42f | 46 | Requires: webserver(php) |
578edcb5 | 47 | Suggests: cacti-spine |
f4a0dd1f | 48 | Provides: user(cacti) |
6587a5d5 | 49 | BuildArch: noarch |
94614147 JB |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
4b6cd69a ER |
52 | %define _webapps /etc/webapps |
53 | %define _webapp %{name} | |
54 | %define _sysconfdir %{_webapps}/%{_webapp} | |
55 | %define _appdir /usr/share/%{name} | |
6587a5d5 JB |
56 | |
57 | %description | |
58 | Cacti is a complete frondend to rrdtool, it stores all of the | |
94614147 JB |
59 | nessesary information to create graphs and populate them with data in |
60 | a MySQL database. | |
6587a5d5 | 61 | |
94614147 JB |
62 | The frontend is completely PHP driven. Along with being able to |
63 | maintain Graphs, Data Sources, and Round Robin Archives in a database, | |
64 | cacti handles the data gathering also. There is also SNMP support for | |
65 | those used to creating traffic graphs with MRTG. | |
6587a5d5 | 66 | |
41840fab | 67 | %description -l pl.UTF-8 |
350cedee | 68 | Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie |
bf643d4f ER |
69 | informacje potrzebne do tworzenia wykresów i wypełniające je danymi w |
70 | bazie MySQL. | |
c9dfb888 | 71 | |
350cedee | 72 | Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami, |
bf643d4f ER |
73 | źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje |
74 | także gromadzenie danych. Ma także obsługę SNMP przydatną przy | |
75 | tworzeniu wykresów ruchu przy użyciu MRTG. | |
c9dfb888 | 76 | |
4b6cd69a ER |
77 | %package setup |
78 | Summary: Cacti setup package | |
79 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji Cacti | |
80 | Group: Applications/WWW | |
81 | Requires: %{name} = %{version}-%{release} | |
d6d42868 | 82 | Suggests: %{name}-doc = %{version}-%{release} |
4b6cd69a ER |
83 | |
84 | %description setup | |
85 | Install this package to configure initial Cacti installation. You | |
86 | should uninstall this package when you're done, as it considered | |
87 | insecure to keep the setup files in place. | |
88 | ||
89 | %package doc | |
90 | Summary: HTML Documentation for Cacti | |
91 | Group: Documentation | |
92 | Requires: %{name} = %{version}-%{release} | |
93 | ||
94 | %description doc | |
95 | HTML Documentation for Cacti. | |
96 | ||
6587a5d5 | 97 | %prep |
42ad0a97 | 98 | %setup -q -a 3 |
0482abbd | 99 | %patch1 -p1 |
f23be293 | 100 | %patch2 -p1 |
14544804 | 101 | %patch3 -p1 |
4b6cd69a | 102 | %{__patch} -p1 -s < cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff |
d6d42868 ER |
103 | %patch4 -p1 |
104 | %patch5 -p1 | |
105 | %patch6 -p1 | |
30aaaddb | 106 | %patch7 -p1 |
7d9bb249 | 107 | %patch8 -p1 |
86a72dca | 108 | %patch9 -p1 |
6587a5d5 | 109 | |
4b6cd69a ER |
110 | mkdir -p sql |
111 | mv *.sql sql | |
86a72dca ER |
112 | # you should run this sql if your database contains path to %{_datadir}... |
113 | cp %{SOURCE6} sql | |
4b6cd69a ER |
114 | |
115 | mv cacti-plugin-arch/pa.sql sql | |
116 | rm -rf cacti-plugin-arch | |
f44cea91 | 117 | rm -rf lib/adodb |
4b6cd69a ER |
118 | rm -f log/.htaccess |
119 | rm -f rra/.placeholder | |
344e658b ER |
120 | rm -f plugins/index.php |
121 | ||
122 | %{__sed} -i -e '1i#!%{_bindir}/php' scripts/*.php | |
123 | chmod a+rx scripts/* | |
6587a5d5 | 124 | |
f4a0dd1f ER |
125 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
126 | ||
6587a5d5 | 127 | %install |
94614147 | 128 | rm -rf $RPM_BUILD_ROOT |
4b6cd69a | 129 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/cron.d,%{_sbindir}} |
c7a01fb3 | 130 | install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}} |
e9300b9e | 131 | |
4b6cd69a ER |
132 | cp -a *.php $RPM_BUILD_ROOT%{_appdir} |
133 | cp -a cli images include install lib plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir} | |
134 | cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html | |
135 | mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller} | |
e9300b9e | 136 | |
4b6cd69a ER |
137 | cp -a log $RPM_BUILD_ROOT/var/log/%{name} |
138 | cp -a rra $RPM_BUILD_ROOT/var/lib/%{name} | |
e9300b9e | 139 | |
4b6cd69a | 140 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php |
4b6cd69a ER |
141 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name} |
142 | ||
143 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
144 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
145 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
6587a5d5 JB |
146 | |
147 | %clean | |
94614147 | 148 | rm -rf $RPM_BUILD_ROOT |
6587a5d5 | 149 | |
f4a0dd1f ER |
150 | %pre |
151 | %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti | |
152 | ||
4b6cd69a ER |
153 | %post |
154 | if [ ! -f /var/log/%{name}/cacti.log ]; then | |
155 | install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log | |
156 | fi | |
157 | ||
f4a0dd1f ER |
158 | %postun |
159 | if [ "$1" = "0" ]; then | |
160 | %userremove cacti | |
161 | fi | |
162 | ||
4b6cd69a ER |
163 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
164 | %webapp_register apache %{_webapp} | |
165 | ||
166 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
167 | %webapp_unregister apache %{_webapp} | |
168 | ||
169 | %triggerin -- apache < 2.2.0, apache-base | |
170 | %webapp_register httpd %{_webapp} | |
171 | ||
172 | %triggerun -- apache < 2.2.0, apache-base | |
173 | %webapp_unregister httpd %{_webapp} | |
174 | ||
175 | %triggerin -- lighttpd | |
176 | %webapp_register lighttpd %{_webapp} | |
177 | ||
178 | %triggerun -- lighttpd | |
179 | %webapp_unregister lighttpd %{_webapp} | |
180 | ||
181 | %triggerpostun -- %{name} < 0.8.7b-9.5 | |
182 | if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then | |
183 | cp -f %{_sysconfdir}/config.php{,.rpmnew} | |
184 | mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php | |
185 | fi | |
186 | ||
6587a5d5 | 187 | %files |
94614147 | 188 | %defattr(644,root,root,755) |
4b6cd69a ER |
189 | %doc docs/CHANGELOG docs/CONTRIB docs/README docs/text/manual.txt |
190 | %dir %attr(750,root,http) %{_sysconfdir} | |
191 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
192 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
193 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
194 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
195 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name} | |
196 | %attr(755,root,root) %{_sbindir}/cacti-poller | |
344e658b | 197 | %dir %{_appdir} |
4b6cd69a ER |
198 | %exclude %{_appdir}/install |
199 | %exclude %{_appdir}/docs | |
344e658b ER |
200 | %{_appdir}/resource |
201 | %{_appdir}/sql | |
202 | %{_appdir}/lib | |
203 | %{_appdir}/include | |
204 | %{_appdir}/images | |
205 | %{_appdir}/cli | |
206 | %{_appdir}/plugins | |
207 | %{_appdir}/*.php | |
208 | ||
209 | %dir %{_appdir}/scripts | |
210 | %attr(755,root,root) %{_appdir}/scripts/* | |
4b6cd69a | 211 | |
271af71b | 212 | %attr(750,root,http) %dir /var/lib/%{name} |
cd209fd1 | 213 | %attr(770,root,http) %dir /var/lib/%{name}/rra |
4b6cd69a ER |
214 | %attr(730,root,http) %dir /var/log/%{name} |
215 | %attr(660,root,http) %ghost /var/log/%{name}/cacti.log | |
216 | ||
217 | %files setup | |
218 | %defattr(644,root,root,755) | |
219 | %{_appdir}/install | |
220 | ||
221 | %files doc | |
222 | %defattr(644,root,root,755) | |
223 | %{_appdir}/docs/html |