Editing
Synology package files
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Package Structure=== An .spk file is nothing more then a tar file, containing a standard structure and files. It is not related to any existing .spk packaging formats that are known and it looks like this .spk structure is designed/defined by Synology themselves and in no way compatible with any other packaging methods. You can 'unpack' any spk file simply by untarring (tar -xvf ''filename'') the file. Every package will contain the following files/directories (mind the capitals!): {| border="0" cellspacing="10" |- valign="top" |'''INFO''' |This is a file containing information that will be displayed and used during installation. It consists of multiple key="value" lines. The following keys are used: {| class="wikitable" |- valign="top" |'''package''' |The - unique! - name of the package, as will be displayed during install, in package manager overview and will be used as directory name under which the whole package will reside. |- valign="top" |'''version''' |guess what... |- valign="top" |'''maintainer''' |Who is the 'owner' of the package. Only used for information purposes |- valign="top" |'''description''' |A small description of the package. Only used for information purposes |- valign="top" |'''arch''' |CPU Architecture. "noarch" if it will fit all DiskStations. Other "arch" values can be "x86", "88f6281", "88f6282", "88f5281", "ppc853x" or "ppc854x", depending on the [[What kind of CPU_does my NAS have|CPU]]. For models with the PPC 8241 CPU there are two different values for "arch" depending on the Linux version. It is "powerpc" for Linux 2.4 and "ppc824x" for Linux 2.6. Calling "uname -r" on a shell shows the Linux version. |- valign="top" |'''adminport''' |optional. If the program is installed and has it own "administration" webpage, this will be the port number the server listens to. |- valign="top" |'''adminurl''' |optional. If the program is installed and has it own "administration" webpage, this will be the rest of the url. (URL becomes <nowiki>http://own-name-of-nas:adminport/adminurl</nowiki>) |- valign="top" |'''firmware''' |optional. Minimum version of DSM firmware that is required to run the package. |- valign="top" |'''reloadui''' |optional. Set to "yes" if there is a need to refresh the complete browser screen after starting (like adding/enabling icons in left pane). |- valign="top" |'''package_icon''' |optional. Base64 encoded icon of the package, used by DSM 3.2 and up. The size is free, but the display size is 72x72, regardless of the aspect ratio. |} |- valign="top" |'''package.tgz''' |This is a compressed (gzip) tar file containing all the files that are needed. The installer will automatically unpack this package. The file has to have this name exactly, otherwise installation will end with an error "invalid file format". |- valign="top" |'''scripts''' | This is a directory containing multiple shell scripts: {| class="wikitable" |- valign="top" |'''preinst''' |This script is run before installing the package. It is the good place to check if the installation requirements are met. |Returning anything other than 0 will stop the installation. |- valign="top" |'''postinst''' |This script is run after the installation of the package. It is the good place to ensure that all file permissions and ownership are right. |Returning anything other than 0 will stop the installation. |- valign="top" |'''preuninst''' |This script is run before removing the package. It shall do the reverse action of the '''postinst''' script. |Returning anything other than 0 will stop the uninstallation. |- valign="top" |'''postuninst''' |This script is run after the package has been removed from the system. |Returning anything other than 0 will stop the uninstallation. |- valign="top" |'''preupgrade''' |(optional) This script is run when a package is upgraded through the "upgrade" functionality of the package manager, before doing the uninstallation of the old version (before its '''preuninst'''). |Returning anything other than 0 will stop the upgrade. |- valign="top" |'''postupgrade''' |(optional) This script is run when once package has been upgraded, after the new version has been installed (after its '''postinst'''). |Returning anything other than 0 will stop the upgrade, but it is too late to roll back. |- valign="top" |style="white-space:nowrap"|'''start-stop-status''' |This script is used by the package manager to start, stop, and get the running status and log file location of the package once installed. It will be copied in the directory '''/usr/local/etc/rc.d/<packageName>.sh''' and run from this place. It will always be given an argument via the package manager. * Hitting "run" in packagemanager will start this script with the '''start''' argument * Hitting "stop" result in '''stop''' * When (re-)loading the package manager page, it will also call the script for a '''status''' update. * When accessing the log tab of the package info page, the argument will be '''log''', The package manager expects the filename of the logfile to be printed out to STDOUT. It will then read the content of that file and display it. |In all cases, returning '0' means 'all ok' and '1' means 'error occurred' or 'not running' (when checking status). |} |}
Summary:
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information