File cgdcbxd.spec of Package cgdcbxd

# spec file for package cgdcbxd
# Copyright (c) 2013 SUSE LINUX Products 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

Name:           cgdcbxd
Version:        1.0.2_8e157dff
Release:        0.<RELEASE7>
Summary:        DCB network priority management daemon
Group:          System/Base
License:        GPL-2.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Source0:        %{name}-%{version}.tar.bz2
Source1:        cgdcbxd.service
Patch1:         cgdcbxd-use-pkgconfig-for-libmnl
Patch2:         cgdcbxd-add-headers
Patch3:         cgdcbxd-fix-initscript
BuildRequires:  autoconf automake libcgroup-devel libtool
BuildRequires:  pkgconfig >= 0.21
%if 0%{?suse_version} >= 1140
BuildRequires:  pkgconfig(libmnl) >= 1
BuildRequires:  libmnl-devel >= 1

This is a daemon to manage the priority of network traffic in dcb
enabled environments.  By using the information exchanged over the dcbx
protocol on a LAN, this package will enforce network priority on
running applications on your host using the net_prio cgroup.

    John Fastabend <>

%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1


make DESTDIR=%buildroot install
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
rm -f %buildroot/etc/init.d/cgdcbxd
mkdir -p %buildroot/usr/sbin
ln -sf /usr/sbin/service %{buildroot}/usr/sbin/rc%{name}


%service_add_pre %{name}.service

%service_add_post %{name}.service

%service_del_preun %{name}.service

%service_del_postun %{name}.service