#!/bin/bash # Generic python SlackBuild # variables TAG=${TAG:-pip_gwh} 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éalable rm -fr $PKG mkdir -p $PKG # installation EXTRA="" [ "x$VERSION" == "xpip" ] || EXTRA="==$VERSION" pip install --ignore-installed --root $PKG --no-deps $PRGNAM$EXTRA if [ -d $PKG/usr/share/man ]; then mv $PKG/usr/share/man $PKG/usr/ find $PKG/usr/man -type f -not -name \*.gz -exec gzip -9 {} \; fi 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 < $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