File wacom.spec of Package wacom

#
# spec file for package wacom
#
# Copyright (c) 2015 SUSE LINUX 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:           wacom
Version:        0.48.0
Release:        0
Summary:        Kernel modules for Wacom Tablets
License:        GPL-2.0+
Group:          Hardware/Other
Url:            https://github.com/linuxwacom/input-wacom/
Source0:        https://github.com/linuxwacom/input-wacom/releases/download/input-%{name}-%{version}/input-%{name}-%{version}.tar.bz2
Source1:        https://github.com/linuxwacom/input-wacom/releases/download/input-%{name}-%{version}/input-%{name}-%{version}.tar.bz2.sig
Source2:        preamble
Patch1:         config-h-path-fix.patch
BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libelf-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64

%kernel_module_package -p %{_sourcedir}/preamble

%description
This package contains the wacom kernel driver.

%prep
%autosetup -p1 -n input-%{name}-%{version}

%define kver %(rpm -q --qf '%%{VERSION}.0' kernel-syms|perl -ne '/(\\d+)\\.(\\d+)\\.(\\d+)?/&&printf "%%d%%02d%%03d\\n",$1,$2,$3')
%define _kernel_ver 2.6.30
%if 0%{kver} >= 206036
%define _kernel_ver 2.6.36
%endif
%if 0%{kver} >= 206038
%define _kernel_ver 2.6.38
%endif
%if 0%{kver} >= 307000
%define _kernel_ver 3.7
%endif
%if 0%{kver} >= 317000
%define _kernel_ver 3.17
%endif
%if 0%{kver} >= 405000
%define _kernel_ver 4.5
%endif

%build
autoreconf -f -i -v
%configure 
make clean
mkdir -p obj
for flavor in %{flavors_to_build}; do
    rm -rf obj/$flavor
    cp -r %{_kernel_ver} obj/$flavor
    make -C %{_prefix}/src/linux-obj/%{_target_cpu}/$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 %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor modules_install M=$PWD/obj/$flavor
done

%changelog
openSUSE Build Service is sponsored by