60 lines
1.1 KiB
Bash
Executable file
60 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Generic python SlackBuild
|
|
|
|
# variables
|
|
TAG=gwh
|
|
TMP=/tmp/$TAG
|
|
CWD=$(pwd)
|
|
OUTPUT=/tmp
|
|
|
|
PRGNAM=${PRGNAM:-$(basename $CWD)}
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
VERSION=${VERSION:-"pip"}
|
|
|
|
ARCH=$(uname -m)
|
|
BUILD=1
|
|
|
|
PREFIX=/usr
|
|
|
|
# nettoyage pré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
|