File mt7630e.spec of Package mt7630e

#
# spec file for package mt7630e
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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/
#


Name:           mt7630e
Version:        2.0.8
Release:        0
Summary:        Kernel driver for MediaTek (Ralink) 7630e wifi card
License:        GPL-2.0
Group:          System/Kernel
Url:            https://github.com/neurobin/MT7630E
Source0:        https://github.com/neurobin/MT7630E/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        %{name}-preamble
Patch0:         0001-fix-for-kernel-4.12.0.patch
BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  fdupes
BuildRequires:  kernel-devel >= 3.13
BuildRequires:  kernel-source
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
BuildRequires:  modutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# % suse_kernel_module_package -p %%{_sourcedir}/preamble kdump um ec2 pae -x default desktop
%kernel_module_package -p %{name}-preamble

%description
Kernel driver for MediaTek (Ralink) 7630 wifi card.

The sources were obtained from https://github.com/neurobin/MT7630E, which adapted the official driver
released by Mediatek as "Mediatek MT7630E Combo Linux Driver"

This package contains the firmware files needed by the kernel driver.

%package KMP
Summary:        Kernel driver for MediaTek (Ralink) 7630e wifi card
Group:          System/Kernel

%description KMP
Kernel driver for MediaTek (Ralink) 7630 wifi card.

The sources were obtained from https://github.com/neurobin/MT7630E, which adapted the official driver
released by Mediatek as "Mediatek MT7630E Combo Linux Driver"

%prep
%setup -q -n MT7630E-%{version}
%patch0 -p1

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

%build
#export EXTRA_CFLAGS='-DVERSION=\"%%{version}\"'
#export KBUILD_NOPEDANTIC=1
for flavor in %{flavors_to_build} ; do
	rm -rf obj/$flavor
	cp -r source obj/$flavor
        make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor/rt2x00
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=%{kernel_module_package_moddir}
for flavor in %{flavors_to_build} ; do
        make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor/rt2x00
done

mkdir -p %{buildroot}/lib/firmware
cp -v source/firmware/*/* %{buildroot}/lib/firmware/
%fdupes %{buildroot}/lib/firmware/

%files
%defattr(-,root,root)
/lib/firmware/mt76x0.bin
/lib/firmware/MT7650E234.bin

%changelog
openSUSE Build Service is sponsored by