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