]> git.pld-linux.org Git - packages/cacti.git/blob - cacti.spec
poller_graphs_reapply_names.php uses -id instead of --id
[packages/cacti.git] / cacti.spec
1 %define         pia_ver 3.1
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.8a
6 Release:        3
7 License:        GPL v2
8 Group:          Applications/WWW
9 Source0:        http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
10 # Source0-md5:  a4da682dab9a88a2e0edb1728bf531ae
11 Source2:        %{name}.crontab
12 Source3:        %{name}-apache.conf
13 Source4:        %{name}-lighttpd.conf
14 Source5:        %{name}-rrdpath.sql
15 Source7:        %{name}.logrotate
16 Patch0:         mysql-socket.patch
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:         host_name-url.patch
25 # http://www.cacti.net/download_patches.php
26 Patch100:       http://www.cacti.net/downloads/patches/%{version}/snmpv3_priv_proto_none.patch
27 # Patch100-md5: f5fbee2af1000c8f188b8688dec4ddd8
28 URL:            http://www.cacti.net/
29 BuildRequires:  sed >= 4.0
30 Requires(postun):       /usr/sbin/userdel
31 Requires(pre):  /bin/id
32 Requires(pre):  /usr/sbin/useradd
33 Requires:       adodb >= 4.67-1.17
34 Requires:       cacti-plugin-boost >= 5.0
35 Requires:       crondaemon
36 Requires:       group(http)
37 Requires:       net-snmp-utils
38 Requires:       php(core) >= 5.2.13-10
39 Requires:       php(mysql)
40 Requires:       php(pcre)
41 Requires:       php(session)
42 Requires:       php(snmp)
43 Requires:       php(xml)
44 Requires:       rrdtool
45 Requires:       webapps
46 Requires:       webserver
47 Requires:       webserver(access)
48 Requires:       webserver(alias)
49 Requires:       webserver(indexfile)
50 Requires:       webserver(php)
51 Suggests:       cacti-spine
52 Suggests:       php-gd
53 Provides:       cacti(pia) = %{pia_ver}
54 Provides:       user(cacti)
55 Obsoletes:      cacti-add_template
56 Obsoletes:      cacti-plugin-update
57 Conflicts:      logrotate < 3.8.0
58 BuildArch:      noarch
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %define         _webapps        /etc/webapps
62 %define         _webapp         %{name}
63 %define         _sysconfdir     %{_webapps}/%{_webapp}
64 %define         _appdir         /usr/share/%{name}
65
66 %description
67 Cacti is a complete frondend to rrdtool, it stores all of the
68 nessesary information to create graphs and populate them with data in
69 a MySQL database.
70
71 The frontend is completely PHP driven. Along with being able to
72 maintain Graphs, Data Sources, and Round Robin Archives in a database,
73 cacti handles the data gathering also. There is also SNMP support for
74 those used to creating traffic graphs with MRTG.
75
76 %description -l pl.UTF-8
77 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
78 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
79 bazie MySQL.
80
81 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
82 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
83 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
84 tworzeniu wykresów ruchu przy użyciu MRTG.
85
86 %package setup
87 Summary:        Cacti setup package
88 Summary(pl.UTF-8):      Pakiet do wstępnej konfiguracji Cacti
89 Group:          Applications/WWW
90 Requires:       %{name} = %{version}-%{release}
91 Suggests:       %{name}-doc = %{version}-%{release}
92
93 %description setup
94 Install this package to configure initial Cacti installation. You
95 should uninstall this package when you're done, as it considered
96 insecure to keep the setup files in place.
97
98 %description setup -l pl.UTF-8
99 Ten pakiet należy zainstalować, aby wstępnie skonfigurować instalację
100 Cacti. Po tym pakiet powinien zostać odinstalowany, jako że jego
101 obecność może być niebezpieczna.
102
103 %package doc
104 Summary:        HTML Documentation for Cacti
105 Summary(pl.UTF-8):      Dokumentacja do Cacti w formacie HTML
106 Group:          Documentation
107 Requires:       %{name} = %{version}-%{release}
108
109 %description doc
110 HTML Documentation for Cacti.
111
112 %description doc -l pl.UTF-8
113 Dokumentacja do Cacti w formacie HTML.
114
115 %prep
116 %setup -q
117 # official patches
118 %patch100 -p1
119
120 %patch0 -p1
121 %patch1 -p1
122 %patch2 -p1
123 %patch3 -p1
124 %patch4 -p1
125 %patch5 -p1
126 %patch6 -p1
127 %patch7 -p1
128 %patch8 -p1
129
130 mkdir -p sql
131 mv *.sql sql
132 # you should run this sql if your database contains path to %{_datadir}...
133 cp -p %{SOURCE5} sql
134
135 %{__rm} -r lib/adodb
136 %{__rm} log/.htaccess
137 %{__rm} cli/.htaccess
138 %{__rm} rra/.htaccess
139
140 # must require libs to get fatals on missing files, not include
141 %{__sed} -i -e '
142         s,include(dirname(__FILE__)."/../include/global.php");,require(dirname(__FILE__)."/../include/global.php");,
143         s,include_once,require_once,
144 ' cli/*.php
145
146 # make sure scripts have php shebang
147 %{__sed} -i -e '1{
148     /bin.php/!i#!%{_bindir}/php
149 }' scripts/*.php  cli/*.php
150
151 chmod a+rx scripts/*.php cli/*.php
152
153 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
154
155 # make sure cacti runs out of the box
156 %{__sed} -i -e 's,new_install,%{version},' sql/cacti.sql
157
158 %install
159 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_appdir}/{docs,plugins},/etc/{cron.d,logrotate.d},%{_sbindir}}
161 install -d $RPM_BUILD_ROOT/var/{log,{lib,cache}/%{name}}
162
163 cp -p *.php $RPM_BUILD_ROOT%{_appdir}
164 cp -a cli images include install lib resource scripts sql $RPM_BUILD_ROOT%{_appdir}
165 cp -a docs/html $RPM_BUILD_ROOT%{_appdir}/docs/html
166 mv $RPM_BUILD_ROOT{%{_appdir}/poller.php,%{_sbindir}/cacti-poller}
167
168 cp -a log $RPM_BUILD_ROOT/var/log/%{name}
169 install -d $RPM_BUILD_ROOT/var/log/archive/%{name}
170 cp -a rra $RPM_BUILD_ROOT/var/lib/%{name}
171
172 mv $RPM_BUILD_ROOT{%{_appdir}/include,%{_sysconfdir}}/config.php
173 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/%{name}
174 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
175
176 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
177 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
178 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
179
180 %clean
181 rm -rf $RPM_BUILD_ROOT
182
183 %pre
184 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
185
186 %post
187 if [ ! -f /var/log/%{name}/cacti.log ]; then
188         install -m660 -oroot -ghttp /dev/null /var/log/%{name}/cacti.log
189 fi
190
191 %{_appdir}/cli/upgrade_database.php || :
192
193 %postun
194 if [ "$1" = "0" ]; then
195         %userremove cacti
196 fi
197
198 %triggerin -- apache1 < 1.3.37-3, apache1-base
199 %webapp_register apache %{_webapp}
200
201 %triggerun -- apache1 < 1.3.37-3, apache1-base
202 %webapp_unregister apache %{_webapp}
203
204 %triggerin -- apache < 2.2.0, apache-base
205 %webapp_register httpd %{_webapp}
206
207 %triggerun -- apache < 2.2.0, apache-base
208 %webapp_unregister httpd %{_webapp}
209
210 %triggerin -- lighttpd
211 %webapp_register lighttpd %{_webapp}
212
213 %triggerun -- lighttpd
214 %webapp_unregister lighttpd %{_webapp}
215
216 %triggerpostun -- %{name} < 0.8.7b-9.5
217 if [ -f /etc/cacti/cacti.cfg.rpmsave ]; then
218         cp -f %{_sysconfdir}/config.php{,.rpmnew}
219         mv /etc/cacti/cacti.cfg.rpmsave %{_sysconfdir}/config.php
220 fi
221
222 %files
223 %defattr(644,root,root,755)
224 %doc docs/CHANGELOG docs/CONTRIB docs/README docs/txt/manual.txt
225 %dir %attr(750,root,http) %{_sysconfdir}
226 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
227 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
228 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
229 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
230 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
231 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
232 %attr(755,root,root) %{_sbindir}/cacti-poller
233 %dir %{_appdir}
234 %exclude %{_appdir}/install
235 %exclude %{_appdir}/docs
236 %{_appdir}/resource
237 %{_appdir}/sql
238 %{_appdir}/lib
239 %{_appdir}/include
240 %{_appdir}/images
241 %{_appdir}/plugins
242 %{_appdir}/*.php
243
244 %dir %{_appdir}/cli
245 %attr(755,root,root) %{_appdir}/cli/*
246
247 %dir %{_appdir}/scripts
248 %attr(755,root,root) %{_appdir}/scripts/*
249
250 %attr(750,root,http) %dir /var/lib/%{name}
251 %attr(770,root,http) %dir /var/lib/%{name}/rra
252 %attr(730,root,http) %dir /var/log/%{name}
253 %attr(750,root,logs) %dir /var/log/archive/%{name}
254 %attr(660,root,http) %ghost /var/log/%{name}/cacti.log
255 %attr(730,root,http) %dir /var/cache/%{name}
256
257 %files setup
258 %defattr(644,root,root,755)
259 %{_appdir}/install
260
261 %files doc
262 %defattr(644,root,root,755)
263 %{_appdir}/docs
This page took 0.062409 seconds and 3 git commands to generate.