LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File alsa-driver-kmp.spec of Package alsa-driver-staudio-ADCIII-kmp (Project home:sbahling:staudio-ADCIII)

#
# spec file for package alsa-driver-kmp
#
# 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

Name:           alsa-driver-kmp
%if %suse_version >= 1120
BuildRequires:  %kernel_module_package_buildreqs
%else
BuildRequires:  kernel-source kernel-syms module-init-tools
%endif
BuildRequires:  automake
# temorary fix
%if %suse_version > 1130
PreReq:         python
%endif
PreReq:         coreutils grep
%define package_version	20150222
License:        GPL v2
Group:          System/Kernel
Autoreqprov:    on
Summary:        Advanced Linux Sound Architecture Drivers
Version:        1.0.25.20150222
Release:        1
Source:         ftp://ftp.suse.com/pub/projects/alsa/snapshot/driver/alsa-driver-snapshot.tar.bz2
Patch1:         kabi-driver-fix.diff
Patch2:         kabi-kernel-fix.diff
Patch10:        configure.patch
Patch11:        staudio-ADCIII.patch
URL:            http://www.alsa-project.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Conflicts:      alsa-driver-unstable-kmp
%kernel_module_package -n alsa-driver -x xen xenpae debug um

%description
This package contains update ALSA drivers.

%package -n alsa-driver-KMP
Summary:        Advanced Linux Sound Architecture Drivers
Group:          System/Kernel

%description -n alsa-driver-KMP
This package contains update ALSA drivers.

%package -n alsa-driver-doc
Summary:        Documentation included in ALSA driver package
Group:          Documentation/Other
License:        GPL v2

%description -n alsa-driver-doc
This package contains the documentation included in the latest ALSA driver
package.

%prep
%setup -q -n alsa-driver
test -d alsa && cd alsa
%patch11 -p1
%if 0
%patch1 -p1
cd alsa-kernel/include
%patch2 -p3
cd ../..
%endif
aclocal
autoconf

%patch10 -p2

%build
test -d alsa && cd alsa
export AUTOMAKE_JOBS=%{?jobs:%jobs}
for flavor in %flavors_to_build; do
  krel=$(make -s -C /usr/src/linux-obj/%_target_cpu/$flavor kernelrelease)
  make clean || :
  CFLAGS="$RPM_OPT_FLAGS" \
  ./configure --with-debug=full --enable-dynamic-minors \
	--with-build=/usr/src/linux-obj/%_target_cpu/$flavor \
	--with-moddir=/lib/modules/$krel/updates/alsa \
	--with-extra-version=git%{package_version} \
        --with-card-options=hda-prealloc-size=1024 \
        --with-cards=ice1712,intel8x0,virmidi
  make %{?jobs:-j %jobs}
  rm -rf build-$flavor
  make DESTDIR=`pwd`/build-$flavor install-modules

  # obsolete some modules
  if [ -f build-$flavor/lib/modules/$krel/updates/alsa/drivers/snd-dummy-ko ]; then
    case $krel in
    2.*)
      kver=${krel%%-*}
      kver=${kver##*.}
      BLIST=""
      if [ "$kver" -le 34 ]; then
        BLIST="$BLIST snd-hifier"
        if [ "$kver" -gt 27 ]; then
          BLIST="$BLIST snd-hda-codec-intelhdmi snd-hda-codec-atihdmi snd-hda-codec-nvhdmi"
        fi
      fi
      for i in $BLIST; do
        ln -s ../drivers/snd-dummy.ko build-$flavor/lib/modules/$krel/updates/alsa/misc/$i.ko
      done
      ;;
    esac
  fi
done

%install
test -d alsa && cd alsa
mkdir -p $RPM_BUILD_ROOT/lib/modules/
for flavor in %flavors_to_build; do
  cp -a build-$flavor/lib $RPM_BUILD_ROOT
done
# copy documents
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
cp CARDS-STATUS COPYING FAQ INSTALL README SUPPORTED_KERNELS WARNING \
  $RPM_BUILD_ROOT%{_docdir}/%{name}
cp alsa-kernel/Documentation/*.txt $RPM_BUILD_ROOT%{_docdir}/%{name}
cp -r alsa-kernel/Documentation/soc $RPM_BUILD_ROOT%{_docdir}/%{name}
# copy SHA1 HEAD files as a sort of changelog
cp HEAD $RPM_BUILD_ROOT%{_docdir}/%{name}/HEAD-driver
cp alsa-kernel/HEAD $RPM_BUILD_ROOT%{_docdir}/%{name}/HEAD-kernel
# FIXME: docbook files...

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files -n alsa-driver-doc
%defattr(-, root, root)
%{_docdir}/%{name}

%changelog