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