QPKG package

This commit is contained in:
Reinhard Pointner 2018-07-04 22:15:07 +07:00
parent 50d1da85fe
commit df0a7b56d8
8 changed files with 170 additions and 1 deletions

View File

@ -601,6 +601,46 @@
</target>
<target name="qpkg" depends="revision" description="Build QNAP NAS Package">
<property name="dir.staging" location="${dir.dist}/qpkg" />
<copy-replace todir="${dir.staging}">
<fileset dir="${dir.installer}/qpkg" excludes="**/*.gif" />
</copy-replace>
<copy todir="${dir.staging}">
<fileset dir="${dir.installer}/qpkg" includes="**/*.gif" />
</copy>
<copy todir="${dir.staging}/share/jar">
<fileset dir="${dir.dist}/lib" includes="*.jar" />
</copy>
<!-- include native libraries for all supported platforms -->
<copy todir="${dir.staging}/share/lib/armv7l">
<fileset dir="${dir.lib}/native/linux-armv7l" />
</copy>
<copy todir="${dir.staging}/share/lib/armv8">
<fileset dir="${dir.lib}/native/linux-armv8" />
</copy>
<copy todir="${dir.staging}/share/lib/i686">
<fileset dir="${dir.lib}/native/linux-i686" />
</copy>
<copy todir="${dir.staging}/share/lib/x86_64">
<fileset dir="${dir.lib}/native/linux-amd64" />
</copy>
<!-- fix execute permissions -->
<chmod verbose="yes" perm="+x">
<fileset dir="${dir.staging}" includes="**/*.sh" />
<fileset dir="${dir.staging}" includes="**/fpcalc" />
</chmod>
<exec executable="qbuild" dir="${dir.package}/qnap" failonerror="yes">
<arg line="--dir ${dir.dist}" />
</exec>
</target>
<target name="clean" description="Delete build artifacts">
<delete dir="${dir.dist}" />
<delete dir="${dir.build}" />
@ -636,11 +676,12 @@
<patternset id="release.files">
<include name="*.msi" />
<include name="*.zip" />
<include name="*.pkg" />
<include name="*.deb" />
<include name="*.tar.xz" />
<include name="*.spk" />
<include name="*.zip" />
<include name="*.qpkg" />
</patternset>
<patternset id="verification.files">
<include name="*.asc" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,29 @@
######################################################################
# Define any package specific operations that shall be performed when
# the package is removed.
######################################################################
PKG_POST_REMOVE='{
rm "/usr/local/bin/filebot"
rm "/usr/local/filebot"
}'
######################################################################
# Define any package specific operations that shall be performed when
# the package is installed.
######################################################################
pkg_post_install(){
mkdir -m 777 "$SYS_QPKG_DIR/data"
chown -R admin.administrators "$SYS_QPKG_DIR/data"
# create /usr/local/bin/[package] program link
mkdir -p "/usr/local/bin"
ln -sf "$SYS_QPKG_DIR/filebot.sh" "/usr/local/bin/filebot"
# create /usr/local/[package] link
ln -sf "$SYS_QPKG_DIR" "/usr/local/filebot"
}

23
installer/qpkg/qpkg.cfg Normal file
View File

@ -0,0 +1,23 @@
# Name of the packaged application.
QPKG_NAME="@{package.name}"
# Name of the display application.
QPKG_DISPLAY_NAME="@{application.name}"
# Version of the packaged application.
QPKG_VER="@{application.version}"
# Author or maintainer of the package
QPKG_AUTHOR="@{package.maintainer}"
# One-line description of the packaged application
QPKG_SUMMARY="@{package.description}"
# Preferred number in start/stop sequence.
QPKG_RC_NUM="452"
# Init-script used to control the start and stop of the installed application.
QPKG_SERVICE_PROGRAM="start-stop-status.sh"
# Minimum QTS version requirement
QTS_MINI_VERSION="4.1.0"

View File

@ -0,0 +1,54 @@
#!/bin/sh
PRG="$0"
# resolve relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
# get canonical path
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
FILEBOT_HOME=`cd "$PRG_DIR" && pwd`
# restore original working dir (which may be /root and yield permission denied)
if [ -x "$WORKING_DIR" ]; then
cd "$WORKING_DIR"
else
cd "$FILEBOT_HOME/../.." # System Volume Path (e.g. /share/CACHEDEV1_DATA)
fi
# make sure required environment variables are set
if [ -z "$USER" ]; then
export USER=`whoami`
fi
# force JVM language and encoding settings
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# choose extractor
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable" # use the 7z executable
# EXTRACTOR="SevenZipNativeBindings" # use the lib7-Zip-JBinding.so native library
# choose media parser
MEDIA_PARSER="libmediainfo" # use libmediainfo
# MEDIA_PARSER="ffprobe" # use ffprobe
# choose ffprobe executable
FFPROBE="/mnt/ext/opt/medialibrary/bin/ffprobe"
# select application data folder
APP_DATA="$FILEBOT_HOME/data/$USER"
LIBRARY_PATH="$FILEBOT_HOME/lib/$(uname -m)"
# start filebot
java -Dapplication.deployment=qpkg -Dnet.filebot.media.parser="$MEDIA_PARSER" -Dnet.filebot.media.ffprobe="$FFPROBE" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djava.awt.headless=true @{java.application.options} @{linux.application.options} @{linux.portable.application.options} $JAVA_OPTS $FILEBOT_OPTS -jar "$FILEBOT_HOME/jar/filebot.jar" "$@"

View File

@ -0,0 +1,22 @@
#!/bin/sh
case "$1" in
start)
exit 0
;;
stop)
exit 0
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0