]> git.pld-linux.org Git - packages/cacti.git/blob - cacti.spec
- Requires: webserver(indexfile)
[packages/cacti.git] / cacti.spec
1 %include        /usr/lib/rpm/macros.perl
2 Summary:        Cacti is a PHP frontend for rrdtool
3 Summary(pl.UTF-8):      Cacti - frontend w PHP do rrdtoola
4 Name:           cacti
5 Version:        0.8.7b
6 Release:        15
7 License:        GPL
8 Group:          Applications/WWW
9 Source0:        http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
10 # Source0-md5:  63ffca5735b60bc33c68bc880f0e8042
11 Source1:        %{name}.cfg.php
12 Source2:        %{name}.crontab
13 Source3:        http://cactiusers.org/downloads/%{name}-plugin-arch.tar.gz
14 # Source3-md5:  7079c1f366e8ea1b26c7e251e6373226
15 Source4:        %{name}-apache.conf
16 Source5:        %{name}-lighttpd.conf
17 Source6:        %{name}-rrdpath.sql
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
28 Patch7:         %{name}-rrdtool-1.3.patch
29 Patch8:         %{name}-rrdresourcecheck.patch
30 URL:            http://www.cacti.net/
31 BuildRequires:  rpm-perlprov
32 BuildRequires:  sed >= 4.0
33 Requires(postun):       /usr/sbin/userdel
34 Requires(pre):  /bin/id
35 Requires(pre):  /usr/sbin/useradd
36 Requires:       adodb >= 4.67-1.17
37 Requires:       crondaemon
38 Requires:       group(http)
39 Requires:       net-snmp-utils
40 Requires:       php(gd)
41 Requires:       php(mysql)
42 Requires:       php(pcre)
43 Requires:       php(snmp)
44 Requires:       php(xml)
45 Requires:       php-cli
46 Requires:       rrdtool
47 Requires:       webapps
48 Requires:       webserver
49 Requires:       webserver(access)
50 Requires:       webserver(alias)
51 Requires:       webserver(indexfile)
52 Requires:       webserver(php)
53 Suggests:       cacti-spine
54 Provides:       user(cacti)
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         _webapps        /etc/webapps
59 %define         _webapp         %{name}
60 %define         _sysconfdir     %{_webapps}/%{_webapp}
61 %define         _appdir         /usr/share/%{name}
62
63 %description
64 Cacti is a complete frondend to rrdtool, it stores all of the
65 nessesary information to create graphs and populate them with data in
66 a MySQL database.
67
68 The frontend is completely PHP driven. Along with being able to
69 maintain Graphs, Data Sources, and Round Robin Archives in a database,
70 cacti handles the data gathering also. There is also SNMP support for
71 those used to creating traffic graphs with MRTG.
72
73 %description -l pl.UTF-8
74 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
75 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
76 bazie MySQL.
77
78 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
79 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
80 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
81 tworzeniu wykresów ruchu przy użyciu MRTG.
82
83 %package setup
84 Summary:        Cacti setup package
85 Summary(pl.UTF-8):      Pakiet do wstępnej konfiguracji Cacti
86 Group:          Applications/WWW
87 Requires:       %{name} = %{version}-%{release}
88 Suggests:       %{name}-doc = %{version}-%{release}
89
90 %description setup
91 Install this package to configure initial Cacti installation. You
92 should uninstall this package when you're done, as it considered
93 insecure to keep the setup files in place.
94
95 %description setup -l pl.UTF-8
96 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
97 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
98 obecność może być niebezpieczna.
99
100 %package doc
101 Summary:        HTML Documentation for Cacti
102 Summary(pl.UTF-8):      Dokumentacja do Cacti w formacie HTML
103 Group:          Documentation
104 Requires:       %{name} = %{version}-%{release}
105
106 %description doc
107 HTML Documentation for Cacti.
108
109 %description doc -l pl.UTF-8
110 Dokumentacja do Cacti w formacie HTML.
111
112 %prep
113 %setup -q -a 3
114 %patch100 -p1
115 %patch101 -p1
116 %patch102 -p1
117 %{__patch} -p1 -s < cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.1.diff
118 %patch0 -p1
119 %patch1 -p1
120 %patch2 -p1
121 %patch3 -p1
122 %patch4 -p1
123 %patch5 -p1
124 %patch6 -p1
125 %patch7 -p0
126 %patch8 -p1
127
128 mkdir -p sql
129 mv *.sql sql
130 # you should run this sql if your database contains path to %{_datadir}...
131 cp %{SOURCE6} sql
132
133 mv cacti-plugin-arch/pa.sql sql
134 rm -rf cacti-plugin-arch
135 rm -rf lib/adodb
136 rm -f log/.htaccess
137 rm -f cli/.htaccess
138 rm -f rra/.placeholder
139 rm -f plugins/index.php
140
141 %{__sed} -i -e '1i#!%{_bindir}/php' scripts/*.php
142 chmod a+rx scripts/*
143
144 %{__sed} -i -e '1i#!%{_bindir}/php' cli/*.php
145 chmod a+rx cli/*
146
147 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
148
149 %install
150 rm -rf $RPM_BUILD_ROOT
151 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/docs,/etc/cron.d,%{_sbindir}}
152 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
153
154 cp -a *.php $RPM_BUILD_ROOT%{_appdir}
155 cp -a cli images include install lib plugins resource scripts sql $RPM_BUILD_ROOT%{_appdir}
156 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
157 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
158
159 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
160 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
161
162 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
163 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
164
165 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
166 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
167 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
168
169 %clean
170 rm -rf $RPM_BUILD_ROOT
171
172 %pre
173 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
174
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
180 %postun
181 if [ "$1" = "0" ]; then
182         %userremove cacti
183 fi
184
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
209 %files
210 %defattr(644,root,root,755)
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
219 %dir %{_appdir}
220 %exclude %{_appdir}/install
221 %exclude %{_appdir}/docs
222 %{_appdir}/resource
223 %{_appdir}/sql
224 %{_appdir}/lib
225 %{_appdir}/include
226 %{_appdir}/images
227 %{_appdir}/plugins
228 %{_appdir}/*.php
229
230 %dir %{_appdir}/cli
231 %attr(755,root,root) %{_appdir}/cli/*
232
233 %dir %{_appdir}/scripts
234 %attr(755,root,root) %{_appdir}/scripts/*
235
236 %attr(750,root,http) %dir /var/lib/%{name}
237 %attr(770,root,http) %dir /var/lib/%{name}/rra
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)
247 %{_appdir}/docs
This page took 0.085774 seconds and 4 git commands to generate.