2 # - patch source to use adodb system path instead of symlinking
3 %include /usr/lib/rpm/macros.perl
4 Summary: Cacti is a PHP frontend for rrdtool
5 Summary(pl): Cacti - frontend w PHP do rrdtoola
10 Group: Applications/WWW
11 Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
12 # Source0-md5: 5f6100b525b5b29e81f43cc7c55f4000
13 Patch0: http://www.cacti.net/downloads/patches/0.8.6h/fix_search_session_clear_issue.patch
14 Patch1: http://www.cacti.net/downloads/patches/0.8.6h/fix_sql_syntax_related_to_default_rra_id.patch
15 Patch2: http://www.cacti.net/downloads/patches/0.8.6h/nth_percentile_empty_return_set_issue.patch
16 Patch3: http://www.cacti.net/downloads/patches/0.8.6h/mysql_5x_strict.patch
17 Patch4: http://www.cacti.net/downloads/patches/0.8.6h/database_autoincrement_corruption.patch
18 Patch10: %{name}-plugin-%{version}.diff
19 Patch11: %{name}-config.patch
20 URL: http://www.cacti.net/
21 BuildRequires: rpm-perlprov
22 Requires: adodb >= 4.67-1.17
24 Requires: net-snmp-utils
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define webadminroot /usr/share/%{name}
40 Cacti is a complete frondend to rrdtool, it stores all of the
41 nessesary information to create graphs and populate them with data in
44 The frontend is completely PHP driven. Along with being able to
45 maintain Graphs, Data Sources, and Round Robin Archives in a database,
46 cacti handles the data gathering also. There is also SNMP support for
47 those used to creating traffic graphs with MRTG.
50 Cacti to pe³ny frontend do rrdtoola, zapamiêtuj±cy wszystkie
51 informacje potrzebne do tworzenia wykresów i wype³niaj±ce je danymi w
54 Frontend jest w pe³ni oparty na PHP. Oprócz zarz±dzania wykresami,
55 ¼ród³ami danych, archiwami Round Robin w bazie danych, cacti obs³uguje
56 tak¿e gromadzenie danych. Ma tak¿e obs³ugê SNMP przydatn± przy
57 tworzeniu wykresów ruchu przy u¿yciu MRTG.
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT%{webadminroot}
74 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{%{name},cron.d}
75 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
76 cp -aRf * $RPM_BUILD_ROOT%{webadminroot}
77 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
79 # TODO: move this to SOURCES. it's a lot better to backtrack changes
80 # if it's a separate file.
81 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
83 $database_type = 'mysql';
84 $database_default = 'cacti';
85 $database_hostname = 'localhost';
86 $database_username = 'cactiuser';
87 $database_password = 'cactiuser';
90 // $plugins[] = 'thold';
91 // $plugins[] = 'monitor';
92 // $plugins[] = 'discovery';
94 /* Do not edit this line */
97 /* This is full URL Path to the Cacti installation
98 For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
99 as the url path. For just http://server/ use '/'
101 $config['url_path'] = '/cacti/';
106 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
107 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
109 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
110 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
111 ln -sf /usr/share/php/adodb $RPM_BUILD_ROOT%{webadminroot}/lib/adodb
113 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
114 */5 * * * * http umask 022; %{_bindir}/php %{webadminroot}/poller.php > /dev/null 2>&1
118 rm -rf $RPM_BUILD_ROOT
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}