File mxu11x0.spec of Package mxu11x0

#
# spec file for package 
#
# Copyright (c) 2014 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/
#

Name:           mxu11x0
Version:	1.3.9
Release:	0
License:	GPL-2.0+
Summary:	Driver for MOXA usb to serial hubs
Url:		http://moxa.com
Group:		System/Kernel
Source:		driv_linux_uport1p_v1.3.9_build_13102216.tgz	
BuildRequires: %kernel_module_package_buildreqs
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%kernel_module_package -p %_sourcedir/preamble

%description
The MOXA UPort 11x0 USB to Serial Hub Linux driver supports following devices.
   
- UPort 1110, 1 port RS-232 USB to Serial Hub.
- UPort 1130, 1 port RS-422/485 USB to Serial Hub.
- UPort 1130I, 1 port RS-422/485 USB to Serial Hub with isolation protection.
- UPort 1150, 1 port RS-232/422/485 USB to Serial Hub.
- UPort 1150I, 1 port RS-232/422/485 USB to Serial Hub with isolation protection.

%prep
%setup -q -n mxu11x0

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

%build
for flavor in %flavors_to_build; do
    rm -rf obj/$flavor
    cp -r source/driver obj/$flavor 
    make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
done

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

%clean
rm -rf %{buildroot}

%changelog