#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-alsa-driver rm -rf $PKG mkdir -p $PKG KVERSION=${KVERSION:-$(uname -r)} VERSION=1.0.11 PKG_ARCH=${PKG_ARCH:-x86_64} BUILD=${BUILD:-1} if [ "$PKG_ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$PKG_ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$PKG_ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$PKG_ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi cd $TMP rm -rf alsa-driver-$VERSION tar xjvf $CWD/alsa-driver-$VERSION.tar.bz2 cd alsa-driver-$VERSION # Work around a bug in some via82xx chipsets: zcat $CWD/alsa-driver-1.0.11.via82xx.diff.gz | patch -p1 -l --verbose || exit 1 chown -R root:root . CFLAGS="$SLKCFLAGS" \ ./configure \ --with-kernel=/lib/modules/$KVERSION/source \ --with-build=/lib/modules/$KVERSION/build \ --with-isapnp=yes \ --with-sequencer=yes \ --with-oss=yes make -j3 make install DESTDIR=$PKG rm $PKG/lib/modules/${KVERSION}/* ( cd $PKG/lib/modules find . -type f -name "*.o" -exec gzip -9 {} \; ) mkdir -p $PKG/usr/doc/alsa-driver-$VERSION/alsa-kernel cp -a \ CARDS-STATUS COPYING FAQ INSTALL README TODO WARNING \ doc \ $PKG/usr/doc/alsa-driver-$VERSION cp -a \ alsa-kernel/Documentation/ \ $PKG/usr/doc/alsa-driver-$VERSION/alsa-kernel mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG makepkg -l y -c n $TMP/alsa-driver-${VERSION}_${KVERSION}-$PKG_ARCH-$BUILD.tgz