This commit is contained in:
Gwenhael Le Moine 2017-11-06 12:20:58 +01:00
parent 5d33a4d452
commit 62d88c9327
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -3,7 +3,7 @@
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-12.0.3}
VERSION=${VERSION:-stable}
ARCH="noarch" # hardcode ARCH
BUILD=${BUILD:-1}
TAG=${TAG:-cyco}
@ -24,22 +24,21 @@ set -eu
rm -rf $PKG
mkdir -p $TMP $OUTPUT $PKG/$VHOSTROOT
case $1 in
--stable)
VERSION="stable_$(date +%F | tr - .)"
wget -c https://download.nextcloud.com/server/releases/latest.tar.bz2 -O $CWD/$PRGNAM-$VERSION.tar.bz2
case $VERSION in
"stable")
wget -c https://download.nextcloud.com/server/releases/latest.tar.bz2 -O $CWD/latest.tar.bz2
cd $PKG/$VHOSTROOT
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
rm $CWD/$PRGNAM-$VERSION.tar.bz2
tar xvf $CWD/latest.tar.bz2
rm $CWD/latest.tar.bz2
mv nextcloud htdocs
VERSION=$(grep VersionString htdocs/version.php | grep -o "[0-9.]*")
;;
*)
[ ! -e $CWD/$PRGNAM-$VERSION.tar.bz2 ] && wget -c https://download.nextcloud.com/server/releases/$PRGNAM-$VERSION.tar.bz2 -O $CWD/$PRGNAM-$VERSION.tar.bz2
[ ! -e $CWD/nextcloud-$VERSION.tar.bz2 ] && wget -c https://download.nextcloud.com/server/releases/nextcloud-$VERSION.tar.bz2 -O $CWD/nextcloud-$VERSION.tar.bz2
cd $PKG/$VHOSTROOT
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
rm $CWD/$PRGNAM-$VERSION.tar.bz2
tar xvf $CWD/nextcloud-$VERSION.tar.bz2
rm $CWD/nextcloud-$VERSION.tar.bz2
mv nextcloud htdocs
;;
esac