Merge branch 'master' of github.com:gwenhael-le-moine/slackbuilds

This commit is contained in:
Gwenhael Le Moine 2022-07-13 13:38:43 +02:00
commit dce5de9764
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -3,10 +3,10 @@
# variables # variables
GITHUB_REPO=janeczku/calibre-web GITHUB_REPO=janeczku/calibre-web
VERSION=${VERSION:-latest} VERSION=${VERSION:-latest}
BUILD=${BUILD:-2}
RUNNING_USER=${RUNNING_USER:-gwh} RUNNING_USER=${RUNNING_USER:-gwh}
RUNNING_GROUP=${RUNNING_GROUP:-users} RUNNING_GROUP=${RUNNING_GROUP:-users}
BUILD=${BUILD:-1}
TAG=gwh TAG=gwh
TMP=/tmp/$TAG TMP=/tmp/$TAG
@ -33,6 +33,21 @@ git pull --all
mkdir -p $PKG/opt mkdir -p $PKG/opt
cp -r $REPOSITORY $PKG/opt/ cp -r $REPOSITORY $PKG/opt/
cd $PKG/opt/$PRGNAM
case $VERSION in
trunk)
VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)"
;;
latest)
VERSION=$(git describe --tags --abbrev=0)
git checkout $VERSION
;;
*)
git checkout $VERSION
;;
esac
rm -fr $PKG/opt/$PRGNAM/{.git*,.editorconfig,.eslintrc} rm -fr $PKG/opt/$PRGNAM/{.git*,.editorconfig,.eslintrc}
chown -R ${RUNNING_USER}:${RUNNING_GROUP} $PKG/opt/$PRGNAM chown -R ${RUNNING_USER}:${RUNNING_GROUP} $PKG/opt/$PRGNAM
@ -40,15 +55,10 @@ mkdir -p $PKG/etc/rc.d/
cp -r $CWD/rc $PKG/etc/rc.d/rc.$PRGNAM cp -r $CWD/rc $PKG/etc/rc.d/rc.$PRGNAM
sed -i "s|RUNNING_USER|$RUNNING_USER|" $PKG/etc/rc.d/rc.$PRGNAM sed -i "s|RUNNING_USER|$RUNNING_USER|" $PKG/etc/rc.d/rc.$PRGNAM
cd $PKG/opt/$PRGNAM
[ "x$VERSION" == "xlatest" ] && VERSION=$(git for-each-ref --sort=taggerdate --format '%(tag)' | tail -n1)
[ "x$VERSION" == "x" ] && VERSION=trunk
[ "x$VERSION" == "xtrunk" ] && VERSION="git_$(git log -1 --format=%h_%ad --date=format:%Y.%m.%d)" || git checkout $VERSION
# change default password # change default password
NEW_DEFAULT_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;) NEW_DEFAULT_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;)
sed -i "s|admin123|$NEW_DEFAULT_PASSWORD|g" cps/* sed -i "s|admin123|$NEW_DEFAULT_PASSWORD|g" cps/*
pip3 install --target vendor -r requirements.txt pip3 install --target vendor -r requirements.txt -r optional-requirements.txt
# correction # correction
cd $PKG cd $PKG