slackbuilds/UNUSED/x/xf86-input-plpevtch/SlackBuild
2020-07-12 09:22:26 +02:00

94 lines
1.9 KiB
Bash
Executable file

#!/bin/sh
# variables
TAG=gwh
OUTPUT=/tmp
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
VERSION=0.4.0
EXT=tar.xz
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO"
ARCH=$(uname -m)
BUILD=1
PREFIX=/usr
SLCKFLAGS="-fPIC -O2"
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
if [ ! -e $CWD/xf86-input-plpevtch-$VERSION.tar.bz2 ] ; then
( cd $CWD
wget -c http://download.plop.at/files/plpevtch/xf86-input-plpevtch-$VERSION.tar.gz
)
fi
cd $TMP
tar xf $CWD/xf86-input-plpevtch-$VERSION.tar.gz
cd $TMP/$PRGNAM-$VERSION
patch -p1 -i $CWD/hacks.diff
# configuration
CFLAGS="$SLCKFLAGS" \
CPPFLAGS="$SLCKFLAGS" \
./configure \
--prefix=$PREFIX \
--mandir=$PREFIX/man \
--libdir=$PREFIX/lib$(echo "$ARCH" | grep -o "64")
# compilation
make -j3 PREFIX=$PREFIX
# installation
make install DESTDIR=$PKG
# correction
cd $PKG
chown -R root:root *
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
# Strip binaries
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Xorg Evdev Touchscreen Driver)
$PRGNAM:
$PRGNAM: The plpevtch driver is an eventdevice driver for touchscreens under Xorg 7.x.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://www.plop.at/en/touchscreen.html
$PRGNAM:
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz