slackbuilds/generic-python.SlackBuild

59 lines
1.1 KiB
Text
Raw Normal View History

2021-09-07 11:42:27 +02:00
#!/bin/bash
# Generic python SlackBuild
# variables
TAG=${TAG:-pip_gwh}
2021-09-07 11:42:27 +02:00
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=${PRGNAM:-$(basename $CWD)}
PKG=$TMP/pkg-$PRGNAM
VERSION=${VERSION:-"pip"}
ARCH=$(uname -m)
BUILD=1
# nettoyage pr<70>alable
rm -fr $PKG
mkdir -p $PKG
# installation
EXTRA=""
[ "x$VERSION" == "xpip" ] || EXTRA="==$VERSION"
pip install --ignore-installed --root $PKG --no-deps $PRGNAM$EXTRA
METADATA_FILE=$(find $PKG -name METADATA)
[ ! -e $METADATA_FILE ] && exit 1
VERSION=$(grep "^Version:" $METADATA_FILE | sed 's|^Version: ||')
SUMMARY=$(grep "^Summary:" $METADATA_FILE | sed 's|^Summary: ||')
HOMEPAGE=$(grep "^Home-page:" $METADATA_FILE | sed 's|^Home-page: ||')
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM ($SUMMARY)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: $HOMEPAGE
$PRGNAM:
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/python-$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz