]> git.pld-linux.org Git - packages/cacti.git/blob - cacti.spec
- add cacti user for running scripts
[packages/cacti.git] / cacti.spec
1 # TODO
2 # - patch source to use adodb system path instead of symlinking
3 # - shouldn't files in scripts dir be executable?
4 %include        /usr/lib/rpm/macros.perl
5 Summary:        Cacti is a PHP frontend for rrdtool
6 Summary(pl.UTF-8):      Cacti - frontend w PHP do rrdtoola
7 Name:           cacti
8 Version:        0.8.7b
9 Release:        5
10 License:        GPL
11 Group:          Applications/WWW
12 Source0:        http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
13 # Source0-md5:  63ffca5735b60bc33c68bc880f0e8042
14 Source1:        %{name}.cfg.php
15 Patch1:         %{name}-upgrade_from_086k_fix.patch
16 Patch2:         http://www.cacti.net/downloads/patches/0.8.7b/snmp_auth_none_notice.patch
17 Patch10:        %{name}-plugin-%{version}.diff
18 Patch11:        %{name}-config.patch
19 Patch12:        %{name}-adodb.patch
20 Patch13:        %{name}-url_path.patch
21 URL:            http://www.cacti.net/
22 BuildRequires:  rpm-perlprov
23 Requires(postun):       /usr/sbin/userdel
24 Requires(pre):  /bin/id
25 Requires(pre):  /usr/sbin/useradd
26 Requires:       adodb >= 4.67-1.17
27 Requires:       crondaemon
28 Requires:       group(http)
29 Requires:       net-snmp-utils
30 Requires:       php(gd)
31 Requires:       php(mysql)
32 Requires:       php(pcre)
33 Requires:       php(snmp)
34 Requires:       php(xml)
35 Requires:       php-cli
36 Requires:       rrdtool
37 Requires:       webserver
38 Requires:       webserver(php)
39 Suggests:       cacti-spine
40 Provides:       user(cacti)
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %define         webadminroot /usr/share/%{name}
45
46 %description
47 Cacti is a complete frondend to rrdtool, it stores all of the
48 nessesary information to create graphs and populate them with data in
49 a MySQL database.
50
51 The frontend is completely PHP driven. Along with being able to
52 maintain Graphs, Data Sources, and Round Robin Archives in a database,
53 cacti handles the data gathering also. There is also SNMP support for
54 those used to creating traffic graphs with MRTG.
55
56 %description -l pl.UTF-8
57 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
58 informacje potrzebne do tworzenia wykresów i wypełniające je danymi w
59 bazie MySQL.
60
61 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
62 źródłami danych, archiwami Round Robin w bazie danych, cacti obsługuje
63 także gromadzenie danych. Ma także obsługę SNMP przydatną przy
64 tworzeniu wykresów ruchu przy użyciu MRTG.
65
66 %prep
67 %setup -q
68 %patch1 -p1
69 %patch2 -p1
70 %patch10 -p1
71 %patch11 -p1
72 %patch12 -p1
73 %patch13 -p1
74
75 rm -rf lib/adodb
76
77 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81 install -d $RPM_BUILD_ROOT%{webadminroot}
82 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},/etc/cron.d}
83 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
84 cp -a * $RPM_BUILD_ROOT%{webadminroot}
85 # wtf is this?
86 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
87
88 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
89
90 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
91 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
92
93 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
94 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
95 ln -sf %{_datadir}/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
96
97 # TODO: switch to user cacti here
98 cat  << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
99 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
100 EOF
101
102 %clean
103 rm -rf $RPM_BUILD_ROOT
104
105 %pre
106 %useradd -u 184 -d /var/lib/%{name} -g http -c "Cacti User" cacti
107
108 %postun
109 if [ "$1" = "0" ]; then
110         %userremove cacti
111 fi
112
113 %files
114 %defattr(644,root,root,755)
115 %doc docs/CHANGELOG docs/CONTRIB docs/README
116 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
117 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
118 %attr(770,root,http) %dir /var/log/%{name}
119 %attr(660,root,http) %ghost /var/log/%{name}/*.log
120 %attr(750,root,http) %dir /var/lib/%{name}
121 %attr(770,root,http) %dir /var/lib/%{name}/rra
122 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
123 %{webadminroot}
This page took 0.048295 seconds and 3 git commands to generate.