slackbuilds/UNUSED/x/xf86-input-evtouch/SlackBuild
2018-04-20 23:02:35 +02:00

101 lines
2.1 KiB
Bash
Executable file

#!/bin/sh
# variables
TAG=cyco
OUTPUT=/tmp
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
VERSION=0.8.8
EXT=tar.xz
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO"
ARCH=$(uname -m)
BUILD=1
PREFIX=/usr
SLCKFLAGS="-O2 $(echo "$ARCH" | grep -q "64" && echo -fPIC)"
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
if [ ! -e $CWD/xf86-input-evtouch-$VERSION.tar.bz2 ] ; then
( cd $CWD
wget -c http://www.conan.de/touchscreen/xf86-input-evtouch-$VERSION.tar.bz2
)
fi
cd $TMP
tar xf $CWD/xf86-input-evtouch-$VERSION.tar.bz2
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") \
--enable-udevinstall \
--enable-evcalibrate
# compilation
make -j3 PREFIX=$PREFIX
# installation
make install DESTDIR=$PKG
mkdir -p $PKG$PREFIX/bin
( cd $PKG$PREFIX/bin
ln -s ../lib$(echo "$ARCH" | grep -o "64")/xf86-input-evtouch/ev_calibrate ev_calibrate
ln -s ../lib$(echo "$ARCH" | grep -o "64")/xf86-input-evtouch/calibrate.sh calibrate.sh
)
# 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 (Linux-Touchscreen Driver for X)
$PRGNAM:
$PRGNAM: Evtouch is a Touchscreen-Driver for X.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://www.conan.de/touchscreen/evtouch.html
$PRGNAM:
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz