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