slackbuilds/l/PyExecJS/SlackBuild
2020-07-12 09:22:26 +02:00

67 lines
1.4 KiB
Bash
Executable file

#!/bin/sh
# variables
TAG=gwh
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"
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM
mkdir -p $PKG
# mise en place
[ ! -e $REPOSITORY ] && git clone https://github.com/doloopwhile/PyExecJS.git $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
cp -R $REPOSITORIES/${PRGNAM} $TMP/$PRGNAM
cd $TMP/$PRGNAM
# installation
python ./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 ( 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
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