[devel] aureal drivers

Andrey Astafiev =?iso-8859-1?q?andrei_=CE=C1_tvcell=2Eru?=
Пн Янв 28 15:26:09 MSK 2002


On Mon, Jan 28, 2002 at 01:01:15PM +0300, Andrey Astafiev wrote:
> сделал спек для драйверов aureal, думаю,
> стоит положить в unsupported.

что-то у меня сегодня аттачи не приаттачиваются :)

--
andrei at tvcell d0t ru
----------- следующая часть -----------
# 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 <andrei на tvcell.ru> 1.1.3-alt0.1cvs
- First version of RPM package
----------- следующая часть -----------
diff -ur aureal.orig/Makefile aureal/Makefile
--- aureal.orig/Makefile	Sat Dec  1 01:12:48 2001
+++ aureal/Makefile	Thu Jan 24 06:25:10 2002
@@ -19,15 +19,17 @@
 # Contact: http://aureal.sourceforge.net
 #
 
-ifneq ($(shell /sbin/lspci -d '12eb:3'),)
+LSPCI = `which lspci`
+
+ifneq ($(shell $(LSPCI) -d '12eb:3'),)
 NAME = au8810
 ASP_OBJ = asp10.o
 endif
-ifneq ($(shell /sbin/lspci -d '12eb:1'),)
+ifneq ($(shell $(LSPCI) -d '12eb:1'),)
 NAME = au8820
 ASP_OBJ = asp20.o
 endif
-ifneq ($(shell /sbin/lspci -d '12eb:2'),)
+ifneq ($(shell $(LSPCI) -d '12eb:2'),)
 NAME = au8830
 ASP_OBJ = asp30.o
 endif


Подробная информация о списке рассылки Devel