2021-09-07 11:42:27 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# variables
|
|
|
|
|
TAG=gwh
|
|
|
|
|
TMP=/tmp/$TAG
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
OUTPUT=/tmp
|
|
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
|
|
2022-01-22 11:08:16 +01:00
|
|
|
|
VERSION=${VERSION:-latest}
|
2021-09-07 11:42:27 +02:00
|
|
|
|
|
|
|
|
|
DOCS="LICENSE *.rst"
|
|
|
|
|
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
BUILD=1
|
|
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
|
|
SLCKFLAGS="-fPIC -O2"
|
|
|
|
|
|
2022-01-22 19:52:02 +01:00
|
|
|
|
REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM
|
2021-09-07 11:42:27 +02:00
|
|
|
|
# nettoyage pr<70>alable
|
|
|
|
|
rm -fr $PKG $TMP/$PRGNAM
|
|
|
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
|
|
|
|
# mise en place
|
|
|
|
|
GIT_URL="https://github.com/Kozea/cairocffi.git"
|
|
|
|
|
[ ! -e $REPOSITORY ] && git clone "$GIT_URL" $REPOSITORY
|
|
|
|
|
cd $REPOSITORY
|
|
|
|
|
git pull --all
|
|
|
|
|
|
|
|
|
|
cp -R $REPOSITORY $TMP/$PRGNAM
|
|
|
|
|
cd $TMP/$PRGNAM
|
2022-01-22 10:52:07 +01:00
|
|
|
|
[ "x$VERSION" == "xlatest" ] && VERSION=$(git for-each-ref --sort=taggerdate --format '%(tag)' | tail -n1)
|
|
|
|
|
[ "x$VERSION" == "x" ] && VERSION=trunk
|
2021-09-07 11:42:27 +02:00
|
|
|
|
[ "x$VERSION" == "xtrunk" ] && VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)" || git checkout $VERSION
|
|
|
|
|
|
|
|
|
|
# installation
|
|
|
|
|
python3 ./setup.py install --root=$PKG
|
|
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM
|
|
|
|
|
cp -R $DOCS $PKG/usr/doc/$PRGNAM
|
|
|
|
|
|
|
|
|
|
# correction
|
|
|
|
|
cd $PKG
|
|
|
|
|
chown -R root:root *
|
|
|
|
|
|
|
|
|
|
# embaumement
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
|
|
|
$PRGNAM: $PRGNAM (CFFI-based cairo bindings for Python)
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM: https://github.com/Kozea/cairocffi
|
|
|
|
|
$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
|