slackbuilds/a/rtl8192se/rtl8192se.SlackBuild

87 lines
2.3 KiB
Text
Raw Normal View History

2010-09-29 15:50:26 +02:00
#!/bin/sh
set -x
CWD=$(pwd)
PRGNAM=$(basename $CWD)
2011-01-07 08:55:27 +01:00
VERSION=${VERSION:-$(ls -ut $PRGNAM*.tar.?z*| head -n1 | cut -d_ -f3 | sed 's|.tar.*||')}
2010-09-29 15:50:26 +02:00
2011-01-07 08:55:27 +01:00
BUILD=${BUILD:-1}
2010-09-29 15:50:26 +02:00
ARCH=$(uname -m)
TAG=cyco
TMP=${TMP:-/tmp/$TAG}
2011-01-07 08:55:27 +01:00
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
2010-09-29 15:50:26 +02:00
2011-01-07 08:55:27 +01:00
PREFIX=${PREFIX:-/usr}
2010-09-29 15:50:26 +02:00
# Cleaning
rm -fr $TMP/$PRGNAM-$VERSION
rm -fr $PKG
2011-01-15 08:17:01 +01:00
mkdir -p $TMP/
2010-09-29 18:30:51 +02:00
tar -C $TMP -xf $CWD/${PRGNAM}_linux_$VERSION.tar.gz
mv $TMP/${PRGNAM}_linux_$VERSION $TMP/$PRGNAM-$VERSION
2010-09-29 15:50:26 +02:00
2011-03-09 04:30:42 +01:00
cd $TMP/$PRGNAM-$VERSION
2010-09-30 02:09:21 +02:00
# Preparation
2011-03-09 04:30:42 +01:00
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
2010-09-29 15:50:26 +02:00
# Building
2011-03-09 04:30:42 +01:00
make
2010-09-29 15:50:26 +02:00
# Installation
2011-03-09 04:30:42 +01:00
mkdir -p $PKG/lib/modules/$(uname -r)/kernel/drivers/net/wireless/
find ./HAL/ -name \*.ko -exec cp {} $PKG/lib/modules/$(uname -r)/kernel/drivers/net/wireless/ \;
2010-09-29 15:50:26 +02:00
2011-03-09 04:30:42 +01:00
mkdir -p $PKG/lib/
cp -R firmware $PKG/lib/
2010-09-29 18:23:48 +02:00
2011-03-09 04:30:42 +01:00
mkdir -p $PKG/usr/doc/$PRGNAM
cp readme.txt release_note $PKG/usr/doc/$PRGNAM
mv $PKG/lib/firmware/*/Realtek-Firmware-License.txt $PKG/usr/doc/$PRGNAM
2010-09-29 15:50:26 +02:00
2011-03-09 04:30:42 +01:00
PRGNAM=$PRGNAM-$(uname -r | tr - _)
cd $PKG
2010-09-30 02:09:21 +02:00
# Cleaning
2011-03-09 04:30:42 +01:00
chown -R root:root .
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
2010-09-29 15:50:26 +02:00
# Packaging
2011-03-09 04:30:42 +01:00
mkdir install
cat <<EOF > install/doinst.sh
2010-09-29 15:50:26 +02:00
#!/bin/sh
grep r8192_pci.ko /lib/modules/\$(uname -r)/modules.dep && rm -fr /lib/modules/\$(uname -r)/kernel/drivers/staging/rtl8192e/ || echo > /dev/null
grep r8192se_pci.ko /lib/modules/\$(uname -r)/modules.dep && rm -fr /lib/modules/\$(uname -r)/kernel/ubuntu/rtl8192se/* || echo > /dev/null
rm -f /etc/acpi/wireless-rtl-ac-dc-power.sh
rm -f /etc/acpi/events/RadioPower.sh
2010-09-30 02:09:21 +02:00
depmod -a
2010-09-29 15:50:26 +02:00
EOF
2011-03-09 04:30:42 +01:00
cat <<EOF > install/slack-desc
2010-09-29 15:50:26 +02:00
$PRGNAM: $PRGNAM (RTL8192SE Linux driver)
$PRGNAM:
$PRGNAM: This driver supports RealTek rtl8192SE PCI Wireless LAN NIC
$PRGNAM:
$PRGNAM: http://realtek.com
$PRGNAM: http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&PNid=21&PFid=48&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true
2010-09-29 15:50:26 +02:00
$PRGNAM:
2011-01-07 08:55:27 +01:00
$PRGNAM: the 3 "official" mirrors:
$PRGNAM: ftp://WebUser:pGL7E6v@202.134.71.21/cn/wlan/
$PRGNAM: ftp://WebUser:pGL7E6v@208.70.202.219/cn/wlan/
$PRGNAM: ftp://WebUser:pGL7E6v@218.210.127.132/cn/wlan/
2010-09-29 15:50:26 +02:00
EOF
2011-03-09 04:30:42 +01:00
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz