File irqbalance.spec of Package irqbalance

# spec file for package irqbalance
# Copyright (c) 2014 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:           irqbalance
Version:        1.0.7
Release:        0
Summary:        Balance IRQs on SMP Machines
License:        GPL-2.0+
Group:          System/Daemons
Source3:        sysconfig.irqbalance
Patch0:         bug-893478_warn-once.patch
BuildRequires:  libnuma-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig(glib-2.0)
Requires(pre):  coreutils
Requires(pre):  fillup
ExclusiveArch:  ia64 x86_64 ppc64 ppc64le ppc %sparc
%if 0%{?suse_version} >= 1130
BuildRequires:  libcap-ng-devel
BuildRequires:  systemd

irqbalance dynamically switches the CPUs for IRQs to prevent cpu0 from
being used for all IRQs.

%setup -q
%patch0 -p1

make LDFLAGS="-Wl,-z,relro,-z,now" CFLAGS="%{optflags} -fPIE -pie"
cp %{SOURCE3} .
gzip irqbalance.1

mkdir -p %{buildroot}%{_sbindir}
install -m 0755 irqbalance %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 irqbalance.1.gz %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/
install -m 0644 sysconfig.irqbalance %{buildroot}%{_localstatedir}/adm/fillup-templates/
sed -ie "s|EnvironmentFile=.*|EnvironmentFile=/etc/sysconfig/irqbalance|g" misc/irqbalance.service
# Remove in systemd service file; not provided by systemd anymore
sed -ie "s|||g" misc/irqbalance.service
install -D -m 0644 misc/irqbalance.service %{buildroot}%{_unitdir}/irqbalance.service
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcirqbalance

%service_add_pre irqbalance.service

%fillup_only %{name}
%service_add_post irqbalance.service

%service_del_preun irqbalance.service

%service_del_postun irqbalance.service


openSUSE Build Service is sponsored by