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