slackbuilds/x/GfxTablet/GfxTablet.SlackBuild
2016-09-18 22:28:40 +02:00

73 lines
1.9 KiB
Bash
Executable file

#!/bin/sh -x
# variables
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
BUILD=${BUILD:-1}
TAG=cyco
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
ARCH=${ARCH:-$(uname -m)}
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM}
PREFIX=${PREFIX:-/usr}
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
[ ! -e $REPOSITORY ] && git clone https://github.com/rfc2822/GfxTablet.git $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
cp -R $REPOSITORY $TMP/
cd $TMP/$PRGNAM/driver-uinput
make
mkdir -p $PKG$PREFIX/bin
cp networktablet $PKG$PREFIX/bin
cd ..
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp -R LICENSE.md README.md app-android doc/ $PKG$PREFIX/doc/$PRGNAM
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (Draw on your PC via your Android device)
$PRGNAM:
$PRGNAM: GfxTablet shall make it possible to use your Android device
$PRGNAM: (especially tablets) like a graphics tablet.
$PRGNAM: It consists of two components:
$PRGNAM: the GfxTablet Android app
$PRGNAM: the input driver for your PC
$PRGNAM: The GfxTablet app sends motion and touch events via UDP to a specified
$PRGNAM: host on port 40118.
$PRGNAM:
$PRGNAM: https://github.com/rfc2822/GfxTablet
EOF
# empaquetage
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz