slackbuilds/l/PyExecJS/PyExecJS.SlackBuild
2015-05-21 07:18:40 +02:00

69 lines
1.4 KiB
Bash
Executable file

#!/bin/sh -x
# variables
TAG=cyco
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
VERSION=$(date +%Y.%m.%d_%H.%M)
DOCS="LICENSE README.*"
ARCH=$(uname -m)
BUILD=1
PREFIX=/usr
SLCKFLAGS="-fPIC -O2"
REPOSITORIES=/home/installs/SlackBuilds/repositories
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
if [ ! -e $REPOSITORIES/$PRGNAM ] ; then
git clone https://github.com/doloopwhile/PyExecJS.git $REPOSITORIES/${PRGNAM}
else
( cd $REPOSITORIES/${PRGNAM}
git pull
)
fi
cp -R $REPOSITORIES/${PRGNAM} $TMP/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
# installation
python ./setup.py install --root=$PKG
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -R $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM ( Run JavaScript code from Python)
$PRGNAM:
$PRGNAM: PyExecJS is a porting of ExecJS from Ruby. PyExecJS automatically picks
$PRGNAM: the best runtime available to evaluate your JavaScript program, then
$PRGNAM: returns the result to you as a Python object.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/doloopwhile/PyExecJS
$PRGNAM:
EOF
# empaquetage
cd $PKG
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz