2012-05-16 15:03:19 +02:00
|
|
|
#
|
|
|
|
# spec file for package libteam
|
|
|
|
#
|
2018-01-05 01:28:58 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2012-05-16 15:03:19 +02: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/
|
|
|
|
#
|
2012-11-17 07:25:41 +01:00
|
|
|
|
|
|
|
|
2018-01-05 01:28:58 +01:00
|
|
|
%bcond_without python2
|
2012-05-16 15:03:19 +02:00
|
|
|
Name: libteam
|
2017-11-22 12:30:47 +01:00
|
|
|
Version: 1.27
|
2015-01-09 00:32:55 +01:00
|
|
|
Release: 0
|
2012-05-16 15:03:19 +02:00
|
|
|
Summary: Utilities for controlling 802.1AX team network device
|
|
|
|
License: LGPL-2.1+
|
|
|
|
Group: System/Kernel
|
2013-04-03 13:02:53 +02:00
|
|
|
Url: http://libteam.org/
|
2018-01-05 01:34:33 +01:00
|
|
|
|
2012-05-16 15:03:19 +02:00
|
|
|
#Git-Web: https://github.com/jpirko/libteam
|
|
|
|
#Git-Clone: git://github.com/jpirko/libteam
|
2014-08-13 08:48:49 +02:00
|
|
|
Source: http://libteam.org/files/%name-%version.tar.gz
|
2018-01-05 01:28:58 +01:00
|
|
|
Patch0: check_if_psr_ops_were_initialized.patch
|
|
|
|
Patch1: start_teamd_from_usr_sbin.patch
|
|
|
|
Patch2: ignore_ebusy_for_team_hwaddr_set.patch
|
|
|
|
Patch3: 0001-allow-send_interface-dbus.patch
|
2015-01-09 00:32:55 +01:00
|
|
|
BuildRequires: doxygen
|
2017-11-22 11:56:03 +01:00
|
|
|
BuildRequires: libcap-devel
|
2018-01-05 01:34:33 +01:00
|
|
|
BuildRequires: pkg-config
|
2012-11-17 07:25:41 +01:00
|
|
|
BuildRequires: swig
|
|
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
|
|
BuildRequires: pkgconfig(jansson)
|
|
|
|
BuildRequires: pkgconfig(libdaemon)
|
|
|
|
BuildRequires: pkgconfig(libnl-3.0) >= 3.2.0
|
|
|
|
BuildRequires: pkgconfig(libnl-cli-3.0) >= 3.2.0
|
|
|
|
BuildRequires: pkgconfig(libnl-genl-3.0) >= 3.2.0
|
2014-08-13 08:48:49 +02:00
|
|
|
BuildRequires: pkgconfig(libnl-route-3.0) >= 3.2.0
|
2018-01-05 01:28:58 +01:00
|
|
|
%if %{with python2}
|
|
|
|
BuildRequires: pkgconfig(python2)
|
|
|
|
%endif
|
2012-11-17 07:25:41 +01:00
|
|
|
%if 0%{?suse_version} >= 1220
|
2014-08-13 08:48:49 +02:00
|
|
|
BuildRequires: systemd-rpm-macros
|
2012-11-17 07:25:41 +01:00
|
|
|
%endif
|
2018-01-05 01:34:33 +01:00
|
|
|
%define teamd_user teamd
|
|
|
|
%define teamd_group daemon
|
|
|
|
%define teamd_daemon_directory /run/teamd
|
|
|
|
%define teamd_dbus_policy_directory %_sysconfdir/dbus-1/system.d
|
|
|
|
%define teamd_dbus_policy_name org.libteam.teamd.conf
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
A library which is the user-space counterpart for the team network
|
|
|
|
driver, and provides an API to control them.
|
|
|
|
|
|
|
|
Linux kernel 3.3 and above offer a so-called "team" network driver -
|
|
|
|
a lightweight mechanism for bonding multiple interfaces together.
|
|
|
|
It is a userspace-driven alternative to the existing bonding driver.
|
|
|
|
|
2014-08-13 08:48:49 +02:00
|
|
|
%package -n libteam5
|
2012-05-16 15:03:19 +02:00
|
|
|
Summary: Library for controlling 802.1AX team network device
|
|
|
|
Group: System/Libraries
|
|
|
|
|
2014-08-13 08:48:49 +02:00
|
|
|
%description -n libteam5
|
2012-05-16 15:03:19 +02:00
|
|
|
A library which is the user-space counterpart for the team network
|
|
|
|
driver, and provides an API to control them.
|
|
|
|
|
|
|
|
Linux kernel 3.3 and above offer a so-called "team" network driver -
|
|
|
|
a lightweight mechanism for bonding multiple interfaces together.
|
|
|
|
It is a userspace-driven alternative to the existing bonding driver.
|
|
|
|
|
2013-08-13 10:24:43 +02:00
|
|
|
%package -n libteamdctl0
|
|
|
|
Summary: Library for controlling the team network device daemon
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n libteamdctl0
|
|
|
|
Linux kernel 3.3 and above offer a so-called "team" network driver -
|
|
|
|
a lightweight mechanism for bonding multiple interfaces together.
|
|
|
|
It is a userspace-driven alternative to the existing bonding driver.
|
|
|
|
|
2012-05-16 15:03:19 +02:00
|
|
|
%package devel
|
|
|
|
Summary: Development files for libteam
|
|
|
|
Group: Development/Libraries/C and C++
|
2014-08-13 08:48:49 +02:00
|
|
|
Requires: libteam5 = %version
|
2013-08-13 10:24:43 +02:00
|
|
|
Requires: libteamdctl0 = %version
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
A library which is the user-space counterpart for the team network
|
|
|
|
driver, and provides an API to control them.
|
|
|
|
|
2013-08-13 10:24:43 +02:00
|
|
|
This package contains the development headers for the libteam and
|
|
|
|
libteamdctl libraries.
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%package tools
|
2012-11-17 07:25:41 +01:00
|
|
|
Summary: Utilities for controlling team network devices
|
|
|
|
Group: System/Daemons
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%description tools
|
|
|
|
This package contains frontends to libteam that allow changing
|
|
|
|
the (team-specific) properties of team devices.
|
|
|
|
(The general configuration of network devices can be done
|
|
|
|
through using iproute.)
|
|
|
|
|
|
|
|
Linux kernel 3.3 and above offer a so-called "team" network driver -
|
|
|
|
a lightweight mechanism for bonding multiple interfaces together.
|
|
|
|
It is a userspace-driven alternative to the existing bonding driver.
|
|
|
|
|
2012-11-17 07:25:41 +01:00
|
|
|
%package -n python-libteam
|
|
|
|
Summary: Python bindings for libteam
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
|
|
|
|
%description -n python-libteam
|
|
|
|
This package should be installed if you want to develop Python
|
|
|
|
programs that will manipulate team network devices.
|
|
|
|
|
2012-05-16 15:03:19 +02:00
|
|
|
%prep
|
2013-04-03 13:02:53 +02:00
|
|
|
%setup -q
|
2017-11-22 11:50:23 +01:00
|
|
|
%patch0 -p1
|
|
|
|
%patch1 -p1
|
|
|
|
%patch2 -p1
|
2017-11-22 17:31:37 +01:00
|
|
|
%patch3 -p1
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%build
|
2018-01-05 01:34:33 +01:00
|
|
|
%configure --includedir="%_includedir/%name" --bindir="%_sbindir" \
|
2018-01-05 01:28:58 +01:00
|
|
|
--disable-silent-rules \
|
2017-11-22 11:50:23 +01:00
|
|
|
--disable-static \
|
|
|
|
--with-run-dir=%teamd_daemon_directory \
|
|
|
|
--with-user=%teamd_user \
|
|
|
|
--with-group=%teamd_group
|
2012-05-16 15:03:19 +02:00
|
|
|
# Use CFLAGS= to kill -Werror
|
|
|
|
make %{?_smp_mflags} CFLAGS="%optflags"
|
2018-01-05 01:28:58 +01:00
|
|
|
%if %{with python2}
|
2017-11-22 11:55:02 +01:00
|
|
|
pushd binding/python/
|
|
|
|
python ./setup.py build
|
|
|
|
popd
|
2018-01-05 01:28:58 +01:00
|
|
|
%endif
|
2012-11-17 07:25:41 +01:00
|
|
|
|
2012-05-16 15:03:19 +02:00
|
|
|
%install
|
2018-01-05 01:34:33 +01:00
|
|
|
b="%buildroot"
|
2017-11-22 11:55:02 +01:00
|
|
|
%make_install
|
2018-01-05 01:28:58 +01:00
|
|
|
%if %{with python2}
|
2017-11-22 11:55:02 +01:00
|
|
|
pushd binding/python/
|
|
|
|
python ./setup.py install --root="$b" --prefix="%_prefix"
|
|
|
|
popd
|
2018-01-05 01:28:58 +01:00
|
|
|
%endif
|
2012-11-17 07:25:41 +01:00
|
|
|
|
|
|
|
rm -f "$b/%_libdir"/*.la
|
|
|
|
%if 0%{?_unitdir:1}
|
2017-11-22 11:55:02 +01:00
|
|
|
mkdir -p "$b/%_unitdir"
|
|
|
|
install -pm0644 teamd/redhat/systemd/*.service "$b/%_unitdir/"
|
2012-11-17 07:25:41 +01:00
|
|
|
%endif
|
2012-05-16 15:03:19 +02:00
|
|
|
|
2017-11-22 11:50:23 +01:00
|
|
|
%if 0%{?_sysconfdir:1}
|
2017-11-22 11:55:02 +01:00
|
|
|
mkdir -p "$b/%teamd_dbus_policy_directory/"
|
|
|
|
install -pm0644 teamd/dbus/teamd.conf "$b/%teamd_dbus_policy_directory/%teamd_dbus_policy_name"
|
2017-11-22 11:50:23 +01:00
|
|
|
%endif
|
|
|
|
|
2012-05-16 15:03:19 +02:00
|
|
|
%check
|
|
|
|
make check
|
|
|
|
|
2014-08-13 08:48:49 +02:00
|
|
|
%pre tools
|
2017-11-22 11:55:02 +01:00
|
|
|
getent group daemon >/dev/null || %_sbindir/groupadd -r %teamd_group
|
|
|
|
getent passwd %teamd_user >/dev/null || \
|
|
|
|
%_sbindir/useradd -r -g %teamd_group -s /bin/false \
|
2018-01-05 01:34:33 +01:00
|
|
|
-c "Teamd daemon user" -d %_localstatedir/lib/empty %teamd_user
|
2017-11-22 11:55:02 +01:00
|
|
|
%_sbindir/usermod -g %teamd_group %teamd_user 2>/dev/null
|
2017-11-22 11:50:23 +01:00
|
|
|
test -L %teamd_daemon_directory || rm -rf %teamd_daemon_directory && :
|
2014-08-13 08:48:49 +02:00
|
|
|
%if 0%{?_unitdir:1}
|
|
|
|
%service_add_pre teamd@.service
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%post tools
|
2017-11-22 11:50:23 +01:00
|
|
|
# reload dbus to apply new teamd's policy
|
2018-01-05 01:34:33 +01:00
|
|
|
systemctl reload dbus.service 2>/dev/null || :
|
2014-08-13 08:48:49 +02:00
|
|
|
%if 0%{?_unitdir:1}
|
|
|
|
%service_add_post teamd@.service
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%preun tools
|
|
|
|
%if 0%{?_unitdir:1}
|
|
|
|
%service_del_preun teamd@.service
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun tools
|
|
|
|
%if 0%{?_unitdir:1}
|
|
|
|
%service_del_postun teamd@.service
|
|
|
|
%endif
|
2017-11-22 11:50:23 +01:00
|
|
|
# reload dbus to forget teamd's policy
|
|
|
|
if [ ${FIRST_ARG:-$1} -eq 0 ]; then
|
2018-01-05 01:34:33 +01:00
|
|
|
systemctl reload dbus.service 2>/dev/null || :
|
2017-11-22 11:50:23 +01:00
|
|
|
fi
|
2014-08-13 08:48:49 +02:00
|
|
|
|
|
|
|
%post -n libteam5 -p /sbin/ldconfig
|
|
|
|
%postun -n libteam5 -p /sbin/ldconfig
|
2013-08-13 10:24:43 +02:00
|
|
|
%post -n libteamdctl0 -p /sbin/ldconfig
|
|
|
|
%postun -n libteamdctl0 -p /sbin/ldconfig
|
2012-05-16 15:03:19 +02:00
|
|
|
|
2014-08-13 08:48:49 +02:00
|
|
|
%files -n libteam5
|
|
|
|
%_libdir/libteam.so.5*
|
2012-05-16 15:03:19 +02:00
|
|
|
|
2013-08-13 10:24:43 +02:00
|
|
|
%files -n libteamdctl0
|
|
|
|
%_libdir/libteamdctl.so.0*
|
|
|
|
|
2012-05-16 15:03:19 +02:00
|
|
|
%files devel
|
2018-01-05 01:34:33 +01:00
|
|
|
%_includedir/*
|
2012-05-16 15:03:19 +02:00
|
|
|
%_libdir/libteam.so
|
2013-08-13 10:24:43 +02:00
|
|
|
%_libdir/libteamdctl.so
|
|
|
|
%_libdir/pkgconfig/libteam*.pc
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%files tools
|
2013-08-13 10:24:43 +02:00
|
|
|
%_sbindir/bond2team
|
2012-05-16 15:03:19 +02:00
|
|
|
%_sbindir/team*
|
2017-11-22 11:50:23 +01:00
|
|
|
%dir %_sysconfdir/dbus-1
|
|
|
|
%dir %teamd_dbus_policy_directory
|
|
|
|
%config %teamd_dbus_policy_directory/%teamd_dbus_policy_name
|
2013-08-13 10:24:43 +02:00
|
|
|
%_mandir/man1/*
|
2012-11-17 07:25:41 +01:00
|
|
|
%_mandir/man5/*
|
2012-05-16 15:03:19 +02:00
|
|
|
%_mandir/man8/*
|
2012-11-17 07:25:41 +01:00
|
|
|
%if 0%{?_unitdir:1}
|
|
|
|
%_unitdir
|
|
|
|
%endif
|
|
|
|
|
2018-01-05 01:28:58 +01:00
|
|
|
%if %{with python2}
|
2012-11-17 07:25:41 +01:00
|
|
|
%files -n python-libteam
|
|
|
|
%python_sitearch/*
|
2018-01-05 01:28:58 +01:00
|
|
|
%endif
|
2012-05-16 15:03:19 +02:00
|
|
|
|
|
|
|
%changelog
|