From dc84d500a5e7ddad6d928fc6c7c66cfd4089af47 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 29 Sep 2021 13:11:33 +0200 Subject: [PATCH] $CWD -> $REPOSITORY --- n/gitea/SlackBuild | 11 ++++++++--- n/minecraft-server/SlackBuild | 16 ++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/n/gitea/SlackBuild b/n/gitea/SlackBuild index cdf67795..12e2f2de 100755 --- a/n/gitea/SlackBuild +++ b/n/gitea/SlackBuild @@ -13,6 +13,10 @@ PKG=$TMP/pkg-$PRGNAM OUTPUT=${OUTPUT:-/tmp} PREFIX=/usr +REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM} + +mkdir -p $REPOSITORY + GITEA_WORK_DIR=/var/lib/gitea # Check if the gitea user and group exist. If not, then bail. @@ -26,13 +30,14 @@ fi echo $ARCH | grep -q arm && SRC_ARCH=arm-7 echo $ARCH | grep -q 86 && SRC_ARCH=386 echo $ARCH | grep -q 64 && SRC_ARCH=amd64 -wget -c https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-${SRC_ARCH}.xz -O $CWD/gitea-${VERSION}-linux-${SRC_ARCH}.xz -xz -d $CWD/gitea-${VERSION}-linux-${SRC_ARCH}.xz + +[ ! -e $REPOSITORY/gitea-${VERSION}-linux-${SRC_ARCH}.xz ] && wget -c https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-${SRC_ARCH}.xz -O $REPOSITORY/gitea-${VERSION}-linux-${SRC_ARCH}.xz +xz -d $REPOSITORY/gitea-${VERSION}-linux-${SRC_ARCH}.xz rm -fr $PKG mkdir -p $PKG$PREFIX/bin -mv $CWD/gitea-${VERSION}-linux-${SRC_ARCH} $PKG$PREFIX/bin/${PRGNAM} +cp $REPOSITORY/gitea-${VERSION}-linux-${SRC_ARCH} $PKG$PREFIX/bin/${PRGNAM} chmod +x $PKG$PREFIX/bin/${PRGNAM} mkdir -p $PKG/etc/gitea/ diff --git a/n/minecraft-server/SlackBuild b/n/minecraft-server/SlackBuild index 62eb88b5..d1f440e9 100755 --- a/n/minecraft-server/SlackBuild +++ b/n/minecraft-server/SlackBuild @@ -21,12 +21,16 @@ PKG=$TMP/pkg-$PRGNAM OUTPUT=${OUTPUT:-/tmp} PREFIX=/usr -wget -c $(curl https://www.minecraft.net/en-us/download/server | grep -o "https.*server\.jar") -O $CWD/$PRGNAM.jar +REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM} + +mkdir -p $REPOSITORY + +[ ! -e $REPOSITORY/${PRGNAM}-${VERSION}.jar ] && wget -c $(curl https://www.minecraft.net/en-us/download/server | grep -o "https.*server\.jar") -O $REPOSITORY/${PRGNAM}-${VERSION}.jar rm -fr $PKG mkdir -p $PKG/opt/$PRGNAM -mv $CWD/$PRGNAM.jar $PKG/opt/$PRGNAM/$PRGNAM.jar +cp $REPOSITORY/${PRGNAM}-${VERSION}.jar $PKG/opt/$PRGNAM/$PRGNAM.jar cat < $PKG/opt/$PRGNAM/start.sh #!/bin/bash java -Xms1G -Xmx1G -jar /opt/$PRGNAM/$PRGNAM.jar nogui @@ -89,14 +93,14 @@ cat < $PKG/install/slack-desc |-----handy-ruler--------------------------------------------------------| $PRGNAM: $PRGNAM (Proprietary Minecraft Server) $PRGNAM: -$PRGNAM: -$PRGNAM: $PRGNAM: -$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: $PRGNAM: https://www.minecraft.net/en-us/download/server/ $PRGNAM: $PRGNAM: -$PRGNAM: +$PRGNAM: $PRGNAM: EOF