Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
Gwenhael Le Moine 2022-03-01 15:26:25 +01:00
parent 0f94bb9711
commit 1fd7ee2219
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -1,8 +1,10 @@
#!/bin/bash
#!/bin/bash -e
# variables
CWD=$(pwd)
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/nextcloud/desktop/releases/latest | jq -r .tag_name)}
PRGNAM=$(basename $CWD)
ARCH="AppImage"
BUILD=1
@ -15,22 +17,19 @@ OUTPUT=/tmp
PREFIX=/usr
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM
rm -fr $PKG
mkdir -p $PKG/opt/$PRGNAM
# mise en place
cd $PKG/opt/$PRGNAM
wget -c https://download.nextcloud.com/desktop/daily/Linux/latest.AppImage -O ${PRGNAM}.AppImage
chmod +x ${PRGNAM}.AppImage
VERSION=$( ./${PRGNAM}.AppImage --help | grep version | sed 's/Nextcloud version //' | sed 's/ (build /_/' | tr -d \))
wget -c https://github.com/nextcloud/desktop/releases/download/${VERSION}/Nextcloud-$(echo ${VERSION} | sed 's|^v||')-x86_64.AppImage -O ${PRGNAM}-${VERSION}.AppImage
chmod +x ${PRGNAM}-${VERSION}.AppImage
mkdir -p $PKG$PREFIX/bin/
( cd $PKG$PREFIX/bin/
# ln -s ../../opt/$PRGNAM/${PRGNAM}.AppImage $PRGNAM
ln -s ../../opt/$PRGNAM/${PRGNAM}.AppImage nextcloud
)
cd $PKG$PREFIX/bin/
ln -s ../../opt/$PRGNAM/${PRGNAM}-${VERSION}.AppImage nextcloud
# correction
cd $PKG