keepalived/keepalived.spec
Dirk Mueller e2fdff3ae9 Accepting request 545873 from home:itxaka:branches:network
Revert using github tarball and use original source again.

Update to 1.3.9: Too many fixes and features to list, refer to
  /usr/share/doc/packages/keepalived/ChangeLog for a detailed list.

OBS-URL: https://build.opensuse.org/request/show/545873
OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=35
2017-11-27 10:49:50 +00:00

192 lines
5.8 KiB
RPMSpec

#
# spec file for package keepalived
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%if 0%{?suse_version} > 1210
%bcond_without systemd
%else
%bcond_with systemd
%endif
%bcond_with dbus
Name: keepalived
Version: 1.3.9
Release: 0
Summary: A strong & robust keepalive facility for linux
License: GPL-2.0+
Group: Productivity/Networking/Routing
Url: http://www.keepalived.org/
Source: http://www.keepalived.org/software/keepalived-%{version}.tar.gz
Source1: keepalived.service
Source2: keepalive-rpmlintrc
Patch1: keepalive-init.patch
BuildRequires: libnfnetlink-devel
BuildRequires: net-snmp-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: snmp-mibs
%if 0%{?suse_version} > 1110
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(libipset)
BuildRequires: pkgconfig(libiptc)
BuildRequires: pkgconfig(libnl-3.0)
BuildRequires: pkgconfig(xtables)
%else
BuildRequires: dbus-1-devel
BuildRequires: glib2-devel
BuildRequires: ipset-devel
BuildRequires: libiptc-devel
BuildRequires: libnl-devel
BuildRequires: libxtables-devel
%endif
BuildRequires: libnfnetlink-devel
# BuildRequires: netsnmp-devel
BuildRequires: popt-devel
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
BuildRequires: cyrus-sasl-devel
%endif
Requires(pre): pwdutils
Requires(pre): %insserv_prereq
Requires(pre): %fillup_prereq
%if %{with systemd}
BuildRequires: systemd
Requires: systemd
%endif
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 -p0
%build
export STRIP=true
export CPPFLAGS="$(pkg-config --cflags libnfnetlink libiptc libipset xtables)"
export CFLAGS="%optflags -DOPENSSL_NO_SSL_INTERN"
%configure \
--disable-silent-rules \
--enable-snmp \
--enable-snmp-vrrp \
%if %{with dbus}
--enable-dbus \
--enable-dbus-create-instance \
%endif
--enable-snmp-checker \
--enable-snmp-rfc \
--enable-snmp-rfcv2 \
--enable-snmp-rfcv3 \
--enable-sha1 \
--enable-routes \
--enable-libiptc \
--enable-libipset
make %{?_smp_mflags}
%install
make install DESTDIR="%{buildroot}"
install -dD -m 0750 %{buildroot}%{_var}/lib/%{name}
install -D -m 0644 %{buildroot}/etc/sysconfig/keepalived %{buildroot}%{_fillupdir}/sysconfig.%{name}
%if %{with systemd}
install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
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
%endif
chmod -R o= %{buildroot}/etc/keepalived
rm -rv %{buildroot}/etc/keepalived/samples/ %{buildroot}/etc/sysconfig/keepalived
%pre
/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 || :
%if %{with systemd}
%service_add_pre %{name}.service %{name}.socket
%endif
%preun
%stop_on_removal %{name}
%if %{with systemd}
%service_del_preun %{name}.service %{name}.socket
%endif
%post
%fillup_only %{name}
%if %{with systemd}
%service_add_post %{name}.service %{name}.socket
%endif
%postun
%insserv_cleanup
%restart_on_update %{name}
%if %{with systemd}
%service_del_postun %{name}.service %{name}.socket
%endif
%files
%defattr(-,root,root)
%doc README COPYING ChangeLog
%doc %{_datadir}/doc/keepalived/
%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
%{_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
#
%if %{with systemd}
%{_unitdir}/%name.service
%else
/etc/init.d/keepalived
%endif
%dir %attr(-,keepalived,keepalived) %{_var}/lib/%{name}
%{_fillupdir}/sysconfig.%{name}
%doc AUTHOR ChangeLog CONTRIBUTORS COPYING README
%doc doc/samples/
%doc doc/keepalived.conf.SYNOPSIS doc/NOTE_vrrp_vmac.txt
%changelog