LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File i40e.spec of Package i40e (Project home:aevseev)

%define realname i40e
%define realver  1.5.25
%define srcext   tar.gz

Name:          %{realname}
Version:       %{realver}
Release:       1%{?dist}
License:       GPL-2.0
Group:         System/Kernel
URL:           http://sourceforge.net/projects/e1000/
Summary:       Linux* Base Driver for the Intel(R) XL710 Ethernet Controller Family

# Build-time parameters
ExclusiveOS:   Linux
BuildRequires: %kernel_module_package_buildreqs
# Needed for rpmlint
%if 0%{?opensuse_bs}
BuildRequires: dkms
%endif
BuildRoot:     %{_tmppath}/%{name}-%{version}-build
Source:        http://sourceforge.net/projects/e1000/files/i40e%20stable/%{realver}/%{realname}-%{realver}.%{srcext}

%description
i40e Linux* Base Driver for the Intel(R) XL710 Ethernet Controller Family

%kernel_module_package %{?suse_version:-p %_sourcedir/preamble} -x kdump -x um -x ec2 -x debug

%package KMP
Group:         System/Kernel
Summary:       Linux* Base Driver for the Intel(R) XL710 Ethernet Controller Family

%description KMP
i40e Linux* Base Driver for the Intel(R) XL710 Ethernet Controller Family

%package dkms
Summary:       Linux* Base Driver for the Intel(R) XL710 Ethernet Controller Family
Group:         System/Kernel
Requires:      dkms kernel-devel
%if 0%{?suse_version} && ! 0%{?sles_version}
BuildArch:     noarch
%endif

%description dkms
i40e Linux* Base Driver for the Intel(R) XL710 Ethernet Controller Family

%prep
%setup -q -n %{realname}-%{realver}

%build
# Build kernel module
%{__mkdir} obj
for flavor in %flavors_to_build; do
  %{__rm} -rf obj/$flavor
  %{__cp} -r src obj/$flavor
  %{__make} -C %{kernel_source $flavor} modules \
    M=$PWD/obj/$flavor
done

%install
# Install kernel module
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
  %{__make} -C %{kernel_source $flavor} modules_install \
  M=$PWD/obj/$flavor
done
# Install sources for DKMS
%{__install} -d -m755 %{buildroot}/usr/src/%{realname}-%{realver}
%{__cp} -r src/i40e/* %{buildroot}/usr/src/%{realname}-%{realver}/
cat > %{buildroot}/usr/src/%{realname}-%{realver}/dkms.conf <<EOF
PACKAGE_NAME=%{realname}
PACKAGE_VERSION=%{realver}
AUTOINSTALL=yes

BUILT_MODULE_NAME=%{realname}

DEST_MODULE_LOCATION=/updates
EOF
# Install manpage
%{__install} -D -m644 i40e.7 %{buildroot}%{_mandir}/man7/i40e.7

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files dkms
%defattr(-,root,root)
%doc COPYING README
%dir /usr/src/%{realname}-%{realver}
/usr/src/%{realname}-%{realver}/*
%doc %{_mandir}/man7/i40e.7*

%post dkms
/usr/sbin/dkms add -q -m %{realname} -v %{version} || :

%preun dkms
/usr/sbin/dkms remove -q --all -m %{realname} -v %{version} || :

%changelog