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