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