view routeflapper.spec.in @ 7:3c0db610c641

add bgpd config file and proper logrotate config
author Carl Byington <carl@five-ten-sg.com>
date Thu, 04 Sep 2014 08:53:18 -0700
parents 5e7c39aa868c
children 69a5dcf953df
line wrap: on
line source

%define localstatedir   /var/lib

Summary:            Route flap detector
Name:               @PACKAGE@
Version:            @VERSION@
Release:            2%{?dist}
License:            GPLv3+
Group:              System Environment/Daemons
Source:             http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz
BuildRoot:          %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
URL:                http://www.five-ten-sg.com/%{name}/

Requires(post,preun):   /sbin/chkconfig
Requires(post,preun):   /sbin/service
Requires:               quagga
Requires:               coreutils
BuildRequires:          gcc gcc-c++


%description
This is a route flap detector, that classifies certain routes as
suspicious. It uses the log entries produced by bgpd from the quagga
package to maintain a shadow copy of the bgp routing table. Any
routes that are new are suspicious, as are any routes that have
as paths with newly adjacent as systems.

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/quagga
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}           $RPM_BUILD_ROOT/etc/rc.d/init.d
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/routeflapper
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/bgpd.conf         $RPM_BUILD_ROOT%{_sysconfdir}/quagga
mkdir -p $RPM_BUILD_ROOT/var/run/%{name}


%clean
rm -rf $RPM_BUILD_ROOT


%pre


%post
/sbin/chkconfig --add %{name}
touch /var/log/bgp
chown quagga:quagga /var/log/bgp


%preun
[ $1 = 0 ] && /sbin/service %{name} stop || :
[ $1 = 0 ] && /sbin/chkconfig --del %{name}


%postun


%files
%defattr(-,root,root,-)
%{_sbindir}/*
%{_mandir}/man1/*
%{_mandir}/man5/*
%docdir %{_datadir}/doc/%{name}-%{version}
%{_datadir}/doc/%{name}-%{version}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/quagga/bgpd.conf
/etc/rc.d/init.d/%{name}
/etc/logrotate.d/%{name}
%dir %attr(0750,%{name},root) /var/run/%{name}


%changelog
* Thu Sep 04 2014 Carl Byington <carl@five-ten-sg.com> - 1.0.1-2
- add bgpd.conf and logrotate files
- fix uninstall, chkconfig del in preun, not postun

* Thu Jun 12 2008 Carl Byington <carl@five-ten-sg.com> - 1.0.1-1
- initial version