$CWD -> $REPOSITORY

This commit is contained in:
Gwenhael Le Moine 2021-09-29 13:11:33 +02:00
parent e113a900b4
commit dc84d500a5
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 18 additions and 9 deletions

View file

@ -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/

View file

@ -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 <<EOF > $PKG/opt/$PRGNAM/start.sh
#!/bin/bash
java -Xms1G -Xmx1G -jar /opt/$PRGNAM/$PRGNAM.jar nogui