]> git.pld-linux.org Git - packages/cacti.git/blob - cacti.spec
- up to 0.8.7a
[packages/cacti.git] / cacti.spec
1 # TODO
2 # - patch source to use adodb system path instead of symlinking
3 # - R: /usr/bin/php should came from rpm autodeps (chmod +x or sth)
4 # - UPDATE OR DROP plugin patch
5 %include        /usr/lib/rpm/macros.perl
6 Summary:        Cacti is a PHP frontend for rrdtool
7 Summary(pl.UTF-8):      Cacti - frontend w PHP do rrdtoola
8 Name:           cacti
9 Version:        0.8.7a
10 Release:        0.1
11 License:        GPL
12 Group:          Applications/WWW
13 Source0:        http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
14 # Source0-md5:  7d298e496058ec91f6d1ecdc97e0cca5
15 # official patches
16 #Patch0:...
17 # custom patches
18 Patch100:       %{name}-plugin-0.8.6j.diff
19 Patch101:       %{name}-config.patch
20 URL:            http://www.cacti.net/
21 BuildRequires:  rpm-perlprov
22 Requires:       /usr/bin/php
23 Requires:       adodb >= 4.67-1.17
24 Requires:       crondaemon
25 Requires:       nc
26 Requires:       net-snmp-utils
27 Requires:       php(gd)
28 Requires:       php(mysql)
29 Requires:       php(pcre)
30 Requires:       php(snmp)
31 Requires:       php(xml)
32 Requires:       rrdtool
33 Requires:       webserver
34 Requires:       webserver(php)
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %define         webadminroot /usr/share/%{name}
39
40 %description
41 Cacti is a complete frondend to rrdtool, it stores all of the
42 nessesary information to create graphs and populate them with data in
43 a MySQL database.
44
45 The frontend is completely PHP driven. Along with being able to
46 maintain Graphs, Data Sources, and Round Robin Archives in a database,
47 cacti handles the data gathering also. There is also SNMP support for
48 those used to creating traffic graphs with MRTG.
49
50 %description -l pl.UTF-8
51 Cacti to pełny frontend do rrdtoola, zapamiętujący wszystkie
52 informacje potrzebne do tworzenia wykresów i wypełniające je danymi
53 w bazie MySQL.
54
55 Frontend jest w pełni oparty na PHP. Oprócz zarządzania wykresami,
56 źródłami danych, archiwami Round Robin w bazie danych, cacti
57 obsługuje także gromadzenie danych. Ma także obsługę SNMP
58 przydatną przy tworzeniu wykresów ruchu przy użyciu MRTG.
59
60 %prep
61 %setup -q
62 #%patch100 -p1
63 %patch101 -p1
64
65 rm -rf lib/adodb
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69 install -d $RPM_BUILD_ROOT%{webadminroot}
70 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{%{name},cron.d}
71 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
72 cp -aRf * $RPM_BUILD_ROOT%{webadminroot}
73 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
74
75 # TODO: move this to SOURCES. it's a lot better to backtrack changes
76 # if it's a separate file.
77 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
78 <?php
79 $database_type = 'mysql';
80 $database_default = 'cacti';
81 $database_hostname = 'localhost';
82 $database_username = 'cactiuser';
83 $database_password = 'cactiuser';
84
85 $plugins = array();
86 // $plugins[] = 'thold';
87 // $plugins[] = 'monitor';
88 // $plugins[] = 'discovery';
89
90 /* Do not edit this line */
91 $config = array();
92
93 /* This is full URL Path to the Cacti installation
94    For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
95    as the url path.  For just http://server/ use '/'
96 */
97 $config['url_path'] = '/cacti/';
98
99 ?>
100 EOF
101
102 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
103 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
104
105 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
106 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
107 ln -sf %{_datadir}/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
108
109 cat  << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
110 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
111 EOF
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %files
117 %defattr(644,root,root,755)
118 %doc docs/CHANGELOG docs/CONTRIB docs/README
119 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
120 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
121 %attr(770,root,http) %dir /var/log/%{name}
122 %attr(660,root,http) %ghost /var/log/%{name}/*.log
123 %attr(750,root,http) %dir /var/lib/%{name}
124 %attr(770,root,http) %dir /var/lib/%{name}/rra
125 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}
126 %{webadminroot}
This page took 0.055187 seconds and 4 git commands to generate.