File keepalived.spec of Package keepalived

# needsrootforbuild
Name:		keepalived
Summary:	HA monitor built upon LVS, VRRP and services poller
Version: 	1.1.20
Release: 	1
Source0: 	http://www.keepalived.org/software/%{name}-%{version}.tar.gz
Source1:	%{name}.init
Patch0:		%{name}-initdir.diff
License: 	GPL
Group: 		Applications/System
BuildRoot: 	/tmp/%{name}-%{version}.build

BuildRequires:	openssl-devel ipvsadm
%if 0%{?suse_version}
BuildRequires:	kernel-source popt-devel
%endif
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
BuildRequires:	kernel-devel popt
%define		kdir %(echo `find /usr/src/kernels -maxdepth 1 -type d |grep "2.6"`)
%endif
Requires:	ipvsadm

%description
The main goal of the keepalived project is to add a strong & robust keepalive facility to the Linux Virtual Server project. This project is written in C with multilayer TCP/IP stack checks. Keepalived implements a framework based on three family checks : Layer3, Layer4 & Layer5. This framework gives the daemon the ability of checking a LVS server pool states. When one of the server of the LVS server pool is down, keepalived informs the linux kernel via a setsockopt call to remove this server entrie from the LVS topology. In addition keepalived implements a VRRPv2 stack to handle director failover. So in short keepalived is a userspace daemon for LVS cluster nodes healthchecks and LVS directors failover.

%prep
rm -rf %{buildroot}
%setup -q
%patch0 -p1

%build
export CFLAGS=-D__KERNGLUE__
# the setting of mandir should be %{buildroot}/usr/share/man, but the
# makefile adds "man" itself.
./configure --prefix=%{_prefix} \
	--exec-prefix=%{_prefix} \
	--sysconfdir=%{_sysconfdir} \
	%if 0%{?suse_version}
	--with-kernel-dir=/usr/src/linux \
	%endif
	%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
	--with-kernel-dir=%{kdir} \
	%endif
	--mandir=%{_prefix}/share/man \
	--enable-syncd || cat config.log
	
%{__make}

%install
rm -rf %{buildroot}
%makeinstall
cd $RPM_BUILD_ROOT/%{_sbindir}
%if 0%{?suse_version}
cp %{S:1} %{buildroot}/etc/init.d/keepalived
# move sysconfig file
mkdir -p %{buildroot}/var/adm/fillup-templates
mv %{buildroot}/etc/sysconfig/%{name} %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
%endif
ln -sf ../../etc/init.d/keepalived rckeepalived
rm -rf %{buildroot}/etc/keepalived/samples

%clean
rm -rf %{buildroot}

%post
%if 0%{?suse_version}
%fillup_and_insserv %{name}
%endif

%preun
%if 0%{?suse_version}
%stop_on_removal %{name}
%endif

%postun
%if 0%{?suse_version}
%restart_on_update %{name}
%{insserv_cleanup}
%endif

%files
%defattr(-,root,root)
%{_bindir}/genhash
%{_sbindir}/keepalived
%{_sbindir}/rckeepalived
%{_sysconfdir}/init.d/keepalived
%if 0%{?suse_version}
/var/adm/fillup-templates/sysconfig.%{name}
%else
%config %{_sysconfdir}/sysconfig/keepalived
%endif
%dir %{_sysconfdir}/keepalived/
%config(noreplace) %{_sysconfdir}/keepalived/keepalived.conf
%doc %{_mandir}/man5/keepalived.conf.5*
%doc %{_mandir}/man1/genhash.1*
%doc %{_mandir}/man8/keepalived.8*
%doc doc
%doc AUTHOR CONTRIBUTORS TODO COPYING README INSTALL VERSION ChangeLog

%changelog
* Thu May 27 2010 Carsten Schoene <cs@linux-administrator.com> - 1.1.20-1
- update to release 1.1.20
 - Extend ip and route framework to support existing entries
 - Fix broadcast display
 - Fix genhash parsing issue
 - destroy old signal pipes on reload
 - Fix SMTP checker issue
 - handle non-existant default interface in VIP definition
 - Remove alive realserver when quorum is lost
 - Fix a segfault issue if virtual_server is empty
 - Keep previous effective VRRP priority on reload
 - Fix VRRP script handling
 - On reload keep VRRP scripts status
 - Remove IPVS Kernel 2.2 support

* Thu Oct 01 2009 Carsten Schoene <cs@linux-administrator.com> - 1.1.19-1
- update to release 1.1.19
 - Fixed segfault issue while parsing virtual_server
 - Fixed SIGCHLD handling upton reload
 - Fixed VRRP nopreempt from FAULT state

* Thu Sep 24 2009 Carsten Schoene <cs@linux-administrator.com> - 1.1.18-1
- update to release 1.1.18
 - Fixed reloading issues
 - Fixed a VRRP multicast group leave issue
 - Fixed initial value of quorum state
 - Fixed sorry server removal to take care of quorum state
 - Fixed a signal handling issue while reloading
 - Fixed PID handling
 - Updated media link failure detection strategy 
 - Misc cosmetics fixes
 - Added support to delayed VRRP script launching

* Sat Jul 18 2009 Carsten Schoene <cs@linux-administrator.com> - 1.1.17-2
- pre/post macros added
- do sysconfig installation with fillup_and_insserv on SuSE systems

* Sun Mar 08 2009 Carsten Schoene <cs@linux-administrator.com>
- update to release 1.1.17
 - Fixed a regression brought by previous release during low-level scheduler timer computation.
 - Fixed VRRP MII code to properly test BMSR.
 - Optimized VRRP script initialization.

* Mon Feb 16 2009 Carsten Schoene <cs@linux-administrator.com>
- update to release 1.1.16

* Wed Sep 03 2008 Carsten Schoene <cs@linux-administrator.com>
- build for CentOS 5 & hopefully for other RH based distributions

* Wed Jul 30 2008 Carsten Schoene <cs@linux-administrator.com>
- build for RHEL 5

* Thu Nov 01 2007 Carsten Schoene <cs@linux-administrator.com>
- add new init script for SuSE environments

* Fri Sep 21 2007 Carsten Schoene <cs@linux-administrator.com>
- version changed to 1.1.15
 - Fixed genshash makefile. 
 - Removed http healthchecker buffer minimization causing crash. 
 - Fixed parser include directive to support multi-level configuration includes. 
 - Extended SSL checker for better handling of SSL handshake. 
 - Fixed http healthcheker issue while processing MD5SUM. 
 - Fixed missing notifications upon VRRP state transition. 
 - Add support for VRRP virtual_routes to route metric.
 - Add a patch for init_dir setting 

* Sat Sep 15 2007 Carsten Schoene <cs@linux-administrator.com>
- version changed to 1.1.14
 - Extended parsing framework to support include directives and error logging. 
 - Merged patches from rpmforge. 
 - Add script goodies directory. 
 - Fixed compilation issue in VRRP code. 
 - Fixed VRRP negative weights in script. 
 - Extended VRRP framework to support Old-style Linux aliases. 
 - Add support to VRRP script logging

openSUSE Build Service is sponsored by