]>
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 GS |
5 | Version: 0.8.7d |
6 | Release: 0.1 | |
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 | |
16 | Patch0: cacti-plugin-%{version}-PA-v2.4.diff | |
17 | Patch1: %{name}-config.patch | |
18 | Patch2: %{name}-adodb.patch | |
19 | Patch3: %{name}-ioerror.patch | |
20 | Patch4: %{name}-webroot.patch | |
21 | Patch5: %{name}-linux_memory.patch | |
22 | Patch6: %{name}-log-verbosity.patch | |
23 | Patch7: %{name}-ss_disk-array-indices.patch | |
24 | Patch8: %{name}-rrdresourcecheck.patch | |
761b4fb2 | 25 | URL: http://www.cacti.net/ |
89aea3b3 | 26 | BuildRequires: rpm-perlprov |
344e658b | 27 | BuildRequires: sed >= 4.0 |
f4a0dd1f ER |
28 | Requires(postun): /usr/sbin/userdel |
29 | Requires(pre): /bin/id | |
30 | Requires(pre): /usr/sbin/useradd | |
f44cea91 | 31 | Requires: adodb >= 4.67-1.17 |
e9300b9e | 32 | Requires: crondaemon |
f4a0dd1f | 33 | Requires: group(http) |
94614147 | 34 | Requires: net-snmp-utils |
f5a0e42f ER |
35 | Requires: php(gd) |
36 | Requires: php(mysql) | |
37 | Requires: php(pcre) | |
38 | Requires: php(snmp) | |
39 | Requires: php(xml) | |
4e25427a | 40 | Requires: php-cli |
c8f292cd | 41 | Requires: rrdtool |
4b6cd69a | 42 | Requires: webapps |
e4f2f951 | 43 | Requires: webserver |
cce68540 | 44 | Requires: webserver(access) |
7d4ec5c1 | 45 | Requires: webserver(alias) |
09dccb3a | 46 | Requires: webserver(indexfile) |
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 | ||
a40c4ad5 JB |
90 | %description setup -l pl.UTF-8 |
91 | Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację | |
92 | Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego | |
93 | obecność może być niebezpieczna. | |
94 | ||
4b6cd69a ER |
95 | %package doc |
96 | Summary: HTML Documentation for Cacti | |
a40c4ad5 | 97 | Summary(pl.UTF-8): Dokumentacja do Cacti w formacie HTML |
4b6cd69a ER |
98 | Group: Documentation |
99 | Requires: %{name} = %{version}-%{release} | |
100 | ||
101 | %description doc | |
102 | HTML Documentation for Cacti. | |
103 | ||
a40c4ad5 JB |
104 | %description doc -l pl.UTF-8 |
105 | Dokumentacja do Cacti w formacie HTML. | |
106 | ||
6587a5d5 | 107 | %prep |
de4cec3c | 108 | %setup -q |
ebacb7e6 | 109 | %patch0 -p1 |
0482abbd | 110 | %patch1 -p1 |
f23be293 | 111 | %patch2 -p1 |
14544804 | 112 | %patch3 -p1 |
d6d42868 ER |
113 | %patch4 -p1 |
114 | %patch5 -p1 | |
115 | %patch6 -p1 | |
5e8efd1f | 116 | %patch7 -p1 |
de4cec3c | 117 | %patch8 -p1 |
6587a5d5 | 118 | |
4b6cd69a ER |
119 | mkdir -p sql |
120 | mv *.sql sql | |
86a72dca | 121 | # you should run this sql if your database contains path to %{_datadir}... |
de4cec3c | 122 | cp %{SOURCE5} sql |
4b6cd69a | 123 | |
4b6cd69a | 124 | rm -rf cacti-plugin-arch |
f44cea91 | 125 | rm -rf lib/adodb |
4b6cd69a | 126 | rm -f log/.htaccess |
ebacb7e6 | 127 | rm -f cli/.htaccess |
4b6cd69a | 128 | rm -f rra/.placeholder |
344e658b ER |
129 | |
130 | %{__sed} -i -e '1i#!%{_bindir}/php' scripts/*.php | |
131 | chmod a+rx scripts/* | |
6587a5d5 | 132 | |
ebacb7e6 ER |
133 | %{__sed} -i -e '1i#!%{_bindir}/php' cli/*.php |
134 | chmod a+rx cli/* | |
135 | ||
f4a0dd1f ER |
136 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f |
137 | ||
6587a5d5 | 138 | %install |
94614147 | 139 | rm -rf $RPM_BUILD_ROOT |
de4cec3c | 140 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/cron.d,%{_sbindir}} |
c7a01fb3 | 141 | install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}} |
e9300b9e | 142 | |
4b6cd69a | 143 | cp -a *.php $RPM_BUILD_ROOT%{_appdir} |
de4cec3c | 144 | cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir} |
4b6cd69a ER |
145 | cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html |
146 | mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller} | |
e9300b9e | 147 | |
4b6cd69a ER |
148 | cp -a log $RPM_BUILD_ROOT/var/log/%{name} |
149 | cp -a rra $RPM_BUILD_ROOT/var/lib/%{name} | |
e9300b9e | 150 | |
4b6cd69a | 151 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php |
4b6cd69a ER |
152 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name} |
153 | ||
de4cec3c GS |
154 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
155 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
156 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
6587a5d5 JB |
157 | |
158 | %clean | |
94614147 | 159 | rm -rf $RPM_BUILD_ROOT |
6587a5d5 | 160 | |
f4a0dd1f ER |
161 | %pre |
162 | %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti | |
163 | ||
4b6cd69a ER |
164 | %post |
165 | if [ ! -f /var/log/%{name}/cacti.log ]; then | |
166 | install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log | |
167 | fi | |
168 | ||
f4a0dd1f ER |
169 | %postun |
170 | if [ "$1" = "0" ]; then | |
171 | %userremove cacti | |
172 | fi | |
173 | ||
4b6cd69a ER |
174 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
175 | %webapp_register apache %{_webapp} | |
176 | ||
177 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
178 | %webapp_unregister apache %{_webapp} | |
179 | ||
180 | %triggerin -- apache < 2.2.0, apache-base | |
181 | %webapp_register httpd %{_webapp} | |
182 | ||
183 | %triggerun -- apache < 2.2.0, apache-base | |
184 | %webapp_unregister httpd %{_webapp} | |
185 | ||
186 | %triggerin -- lighttpd | |
187 | %webapp_register lighttpd %{_webapp} | |
188 | ||
189 | %triggerun -- lighttpd | |
190 | %webapp_unregister lighttpd %{_webapp} | |
191 | ||
192 | %triggerpostun -- %{name} < 0.8.7b-9.5 | |
193 | if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then | |
194 | cp -f %{_sysconfdir}/config.php{,.rpmnew} | |
195 | mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php | |
196 | fi | |
197 | ||
6587a5d5 | 198 | %files |
94614147 | 199 | %defattr(644,root,root,755) |
4b6cd69a ER |
200 | %doc docs/CHANGELOG docs/CONTRIB docs/README docs/text/manual.txt |
201 | %dir %attr(750,root,http) %{_sysconfdir} | |
202 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
203 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
204 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
205 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
206 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name} | |
207 | %attr(755,root,root) %{_sbindir}/cacti-poller | |
344e658b | 208 | %dir %{_appdir} |
4b6cd69a ER |
209 | %exclude %{_appdir}/install |
210 | %exclude %{_appdir}/docs | |
344e658b ER |
211 | %{_appdir}/resource |
212 | %{_appdir}/sql | |
213 | %{_appdir}/lib | |
214 | %{_appdir}/include | |
215 | %{_appdir}/images | |
344e658b ER |
216 | %{_appdir}/plugins |
217 | %{_appdir}/*.php | |
218 | ||
ebacb7e6 ER |
219 | %dir %{_appdir}/cli |
220 | %attr(755,root,root) %{_appdir}/cli/* | |
221 | ||
344e658b ER |
222 | %dir %{_appdir}/scripts |
223 | %attr(755,root,root) %{_appdir}/scripts/* | |
4b6cd69a | 224 | |
ea4c4a5f AM |
225 | %attr(750,root,http) %dir /var/lib/%{name} |
226 | %attr(770,root,http) %dir /var/lib/%{name}/rra | |
4b6cd69a ER |
227 | %attr(730,root,http) %dir /var/log/%{name} |
228 | %attr(660,root,http) %ghost /var/log/%{name}/cacti.log | |
229 | ||
230 | %files setup | |
231 | %defattr(644,root,root,755) | |
232 | %{_appdir}/install | |
233 | ||
234 | %files doc | |
235 | %defattr(644,root,root,755) | |
adf6e05d | 236 | %{_appdir}/docs |