# possible chip versions are auto, au8810, au8820, au8830. %define CHIP auto # collect informaition about current kernel %define kunamever %(uname -r) %define kver %(echo "%kunamever"| awk -F'-' '{print $1}') %define kbuild %(echo "%kunamever"| awk -F'-' '{print $2}') %define kncpu %(echo "%kunamever"| awk -F'-' '{print $3}') %define kpkgprfx %(if echo "%kver"| grep '2.4.'>/dev/null; then echo "24"; else echo "22"; fi) Name: aureal Version: 1.1.3 Release: alt0.1cvs Summary: Kernel module for Aureal soundcards support. Summary(ru_RU.CP1251): Модуль ядра для поддержки звуковых карт Aureal. License: GPL Group: System/Kernel and hardware Url: http://aureal.sourceforge.net Source: %name.tar.bz2 Patch1: %name-makefile.patch NoSource: 0 BuildPreReq: grep awk sh-utils gcc rpm >= 3.0.4 BuildPreReq: kernel%kpkgprfx-headers = %kver-%kbuild BuildPreReq: kernel%kpkgprfx-%kncpu = %kver-%kbuild Provides: %name = %version-%release Requires: kernel%kpkgprfx-%kncpu = %kver-%kbuild Requires: rpm >= 3.0.4 textutils modutils sh-utils fileutils sed awk # Automatically added by buildreq on Sat Jan 26 2002 BuildRequires: glibc-core glibc-gconv-modules glibc-locales pciutils %description Kernel module for Aureal soundcards support. %description -l ru_RU.CP1251 Модуль ядра для поддержки звуковых карт Aureal. %prep %setup -q -n %name %patch1 -p1 %build %if %CHIP == auto %make_build %endif %if %CHIP == au8810 %make_build au8810 %endif %if %CHIP == au8820 %make_build au8820 %endif %if %CHIP == au8830 %make_build au8830 %endif %install if [ -z "$KERNEL_VERSION" ]; then export KERNEL_VERSION=`uname -r` fi if [ -d $RPM_ROOT/lib/modules/$KERNEL_VERSION/kernel ]; then INSTALLPATH=/lib/modules/$KERNEL_VERSION/kernel/drivers/sound else INSTALLPATH=/lib/modules/$KERNEL_VERSION/sound fi %__mkdir -p $RPM_BUILD_ROOT/$INSTALLPATH %__install -m 0444 au88* $RPM_BUILD_ROOT/$INSTALLPATH echo `ls $RPM_BUILD_ROOT/$INSTALLPATH` > /tmp/%name-%version-module.tmp echo "%attr(444 root root)" $INSTALLPATH/au88* > /tmp/%name-%version-files.lst %post module=`head -c 6 /tmp/%name-%version-module.tmp` confmod="/etc/conf.modules" [ -f /etc/modules.conf ] && confmod="/etc/modules.conf" conftmp=/tmp/%name-%version-conf$$ /sbin/rmmod $module >/dev/null 2>&1 /sbin/modprobe soundcore sed '/^alias.*sound.*$module/d' < $confmod > $conftmp echo "alias sound $module" >> $conftmp mv $conftmp $confmod sed '/^alias.*midi.*$module/d' < $confmod > $conftmp echo "alias midi $module" >> $conftmp mv $conftmp $confmod /sbin/depmod -a /sbin/modprobe $module exit 0 %preun if [ $1 = 0 ] ; then if [ -n "`/sbin/lsmod | grep au88`" ]; then /sbin/rmmod `/sbin/lsmod | grep au88 | awk {'print $1'}` fi fi %files -f /tmp/%name-%version-files.lst %doc README ChangeLog %changelog * Mon Jan 28 2002 Andrey Astafiev 1.1.3-alt0.1cvs - First version of RPM package