Update portable package (Linux)

This commit is contained in:
Reinhard Pointner 2018-06-13 02:25:10 +07:00
parent bb37603772
commit f4acb0ba7e
3 changed files with 11 additions and 14 deletions

View File

@ -797,9 +797,15 @@
<target name="portable" description="Build portable package" depends="revision">
<property name="dir.staging" location="${dir.dist}/portable" />
<copy-replace todir="${dir.staging}">
<fileset dir="${dir.installer}/portable" includes="*.sh" />
</copy-replace>
<tar destfile="${dir.dist}/${release}-portable.tar.xz" compression="${tar.compression}" longfile="posix" encoding="utf-8">
<tarfileset file="${path.fatjar}" fullpath="FileBot.jar" />
<tarfileset dir="${dir.installer}/portable" includes="*.sh" filemode="755" />
<tarfileset dir="${dir.staging}" includes="*.sh" filemode="755" />
<tarfileset prefix="jar" dir="${dir.dist}/lib" />
<!-- include native libraries for all supported platforms -->
<tarfileset prefix="lib/armv7l" dir="${dir.lib}/native/linux-armv7l" includes="*.so" />

View File

@ -13,16 +13,12 @@ while [ -h "$PRG" ] ; do
done
# get canonical path
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`
# add package lib folder to library path
PACKAGE_LIBRARY_PATH="$APP_ROOT/lib/$(uname -m)"
# restore original working dir
cd "$WORKING_DIR"
# make sure required environment variables are set
if [ -z "$USER" ]; then
export USER=`whoami`
@ -41,4 +37,4 @@ EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar pl
APP_DATA="$APP_ROOT/data"
# start filebot
java @{java.application.options} -Dapplication.deployment=portable -Djava.awt.headless=true -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djna.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Djava.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Dnet.filebot.AcoustID.fpcalc="fpcalc" -Dapplication.dir="$APP_DATA" -Duser.home="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/tmp" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -classpath "$APP_ROOT/*" @{main.class} "$@"
java @{java.application.options} -Dapplication.deployment=portable -Djava.awt.headless=true -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djna.boot.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Djna.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Djava.library.path="$PACKAGE_LIBRARY_PATH:$LD_LIBRARY_PATH" -Dnet.filebot.AcoustID.fpcalc="fpcalc" -Dapplication.dir="$APP_DATA" -Duser.home="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/tmp" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" $JAVA_OPTS -classpath "$APP_ROOT/jar/*" @{main.class} "$@"

View File

@ -13,16 +13,12 @@ while [ -h "$PRG" ]; do
done
# make it fully qualified
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`
# restore original working dir
cd "$WORKING_DIR"
# update core application files
PACKAGE_NAME="FileBot.jar.xz.gpg"
PACKAGE_NAME="CHANGES.tar.xz.gpg"
PACKAGE_FILE="$APP_ROOT/$PACKAGE_NAME"
PACKAGE_URL="https://get.filebot.net/filebot/latest/$PACKAGE_NAME"
@ -37,11 +33,10 @@ fi
# initialize gpg
GPG_HOME="$APP_ROOT/data/.gpg"
JAR_XZ_FILE="$APP_ROOT/FileBot.jar.xz"
if [ ! -d "$GPG_HOME" ]; then
mkdir -p "$GPG_HOME" && chmod 700 "$GPG_HOME" && gpg --homedir "$GPG_HOME" --import "$APP_ROOT/maintainer.pub"
fi
# verify signature and extract jar
gpg --batch --yes --homedir "$GPG_HOME" --trusted-key "4E402EBF7C3C6A71" --output "$JAR_XZ_FILE" --decrypt "$PACKAGE_FILE" && xz --decompress --force "$JAR_XZ_FILE"
gpg --batch --yes --homedir "$GPG_HOME" --trusted-key "4E402EBF7C3C6A71" --decrypt "$PACKAGE_FILE" | tar -xJvf "-"