2013-11-19 16:12:38 +01:00
|
|
|
#
|
|
|
|
# spec file for package keepalived
|
|
|
|
#
|
2015-02-02 13:54:29 +01:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2013-11-19 16:12:38 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2014-01-07 11:55:56 +01:00
|
|
|
|
2014-02-12 12:12:18 +01:00
|
|
|
%if 0%{?suse_version} > 1210
|
2015-10-13 19:33:57 +02:00
|
|
|
%bcond_without systemd
|
|
|
|
%else
|
|
|
|
%bcond_with systemd
|
2014-02-12 12:12:18 +01:00
|
|
|
%endif
|
|
|
|
|
2013-11-19 16:12:38 +01:00
|
|
|
Name: keepalived
|
2015-10-07 14:01:29 +02:00
|
|
|
Version: 1.2.19
|
2013-11-19 16:12:38 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: A strong & robust keepalive facility for linux
|
2014-01-07 11:55:56 +01:00
|
|
|
License: GPL-2.0+
|
2013-11-19 16:12:38 +01:00
|
|
|
Group: Productivity/Networking/Routing
|
2014-01-07 11:55:56 +01:00
|
|
|
Url: http://www.keepalived.org/
|
2013-11-19 16:12:38 +01:00
|
|
|
Source: http://www.keepalived.org/software/keepalived-%{version}.tar.gz
|
2014-02-12 12:12:18 +01:00
|
|
|
Source1: keepalived.service
|
2014-07-31 17:36:14 +02:00
|
|
|
Source2: keepalive-rpmlintrc
|
2013-11-19 16:12:38 +01:00
|
|
|
Patch1: keepalive-init.patch
|
|
|
|
BuildRequires: openssl-devel
|
2015-02-02 13:54:29 +01:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: pkgconfig(libnl-3.0)
|
2013-11-19 16:12:38 +01:00
|
|
|
# BuildRequires: netsnmp-devel
|
|
|
|
BuildRequires: popt-devel
|
2014-01-07 11:55:56 +01:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
|
|
BuildRequires: cyrus-sasl-devel
|
|
|
|
%endif
|
2013-11-19 16:12:38 +01:00
|
|
|
Requires(pre): pwdutils
|
|
|
|
Requires(pre): %insserv_prereq
|
|
|
|
Requires(pre): %fillup_prereq
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2014-02-12 12:12:18 +01:00
|
|
|
BuildRequires: systemd
|
|
|
|
Requires: systemd
|
|
|
|
%endif
|
|
|
|
|
2013-11-19 16:12:38 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
The main goal of this project is to provide simple and robust facilities for
|
|
|
|
loadbalancing and high-availability to Linux system and Linux based
|
|
|
|
infrastructures. Loadbalancing framework relies on well-known and widely used
|
|
|
|
Linux Virtual Server (IPVS) kernel module providing Layer4 loadbalancing.
|
|
|
|
Keepalived implements a set of checkers to dynamically and adaptively maintain
|
|
|
|
and manage loadbalanced server pool according their health. On the other hand
|
|
|
|
high-availability is achieved by VRRP protocol. VRRP is a fundamental brick for
|
|
|
|
router failover. In addition, Keepalived implements a set of hooks to the VRRP
|
|
|
|
finite state machine providing low-level and high-speed protocol interactions.
|
|
|
|
Keepalived frameworks can be used independently or all together to provide
|
|
|
|
resilient infrastructures.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
%patch1
|
|
|
|
|
|
|
|
%build
|
2015-02-02 13:54:29 +01:00
|
|
|
export STRIP=true
|
|
|
|
export CFLAGS="%optflags -DOPENSSL_NO_SSL_INTERN"
|
2013-11-19 16:12:38 +01:00
|
|
|
%configure
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
|
|
|
make install DESTDIR="%{buildroot}"
|
|
|
|
install -dD -m 0750 %{buildroot}%{_var}/lib/%{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
install -D -m 0644 %{buildroot}/etc/sysconfig/keepalived %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}
|
|
|
|
|
|
|
|
%if %{with systemd}
|
2014-02-12 12:12:18 +01:00
|
|
|
install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
2015-10-13 19:33:57 +02:00
|
|
|
ln -s /sbin/service %{buildroot}%{_sbindir}/rckeepalived
|
|
|
|
%else
|
|
|
|
install -D -m 0750 keepalived/etc/init.d/keepalived.suse.init %{buildroot}/etc/init.d/keepalived
|
|
|
|
ln -s /etc/init.d/keepalived %{buildroot}%{_sbindir}/rckeepalived
|
2014-02-12 12:12:18 +01:00
|
|
|
%endif
|
|
|
|
|
2013-11-19 16:12:38 +01:00
|
|
|
chmod -R o= %{buildroot}/etc/keepalived
|
2015-10-13 19:33:57 +02:00
|
|
|
rm -rv %{buildroot}/etc/rc.d/init.d/keepalived %{buildroot}/etc/keepalived/samples/ %{buildroot}/etc/sysconfig/keepalived
|
2013-11-19 16:12:38 +01:00
|
|
|
|
|
|
|
%pre
|
2014-11-10 11:17:04 +01:00
|
|
|
/usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || :
|
|
|
|
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "Keepalived" -d %{_var}/lib/%{name} %{name} >/dev/null 2>&1 || :
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2013-11-19 16:12:38 +01:00
|
|
|
%service_add_pre %{name}.service %{name}.socket
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%stop_on_removal %{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2013-11-19 16:12:38 +01:00
|
|
|
%service_del_preun %{name}.service %{name}.socket
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%post
|
|
|
|
%fillup_only %{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2013-11-19 16:12:38 +01:00
|
|
|
%service_add_post %{name}.service %{name}.socket
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%insserv_cleanup
|
|
|
|
%restart_on_update %{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2013-11-19 16:12:38 +01:00
|
|
|
%service_del_postun %{name}.service %{name}.socket
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc README COPYING
|
|
|
|
%config(noreplace) %attr(-,root,keepalived) /etc/keepalived/
|
|
|
|
%{_bindir}/genhash
|
|
|
|
%{_sbindir}/rckeepalived
|
|
|
|
%{_sbindir}/keepalived
|
|
|
|
%{_mandir}/man1/genhash.1.gz
|
|
|
|
%{_mandir}/man5/keepalived.conf.5.gz
|
|
|
|
%{_mandir}/man8/keepalived.8.gz
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2014-02-12 12:12:18 +01:00
|
|
|
%{_unitdir}/%name.service
|
2015-10-13 19:33:57 +02:00
|
|
|
%else
|
|
|
|
/etc/init.d/keepalived
|
2014-02-12 12:12:18 +01:00
|
|
|
%endif
|
2013-11-19 16:12:38 +01:00
|
|
|
%dir %attr(-,keepalived,keepalived) %{_var}/lib/%{name}
|
|
|
|
/var/adm/fillup-templates/sysconfig.%{name}
|
|
|
|
%doc AUTHOR ChangeLog CONTRIBUTORS COPYING README
|
|
|
|
%doc doc/samples/
|
|
|
|
%doc doc/keepalived.conf.SYNOPSIS doc/KEEPALIVED-MIB doc/NOTE_vrrp_vmac.txt
|
|
|
|
|
|
|
|
%changelog
|