2010-05-11 22:38:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for The Linux Wacom Project
|
2010-05-13 00:20:34 +02:00
|
|
|
|
2010-05-12 17:36:45 +02:00
|
|
|
# Written by Menno Duursma <druiloor@zonnet.nl>
|
2010-05-11 22:38:33 +02:00
|
|
|
|
|
|
|
# This program is free software. It comes without any warranty.
|
|
|
|
# Granted WTFPL, Version 2, as published by Sam Hocevar. See
|
|
|
|
# http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
|
|
|
2010-05-12 17:36:45 +02:00
|
|
|
# Modified by the SlackBuilds.org project.
|
|
|
|
|
2010-05-11 22:38:33 +02:00
|
|
|
PRGNAM=linuxwacom
|
2010-05-13 00:20:34 +02:00
|
|
|
VERSION=${VERSION:-0.8.4_4}
|
2010-05-11 22:38:33 +02:00
|
|
|
ARCH=${ARCH:-i486}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-05-13 00:20:34 +02:00
|
|
|
KERNEL=${KERNEL:-$(uname -r)}
|
2010-05-12 17:36:45 +02:00
|
|
|
|
2010-05-11 22:38:33 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
2010-05-13 00:20:34 +02:00
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
SRCVER=$(echo $VERSION | tr _ -)
|
2010-05-11 22:38:33 +02:00
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:20:34 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:38:33 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:20:34 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:38:33 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:20:34 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-11 22:38:33 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-13 00:20:34 +02:00
|
|
|
set -e
|
2010-05-11 22:38:33 +02:00
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2010-05-12 17:36:45 +02:00
|
|
|
rm -rf $PRGNAM-$SRCVER
|
|
|
|
tar xvf $CWD/$PRGNAM-$SRCVER.tar.bz2
|
|
|
|
cd $PRGNAM-$SRCVER
|
2010-05-11 22:38:33 +02: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 {} \;
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
2010-05-13 00:20:34 +02:00
|
|
|
./configure \
|
2010-05-11 22:38:33 +02:00
|
|
|
--prefix=/usr \
|
2010-05-13 00:20:34 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 22:38:33 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
2010-05-13 00:20:34 +02:00
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--with-kernel=/lib/modules/${KERNEL}/source \
|
|
|
|
--with-linux=yes \
|
2010-05-11 22:38:33 +02:00
|
|
|
--enable-wacom \
|
2010-05-13 00:20:34 +02:00
|
|
|
--disable-static \
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 22:38:33 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-13 00:20:34 +02:00
|
|
|
# Install the kernel module
|
|
|
|
# Ignore the "2.6.28" in the path below; you can verify with
|
|
|
|
# modinfo(8) if you don't trust me... ;-) --rworkman
|
|
|
|
mkdir -p $PKG/lib/modules/${KERNEL}/kernel/drivers/usb/input
|
|
|
|
install -m 0644 src/2.6.28/wacom.ko \
|
|
|
|
$PKG/lib/modules/${KERNEL}/kernel/drivers/usb/input
|
2010-05-11 22:38:33 +02:00
|
|
|
|
2010-05-12 17:36:45 +02:00
|
|
|
( cd $PKG/usr || exit 1
|
|
|
|
find . -type f | xargs file | grep -e "executable" -e "shared object" \
|
|
|
|
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
2010-05-11 22:38:33 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 00:20:34 +02:00
|
|
|
cp -a AUTHORS ChangeLog GPL README $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 22:38:33 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-05-13 00:20:34 +02:00
|
|
|
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-11 22:38:33 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:20:34 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|