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