2013-11-19 16:12:38 +01:00
|
|
|
#
|
|
|
|
# spec file for package keepalived
|
|
|
|
#
|
2019-01-20 10:14:28 +01:00
|
|
|
# Copyright (c) 2019 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.
|
|
|
|
|
2019-07-23 23:02:11 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-11-19 16:12:38 +01:00
|
|
|
#
|
|
|
|
|
2014-01-07 11:55:56 +01:00
|
|
|
|
2017-11-24 09:44:30 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
|
|
|
|
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
|
2019-01-20 10:14:28 +01:00
|
|
|
|
2018-11-12 11:09:35 +01:00
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%bcond_without dbus
|
2019-01-20 10:14:28 +01:00
|
|
|
%bcond_without keepalived_nftables
|
2018-11-12 11:09:35 +01:00
|
|
|
%else
|
|
|
|
%bcond_with dbus
|
2019-01-20 10:14:28 +01:00
|
|
|
%bcond_with keepalived_nftables
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
%bcond_without keepalived_regex
|
|
|
|
%else
|
|
|
|
%bcond_with keepalived_regex
|
2018-11-12 11:09:35 +01:00
|
|
|
%endif
|
|
|
|
%bcond_without json
|
2014-02-12 12:12:18 +01:00
|
|
|
|
2013-11-19 16:12:38 +01:00
|
|
|
Name: keepalived
|
2019-07-23 23:02:11 +02:00
|
|
|
Version: 2.0.17
|
2013-11-19 16:12:38 +01:00
|
|
|
Release: 0
|
2017-11-27 15:04:41 +01:00
|
|
|
Summary: A keepalive facility for Linux
|
2018-05-01 10:53:34 +02:00
|
|
|
License: GPL-2.0-or-later
|
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/
|
- update to 1.4.1:
* Improve and fix use of getopt_long().
We musn't use a long option val of 1, since getopt_long() can return
that value.
getopt_long() also returns longindex == 0 when there is no matching
long option, and there needs to be careful checking if there is an
error to work out whether a long or short option was used, which is
needed for meaningful error messages.
* Write assert() messages to syslog.
assert()s are nasty things, but at least let's get the benefit of
them, and write the messages to syslog, rather than losing them down
stderr.
* Enable sorry server at startup if quorum down due to alpha mode
If alpha mode is configured on sufficient checkers so that a
virtual server doesn't have a quorum, we need to add the sorry
server at startup, otherwise it won't be added until a quorum has
been achieved and subsequently lost again. In the case where some
of the checkers remain in the down state at startup, this would have
meant that the sorry server never got added.
* For virtual servers, ensure quorum <= number of real servers
If the quorum were gigher than the number of real servers, the
quorum for the real server to come up could never be achieved, so
if the quorum is greater than the number of real servers, reduce it
to the number of real servers.
* Fix some SNMP keepalived checker integer types and default values.
Some virtual server and real server values were being sent to SNMP
with a signed type whereas the value is unsigned, so set the type
field correctly.
Some virtual server and real server values that apply to checkers
are set to nonsense default values in order to determine if a
OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=42
2018-02-22 00:10:27 +01:00
|
|
|
Source: http://www.keepalived.org/software/%{name}-%{version}.tar.gz
|
2014-07-31 17:36:14 +02:00
|
|
|
Source2: keepalive-rpmlintrc
|
2013-11-19 16:12:38 +01:00
|
|
|
Patch1: keepalive-init.patch
|
2018-02-22 11:07:39 +01:00
|
|
|
# PATCH-FIX-UPSTREAM: https://github.com/acassen/keepalived/commit/947248af144bcab6376ccddab8dc40f313b14281.patch
|
|
|
|
Patch2: linux-4.15.patch
|
2019-04-03 21:17:23 +02:00
|
|
|
BuildRequires: file-devel
|
2016-01-28 12:52:05 +01:00
|
|
|
BuildRequires: net-snmp-devel
|
2015-02-02 13:54:29 +01:00
|
|
|
BuildRequires: pkgconfig
|
2016-03-09 18:20:53 +01:00
|
|
|
BuildRequires: snmp-mibs
|
2016-12-14 18:08:35 +01:00
|
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
|
|
BuildRequires: pkgconfig(gio-2.0)
|
2019-01-20 10:14:28 +01:00
|
|
|
BuildRequires: pkgconfig(openssl)
|
|
|
|
%if %{with json}
|
2018-01-22 15:07:53 +01:00
|
|
|
BuildRequires: pkgconfig(json-c)
|
2019-01-20 10:14:28 +01:00
|
|
|
%endif
|
2016-12-14 18:08:35 +01:00
|
|
|
BuildRequires: pkgconfig(libipset)
|
|
|
|
BuildRequires: pkgconfig(libiptc)
|
2015-02-02 13:54:29 +01:00
|
|
|
BuildRequires: pkgconfig(libnl-3.0)
|
2019-01-20 10:14:28 +01:00
|
|
|
%if %{with keepalived_regex}
|
2018-11-12 11:09:35 +01:00
|
|
|
BuildRequires: pkgconfig(libpcre2-8)
|
2016-01-28 14:11:17 +01:00
|
|
|
%endif
|
2019-01-20 10:14:28 +01:00
|
|
|
BuildRequires: pkgconfig(libnfnetlink)
|
|
|
|
%if %{with keepalived_nftables}
|
|
|
|
BuildRequires: pkgconfig(libnftables)
|
2014-01-07 11:55:56 +01:00
|
|
|
%endif
|
2019-01-20 10:14:28 +01:00
|
|
|
BuildRequires: pkgconfig(popt)
|
|
|
|
BuildRequires: pkgconfig(xtables)
|
2013-11-19 16:12:38 +01:00
|
|
|
Requires(pre): pwdutils
|
|
|
|
Requires(pre): %fillup_prereq
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2018-05-01 10:53:34 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
%{?systemd_requires}
|
|
|
|
%else
|
|
|
|
Requires(pre): %insserv_prereq
|
2014-02-12 12:12:18 +01:00
|
|
|
%endif
|
2013-11-19 16:12:38 +01:00
|
|
|
|
|
|
|
%description
|
2018-01-15 16:17:04 +01:00
|
|
|
This project provides facilities for load balancing and high-availability to
|
|
|
|
Linux system and Linux-based infrastructures. The load-balancing framework
|
|
|
|
relies on the Linux Virtual Server (IPVS) kernel module providing Layer4 load
|
|
|
|
balancing. Keepalived implements a set of checkers to dynamically and
|
|
|
|
adaptively maintain and manage loadbalanced server pool according their health.
|
2017-11-27 15:04:41 +01:00
|
|
|
High-availability is achieved by the VRRP protocol, a fundamental brick for
|
2013-11-19 16:12:38 +01:00
|
|
|
router failover. In addition, Keepalived implements a set of hooks to the VRRP
|
2017-11-27 15:04:41 +01:00
|
|
|
finite state machine, providing low-level and high-speed protocol interactions.
|
2013-11-19 16:12:38 +01:00
|
|
|
Keepalived frameworks can be used independently or all together to provide
|
|
|
|
resilient infrastructures.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2018-01-15 16:17:04 +01:00
|
|
|
%patch1 -p1
|
2019-07-23 23:02:11 +02:00
|
|
|
%patch2 -p0
|
2018-01-15 16:17:04 +01:00
|
|
|
chmod 644 doc/samples/*
|
2013-11-19 16:12:38 +01:00
|
|
|
|
|
|
|
%build
|
2015-02-02 13:54:29 +01:00
|
|
|
export STRIP=true
|
2016-12-14 18:08:35 +01:00
|
|
|
export CPPFLAGS="$(pkg-config --cflags libnfnetlink libiptc libipset xtables)"
|
|
|
|
export CFLAGS="%optflags -DOPENSSL_NO_SSL_INTERN"
|
2019-01-20 10:14:28 +01:00
|
|
|
# --enable-dbus-create-instance \
|
2016-12-14 18:08:35 +01:00
|
|
|
%configure \
|
|
|
|
--disable-silent-rules \
|
2018-11-12 11:09:35 +01:00
|
|
|
--enable-bfd \
|
2018-01-15 16:17:04 +01:00
|
|
|
%if %{with json}
|
|
|
|
--enable-json \
|
|
|
|
%endif
|
2016-12-14 18:08:35 +01:00
|
|
|
--enable-snmp \
|
2018-11-12 11:09:35 +01:00
|
|
|
--enable-snmp-checker \
|
2016-12-14 18:08:35 +01:00
|
|
|
--enable-snmp-vrrp \
|
2018-01-22 15:07:53 +01:00
|
|
|
--enable-snmp-rfc \
|
|
|
|
--enable-snmp-rfcv2 \
|
|
|
|
--enable-snmp-rfcv3 \
|
2016-12-14 18:08:35 +01:00
|
|
|
%if %{with dbus}
|
|
|
|
--enable-dbus \
|
|
|
|
%endif
|
2019-01-20 10:14:28 +01:00
|
|
|
%if %{with keepalived_regex}
|
2018-11-12 11:09:35 +01:00
|
|
|
--enable-regex \
|
|
|
|
--enable-regex-timers \
|
2019-01-20 10:14:28 +01:00
|
|
|
%endif
|
|
|
|
%if %{with keepalived_nftables}
|
|
|
|
--enable-nftables \
|
|
|
|
%endif
|
2018-01-15 16:17:04 +01:00
|
|
|
%if %{with systemd}
|
|
|
|
--with-init=systemd \
|
|
|
|
--with-systemdsystemunitdir="%{_unitdir}" \
|
|
|
|
%endif
|
2016-12-14 18:08:35 +01:00
|
|
|
--enable-snmp-checker \
|
|
|
|
--enable-snmp-rfc \
|
|
|
|
--enable-snmp-rfcv2 \
|
|
|
|
--enable-snmp-rfcv3 \
|
|
|
|
--enable-sha1 \
|
|
|
|
--enable-routes \
|
|
|
|
--enable-libiptc \
|
2018-01-22 15:07:53 +01:00
|
|
|
--enable-libipset \
|
|
|
|
--disable-libipset-dynamic \
|
|
|
|
--enable-libnl \
|
|
|
|
--enable-stacktrace \
|
|
|
|
--enable-json
|
2013-11-19 16:12:38 +01:00
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
%install
|
2017-11-27 15:04:41 +01:00
|
|
|
%make_install
|
2013-11-19 16:12:38 +01:00
|
|
|
install -dD -m 0750 %{buildroot}%{_var}/lib/%{name}
|
2017-11-24 09:44:30 +01:00
|
|
|
install -D -m 0644 %{buildroot}/etc/sysconfig/keepalived %{buildroot}%{_fillupdir}/sysconfig.%{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
|
|
|
|
%if %{with systemd}
|
|
|
|
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
|
2016-12-14 18:08:35 +01:00
|
|
|
rm -rv %{buildroot}/etc/keepalived/samples/ %{buildroot}/etc/sysconfig/keepalived
|
2013-11-19 16:12:38 +01:00
|
|
|
|
2018-01-15 16:17:04 +01:00
|
|
|
%check
|
|
|
|
# A build could silently have LVS support disabled if the kernel includes can't
|
|
|
|
# be properly found, we need to avoid that.
|
|
|
|
if ! grep -q "#define _WITH_LVS_ *1" lib/config.h; then
|
|
|
|
%{__echo} "ERROR: We do not want keepalived lacking LVS support." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-11-19 16:12:38 +01:00
|
|
|
%pre
|
2017-11-27 15:04:41 +01:00
|
|
|
getent group %{name} >/dev/null || /usr/sbin/groupadd -r %{name}
|
|
|
|
getent passwd %{name} >/dev/null || \
|
|
|
|
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "Keepalived" \
|
|
|
|
-d %{_var}/lib/%{name} %{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2018-01-22 15:07:53 +01:00
|
|
|
%service_add_pre %{name}.service
|
2013-11-19 16:12:38 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%preun
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2018-01-22 15:07:53 +01:00
|
|
|
%service_del_preun %{name}.service
|
2018-05-01 10:53:34 +02:00
|
|
|
%else
|
|
|
|
%stop_on_removal %{name}
|
2013-11-19 16:12:38 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%post
|
|
|
|
%fillup_only %{name}
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2018-01-22 15:07:53 +01:00
|
|
|
%service_add_post %{name}.service
|
2013-11-19 16:12:38 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun
|
2015-10-13 19:33:57 +02:00
|
|
|
%if %{with systemd}
|
2018-01-22 15:07:53 +01:00
|
|
|
%service_del_postun %{name}.service
|
2018-05-01 10:53:34 +02:00
|
|
|
%else
|
|
|
|
%insserv_cleanup
|
|
|
|
%restart_on_update %{name}
|
2013-11-19 16:12:38 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2018-11-12 11:09:35 +01:00
|
|
|
%license COPYING
|
|
|
|
%doc AUTHOR ChangeLog CONTRIBUTORS README
|
2017-11-27 11:49:50 +01:00
|
|
|
%doc %{_datadir}/doc/keepalived/
|
2018-01-15 16:17:04 +01:00
|
|
|
%doc doc/samples/
|
|
|
|
%doc doc/keepalived.conf.SYNOPSIS doc/NOTE_vrrp_vmac.txt
|
|
|
|
%dir %{_sysconfdir}/keepalived
|
|
|
|
%dir %attr(-,keepalived,keepalived) %{_var}/lib/%{name}
|
|
|
|
%{_fillupdir}/sysconfig.%{name}
|
|
|
|
%config(noreplace) %{_sysconfdir}/keepalived/*conf
|
2013-11-19 16:12:38 +01:00
|
|
|
%{_bindir}/genhash
|
|
|
|
%{_sbindir}/rckeepalived
|
|
|
|
%{_sbindir}/keepalived
|
2018-01-15 16:17:04 +01:00
|
|
|
%{_mandir}/man1/genhash.1*
|
|
|
|
%{_mandir}/man5/keepalived.conf.5*
|
|
|
|
%{_mandir}/man8/keepalived.8*
|
2016-12-14 18:08:35 +01:00
|
|
|
%{_datadir}/snmp/mibs/KEEPALIVED-MIB.txt
|
|
|
|
%{_datadir}/snmp/mibs/VRRP-MIB.txt
|
|
|
|
%{_datadir}/snmp/mibs/VRRPv3-MIB.txt
|
|
|
|
#
|
|
|
|
%if %{with dbus}
|
|
|
|
%config /etc/dbus-1/system.d/org.keepalived.Vrrp1.conf
|
|
|
|
%{_datadir}/dbus-1/interfaces/org.keepalived.Vrrp1.Instance.xml
|
|
|
|
%{_datadir}/dbus-1/interfaces/org.keepalived.Vrrp1.Vrrp.xml
|
|
|
|
%endif
|
|
|
|
#
|
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
|
|
|
|
|
|
|
%changelog
|