- The development of the script was done on an Ubuntu [2] 12.04 32-bit.
- Working Python environment - on Ubuntu 12.04 it was 2.7.3
run bin/apkg-create-package.sh --help
to see how to invoke the script.
Example: sudo bin/apkg-create-package.sh i386
. That will create the Twonky Server package for the i386 based ASUSTOR NAS, like AS-20xT/TE and AS-30xT. The *.apk file will be copied to the current directory and has date/time added to it's name to prevent overwritting existing files.
The source
directory contains all files needed for Twonkyserver's APKG to run on i386 or x86_64 based ASUSTOR NAS'. Except the Twonkyserver files itself. You can download the currently lastest version 7.2.6 on the Twonkyserver NAS Download page, 32-bit or 64-bit. Unzip the content into the source/twonkyserver-i386
or source/twonkyserver-x86-64
directory directly and run the bin/apkg-create-package.sh
script.
- The script first looks for the file
twonkystarter
insource/twonkyserver-{arch}
to see if the Twonkyserver files are present. - Then copies over the architecture dependent Twonky Server files and adds common twonkyserver/cgi-bin/*.{desc,location} files[1] to the build directory.
- The Twonk Server provided
convert
executable incgi-bin
gets deleted - a recent version is provided by the NAS OS - andttu
moved tobin
so all the executables can be found in the same directory. - Sets ownership of the file in the build directory to admin:administrators (uid/gid 999)
- Runs the ASUSTOR provide packaging script
bin/apkg-tools.py
. The resulting package file is placed in the current directory and the naming consists of the date and time of creation.
[1]: The *.desc files were copied over from a Twonky Server installation on a QNAP NAS. "files"
- The
source/bin-{arch}
andsource/lib-{arch}
folder contain the files needed to have the helperflac
&ffmpeg
run successfully. - Twonky runs as user
admin
- Package configuration file is
source/CONTROL/config.json
. If you modify the package then you want to change at least the fieldsmaintainer
,version
andemail
- The package creates a shared folder named 'Media'. That's defined in
config.json
too. - The ASUSTOR packaging format is quite simple: the APKG file is a ZIP file holding three files :
apk-version
(= OS major version : 2.0),control.tgz
(content ofbuild/CONTROL
folder) anddata.tgz
(the rest of the build directory)
The bin-{i386,x86-64}
folders do contain the helper ffmpeg & flac. The ImageMagick helper convert
is already provided by the NAS itself in /usr/builtin/bin
- ASUSTOR product website
- ASUSTOR Developer Portal to get a clean copy of ASUSTOR packaging scipt. Free registration necessary. Also necessary to submit an application package
- ASUSTOR toolchain used to compile helper
ffmpeg
andflac
- Optware was used as build system. The Github repository for the ASUSTOR specific additions to Optware can be found here.