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