File r8152.spec of Package r8152

#
# spec file for package r8168
#
# 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 http://bugs.opensuse.org/
#
# norootforbuild
# needssslcertforbuild

Name:           r8152
Version:        2.16.3
Release:        1.1
Summary:        Driver for Realtek 2.5GB USB Network Controllers
License:        GPL-2.0+
Group:          Hardware/Other
Url:            https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software
Source0:        %{name}-%{version}.tar.bz2
Source1:        preamble
Source2:        Module.supported
Patch1:         leap.patch
Patch2:         leap153.patch
Patch3:         leap154.patch
Patch4:         kernel519.patch
Patch5:         kernel61.patch
Patch6:         leap155.patch

BuildRequires:  %kernel_module_package_buildreqs
%if 0%{?sle_version} > 150500
BuildRequires:  suse-module-tools-scriptlets
%endif
BuildRequires:  pesign-obs-integration
BuildRequires:  bc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64


%description
Driver for following Realtek 2.5GB USB-Network Controllers: 

RTL8152B
RTL8153 / RTL8153B
RTL8154 / RTL8154B
RTL8156 / RTL8156B(S)(G) 

%kernel_module_package -n r8152 -x debug -x trace -c %_sourcedir/_projectcert.crt -p %_sourcedir/preamble


%prep
%setup -q
%patch1 -p1
%if 0%{?sle_version} == 150300
%patch2 -p1
%endif
%if 0%{?sle_version} == 150400
%patch3 -p1
%endif
%patch4 -p1
%patch5 -p1
%if 0%{?sle_version} == 150500
%patch6 -p1
%endif

cp %{S:1} .
cp %{S:2} .

set -- *
mkdir source
mv "$@" source/
mkdir obj


%build
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
for flavor in %flavors_to_build; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
	make %{?_smp_mflags} -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
	     M=$PWD/obj/$flavor
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
export BRP_PESIGN_FILES='*.ko'
export BRP_PESIGN_COMPRESS_MODULE="xz"

for flavor in %flavors_to_build; do
	make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
		M=$PWD/obj/$flavor
done


%clean
%{__rm} -rf %{buildroot}



%changelog
openSUSE Build Service is sponsored by