diff options
Diffstat (limited to '')
-rwxr-xr-x | minecraft/build/minecraft.SlackBuild | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/minecraft/build/minecraft.SlackBuild b/minecraft/build/minecraft.SlackBuild index 00136a09..06eb30bd 100755 --- a/minecraft/build/minecraft.SlackBuild +++ b/minecraft/build/minecraft.SlackBuild @@ -32,6 +32,9 @@ # Changelog: # latest-1: 14/Jan/2012 by Eric Hameleers <alien@slackware.com> # * Initial build. +# latest-2: 24/mar/2012 by Eric Hameleers <alien@slackware.com> +# * Do not include minecraft.jar in the package for legal reasons. +# The .jar file will be downloaded when the package is installed. # # Run 'sh minecraft.SlackBuild' to build a Slackware package. # The package (.tgz) and .txt file as well as build logs are created in /tmp . @@ -43,7 +46,7 @@ PRGNAM=minecraft VERSION=${VERSION:-latest} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} ARCH=noarch NUMJOBS=${NUMJOBS:" -j4 "} TAG=${TAG:-alien} @@ -56,7 +59,6 @@ TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -SOURCE="$SRCDIR/${PRGNAM}.jar" SRCURL="http://www.minecraft.net/download/${PRGNAM}.jar" ## @@ -83,31 +85,6 @@ rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log # remove old log files -# Source file availability: -if ! [ -f ${SOURCE} ]; then - echo "Source '$(basename ${SOURCE})' not available yet..." - # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT - [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" - if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi - if ! [ "x${SRCURL}" == "x" ]; then - echo "Will download file to $(dirname $SOURCE)" - wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true - if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then - echo "Downloading '$(basename ${SOURCE})' failed... aborting the build." - mv -f "${SOURCE}" "${SOURCE}".FAIL - exit 1 - fi - else - echo "File '$(basename ${SOURCE})' not available... aborting the build." - exit 1 - fi -fi - -if [ "$P1" == "--download" ]; then - echo "Download complete." - exit 0 -fi - # --- PACKAGE BUILDING --- echo "++" @@ -118,7 +95,9 @@ echo "++" install -D -m0755 $SRCDIR/minecraft.sh $PKG/usr/bin/minecraft install -D -m0644 $SRCDIR/minecraft.desktop $PKG/usr/share/applications/minecraft.desktop install -D -m0644 $SRCDIR/minecraft.png $PKG/usr/share/pixmaps/minecraft.png -install -D -m0644 $SOURCE $PKG/usr/share/minecraft/minecraft.jar +# Do not add the .jar file to the package, for legal reasons (terms of use), +# just create the directory where it will be downloaded to by doinst.sh +mkdir -p $PKG/usr/share/minecraft # Add this to the doinst.sh: mkdir -p $PKG/install @@ -140,6 +119,20 @@ if [ -x usr/bin/update-mime-database ]; then chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 fi +# Download the .jar file now: +if [ ! -f usr/share/minecraft/minecraft.jar ]; then + echo "Downloading your copy of '\$(basename ${SRCURL})' ..." + wget -nv -T 20 -O usr/share/minecraft/minecraft.jar "${SRCURL}" + if [ \$? -eq 0 ]; then + chmod 644 usr/share/minecraft/minecraft.jar + else + echo "Downloading of '${SRCURL}' failed!" + echo "Please try downloading this file manually, and copy '\$(basename ${SRCURL})' into directory /usr/share/minecraft/ (as root)." + fi +else + echo "File '\$(basename ${SRCURL})' exists, no need to download it." +fi + EOINS # Add documentation: |