-Summary: A backend data gatherer for cacti
-Summary(pl): Backend gromadz±cy dane dla cacti
-Name: cacti-cactid
-Version: 0.8.6i
-Release: 0.1
+#
+# Conditional build:
+%bcond_without cap # Enable support for the Linux Capabilities (default: disabled)
+
+Summary: A backend data gatherer for Cacti
+Summary(pl.UTF-8): Backend gromadzący dane dla Cacti
+Name: cacti-spine
+Version: 1.2.15
+Release: 1
License: GPL
-Group: Applications
-Source0: http://www.cacti.net/downloads/cactid/%{name}-%{version}.tar.gz
-# Source0-md5: 303c7533656c075cb695a1a8c54537b6
+Group: Daemons
+Source0: http://www.cacti.net/downloads/spine/%{name}-%{version}.tar.gz
+# Source0-md5: 04198466f34c8f919f6eabd7f2748774
+Patch0: %{name}-paths.patch
+# Official patches http://www.cacti.net/spine_download_patches.php
URL: http://www.cacti.net/
+BuildRequires: autoconf
BuildRequires: automake
+%{?with_cap:BuildRequires: libcap-devel}
+BuildRequires: libtool
BuildRequires: mysql-devel
BuildRequires: net-snmp-devel
BuildRequires: openssl-devel
+BuildRequires: rpmbuild(macros) >= 1.502
BuildRequires: zlib-devel
+%requires_eq net-snmp-libs
Requires: cacti
+Obsoletes: cacti-cactid
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _webapps /etc/webapps
+%define _webapp cacti
+%define _sysconfdir %{_webapps}/%{_webapp}
+%define _bindir %{_sbindir}
+
%description
-A backend data gatherer for cacti. This package represents the future
-replacement for cacti's cmd.php. It is almost 100% compatible with the
+A backend data gatherer for Cacti. This package represents the future
+replacement for Cacti's cmd.php. It is almost 100% compatible with the
legacy cmd.php processor.
-%description -l pl
-Backend gromadz±cy dane dla cacti. Ten pakiet reprezentuje przysz³y
-zamiennik cmd.php z cacti. Jest prawie w 100% kompatybilny ze starym
+%description -l pl.UTF-8
+Backend gromadzący dane dla Cacti. Ten pakiet reprezentuje przyszły
+zamiennik cmd.php z Cacti. Jest prawie w 100% kompatybilny ze starym
procesorem cmd.php.
%prep
%setup -q
+%patch0 -p1
%build
-install /usr/share/automake/config.* config
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoheader}
+%{__automake}
+%{__autoconf}
+chmod +x ./configure
%configure \
+ --with-results-buffer=4096 \
--with-mysql \
+ %{__enable_disable cap lcap} \
--with-snmp=%{_prefix}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_sysconfdir}
-
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-install cactid.conf $RPM_BUILD_ROOT%{_sysconfdir}
+mv $RPM_BUILD_ROOT%{_sbindir}/{spine,cacti-poller-spine}
+mv $RPM_BUILD_ROOT%{_sysconfdir}/spine.conf{.dist,}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README
-%attr(755,root,root) %{_bindir}/*
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cactid.conf
+%doc README.md
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/spine.conf
+%attr(755,root,root) %{_sbindir}/cacti-poller-spine
+%{_mandir}/man1/spine.1*