File oss-linux.spec of Package oss-linux

# norootforbuild

%define ver v4.0
%define buildid 1016

Name:           oss-linux
BuildRequires:  kernel-source kernel-syms module-init-tools
License:        GPL v2
Group:          Productivity/Multimedia/Sound
Summary:        Open Sound System sound drivers for Linux
Version:        %{ver}_%{buildid}
URL:            http://www.opensound.com/
Release:        1
Source0:        http://www.4front-tech.com/developer/sources/stable/gpl/oss-%{ver}-build%{buildid}-src-gpl.tar.bz2
Patch0:         0001-better-kernel-integrated-build.diff
Patch1:         0002-return-value-should-be-zero-on-success.diff
Patch2:         0003-remove-redefinitions-of-some-macros.diff
Patch3:         0004-linux-kernel-code-must-not-use-float.diff
Patch4:         0005-use-kernel-headers-instead-of-userspace-ones.diff
Patch5:         0006-don-t-redefine-sprintf.diff
Patch6:         kernel-compile-fix.diff

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Recommends:     oss-linux-kmp
%suse_kernel_module_package -n oss-linux kdump debug um

%description
Open Sound System for Linux (OSS/Linux) is a commercial quality sound driver
distributed by 4Front Technologies (http://www.opensound.com). OSS provides
support for practically all sound cards on the market including PnP and
many PCI ones. Installation and configuration is higly automated and easy to
perform. To obtain technical support and additional features, you will need to
order the commercial version from http://www.opensound.com/order.html

%package devel
License:        GPL v2
Summary:        oss-linux kernel headers
Group:          Development/Libraries/C and C++
Recommends:     oss-linux = %{version}

%description devel
oss-linux devel files


%package -n oss-linux-KMP
License:        GPL v2
Summary:        oss-linux kernel modules
Group:          System/Kernel

%description -n oss-linux-KMP
oss-linux kernel modules

%prep
%setup -q -n oss-%{ver}-build%{buildid}-src-gpl
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
chmod 755 prepare
./prepare

%build
flags="%optflags -DOSS_BUILD_ID=\\\"%{buildid}\\\" -DOSS_COMPILE_DATE=\\\"unknown\\\""
make CFLAGS="$flags" OSFLAGS="" -C cmd
make CFLAGS="$flags -fPIC" OSFLAGS="" -C lib
make CFLAGS="$flags" OSFLAGS="" -C os_cmd/Linux/
#
#make %{?jobs:-j%{jobs}}
#
for flavor in %flavors_to_build; do
    rm -rf target/build-$flavor
    cp -r target/build target/build-$flavor
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
	 M=$PWD/target/build-$flavor \
	 V=1 \
	 %{?jobs:-j%{jobs}}
done

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sbindir}
install -m 755 target/bin/* %{buildroot}%{_bindir}
install -m 755 target/sbin/* %{buildroot}%{_sbindir}
install -m 755 mkdevs %{buildroot}%{_bindir}/oss-mkdevs
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
    make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
	 M=$PWD/target/build-$flavor
done

%files
%defattr(-,root,root)
%{_bindir}/*
%{_sbindir}/*
openSUSE Build Service is sponsored by