93 lines
2.3 KiB
Text
93 lines
2.3 KiB
Text
|
#!/bin/sh
|
||
|
set -x
|
||
|
|
||
|
CWD=$(pwd)
|
||
|
|
||
|
PRGNAM=$(basename $CWD)
|
||
|
VERSION=2.6.0017.0705.2010
|
||
|
|
||
|
BUILD=1
|
||
|
PACKAGER=cyco
|
||
|
ARCH=$(uname -m)
|
||
|
LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)")
|
||
|
|
||
|
TMP=/tmp
|
||
|
PKG=$TMP/$PACKAGER/pkg-$PRGNAM
|
||
|
|
||
|
REPOSITORY=/home/cycojesus/projets/packages/repositories/$PRGNAM
|
||
|
|
||
|
PREFIX=/usr
|
||
|
|
||
|
# Cleaning
|
||
|
rm -fr $TMP/$PRGNAM-$VERSION
|
||
|
rm -fr $PKG
|
||
|
|
||
|
cd $TMP
|
||
|
#[ ! -e ${PRGNAM}_linux_$VERSION.tar.gz ] && wget -c ... #TODO
|
||
|
tar xf $CWD/${PRGNAM}_linux_$VERSION.tar.gz
|
||
|
mv ${PRGNAM}_linux_$VERSION $PRGNAM-$VERSION
|
||
|
|
||
|
# Preparation
|
||
|
( cd $TMP/$PRGNAM-$VERSION
|
||
|
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 {} \;
|
||
|
)
|
||
|
|
||
|
# Building
|
||
|
( cd $TMP/$PRGNAM-$VERSION
|
||
|
make
|
||
|
)
|
||
|
|
||
|
# Installation
|
||
|
( cd $TMP/$PRGNAM-$VERSION
|
||
|
# make install DESTDIR=$PKG PREFIX=$PREFIX DOCDIR=$PKG$PREFIX/doc/$PRGNAM
|
||
|
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/ \;
|
||
|
|
||
|
mkdir -p $PKG/usr/doc/$PRGNAM
|
||
|
cp readme.txt release_note $PKG/usr/doc/$PRGNAM
|
||
|
)
|
||
|
|
||
|
# Cleaning
|
||
|
( cd $PKG
|
||
|
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 {} \;
|
||
|
)
|
||
|
|
||
|
# Packaging
|
||
|
( cd $PKG
|
||
|
mkdir install
|
||
|
cat <<EOF > install/doinst.sh
|
||
|
#!/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
|
||
|
EOF
|
||
|
cat <<EOF > install/slack-desc
|
||
|
$PRGNAM: $PRGNAM (RTL8192SE Linux driver)
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: This driver supports RealTek rtl8192SE PCI Wireless LAN NIC
|
||
|
$PRGNAM:
|
||
|
$PRGNAM:
|
||
|
$PRGNAM:
|
||
|
$PRGNAM:
|
||
|
$PRGNAM:
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: http://realtek.com
|
||
|
$PRGNAM:
|
||
|
EOF
|
||
|
|
||
|
makepkg -l y -c n $TMP/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$PACKAGER.txz
|
||
|
)
|
||
|
|