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
8 Group: Applications/WWW
9 Source0: http://www.cacti.net/downloads/%{name}-%{version}.tar.gz
10 # Source0-md5: b3cf31349d2db47d14dcf347b8422bc2
11 Patch0: %{name}-plugin-%{version}.diff
12 Patch1: http://www.cacti.net/downloads/patches/0.8.6g/short_open_tag_parse_error.patch
13 Patch2: http://www.cacti.net/downloads/patches/0.8.6g/graph_properties_zoom.patch
14 Patch3: http://www.cacti.net/downloads/patches/0.8.6g/script_server_snmp_auth.patch
15 Patch4: http://www.cacti.net/downloads/patches/0.8.6g/mib_file_loading.patch
16 Patch5: %{name}-config.patch
17 Patch6: %{name}-mysql5.patch
18 URL: http://www.cacti.net/
19 BuildRequires: rpm-perlprov
21 Requires: net-snmp-utils
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define webadminroot /usr/share/%{name}
37 Cacti is a complete frondend to rrdtool, it stores all of the
38 nessesary information to create graphs and populate them with data in
41 The frontend is completely PHP driven. Along with being able to
42 maintain Graphs, Data Sources, and Round Robin Archives in a database,
43 cacti handles the data gathering also. There is also SNMP support for
44 those used to creating traffic graphs with MRTG.
47 Cacti to pe³ny frontend do rrdtoola, zapamiêtuj±cy wszystkie
48 informacje potrzebne do tworzenia wykresów i wype³niaj±ce je danymi w
51 Frontend jest w pe³ni oparty na PHP. Oprócz zarz±dzania wykresami,
52 ¼ród³ami danych, archiwami Round Robin w bazie danych, cacti obs³uguje
53 tak¿e gromadzenie danych. Ma tak¿e obs³ugê SNMP przydatn± przy
54 tworzeniu wykresów ruchu przy u¿yciu MRTG.
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT%{webadminroot}
71 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{%{name},cron.d}
72 install -d $RPM_BUILD_ROOT/var/{log,lib/%{name}}
74 cp -aRf * $RPM_BUILD_ROOT%{webadminroot}
75 ln -s . $RPM_BUILD_ROOT%{webadminroot}/%{name}
77 # TODO: move this to SOURCES. it's a lot better to backtrack changes
78 # if it's a separate file.
79 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.cfg
81 $database_type = 'mysql';
82 $database_default = 'cacti';
83 $database_hostname = 'localhost';
84 $database_username = 'cactiuser';
85 $database_password = 'cactiuser';
88 // $plugins[] = 'thold';
89 // $plugins[] = 'monitor';
90 // $plugins[] = 'discovery';
92 /* Do not edit this line */
95 /* This is full URL Path to the Cacti installation
96 For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
97 as the url path. For just http://server/ use '/'
99 $config['url_path'] = '/cacti/';
104 mv $RPM_BUILD_ROOT%{webadminroot}/log $RPM_BUILD_ROOT/var/log/%{name}
105 ln -sf /var/log/cacti $RPM_BUILD_ROOT%{webadminroot}/log
107 mv $RPM_BUILD_ROOT%{webadminroot}/rra $RPM_BUILD_ROOT/var/lib/%{name}
108 ln -sf /var/lib/%{name}/rra $RPM_BUILD_ROOT%{webadminroot}/rra
110 cat << 'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
111 */5 * * * * http umask 022; /usr/bin/php %{webadminroot}/poller.php > /dev/null 2>&1
115 rm -rf $RPM_BUILD_ROOT
118 %defattr(644,root,root,755)
119 %doc docs/CHANGELOG docs/CONTRIB docs/README
120 %attr(750,root,http) %dir %{_sysconfdir}/%{name}
121 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.cfg
122 %attr(770,root,http) %dir /var/log/%{name}
123 %attr(660,root,http) %ghost /var/log/%{name}/*.log
124 %attr(750,root,http) %dir /var/lib/%{name}
125 %attr(770,root,http) %dir /var/lib/%{name}/rra
126 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/%{name}