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