QPKG Development Guidelines: Difference between revisions

From QNAPedia
Jump to navigation Jump to search
No edit summary
(17 intermediate revisions by the same user not shown)
Line 11: Line 11:
== Installation ==
== Installation ==


Download and install the QPKG file and it will automatically create the system-wide configuration file, /etc/config/qdk.conf, and when enabled it also creates a symlink for qbuild in /usr/bin. The reference manual is included in a separate zip file. There is also a document (QDK Cookbook) with solutions to different common situations that you could run into when using QDK to build QPKG packages.
Download and install the QPKG file and it will automatically create the system-wide configuration file, '''/etc/config/qdk.conf''', and when enabled it also creates a symlink for '''qbuild''' in '''/usr/bin'''. The reference manual is included in a separate zip file. There is also a document (QDK Cookbook) with solutions to different common situations that you could run into when using QDK to build QPKG packages.
 
== Document ==
 
#[http://download.qnap.com/dev/QDK_Cookbook.zip QDK Cookbook]
#[http://download.qnap.com/dev/QDK_2.0.pdf QDK 2.0 Documentation]
#[http://download.qnap.com/dev/QDK_Quick_Start_Guide_v4_eng.pdf QDK Quick Start Guide]
#[http://download.qnap.com/dev/QPKG_developer_FAQ.pdf QPKG Developer FAQ]


== Downloads ==
== Downloads ==


#[http://files.qnap.com/download/Storage/QPKG/QDK_Cookbook.zip QDK Cookbook]
#[http://download.qnap.com/QPKG/QDK/QDK_2.2.16.zip QDK 2.2.16]
#[http://files.qnap.com/download/Storage/QPKG/QDK_2.0_doc.zip QDK 2.0 Documentation]
 
#[http://download.qnap.com/Storage/Utility/QDK_2.2.4.zip QDK_2.2.4]
== History ==
#QDK 2.2.10
[http://download.qnap.com/QPKG/QDK/QDK_2.2.16.zip 2.2.16]
 
*Support ARM 64bit platform
 
[http://download.qnap.com/QPKG/QDK/QDK_2.2.15.zip 2.2.15]
 
*Add "export QNAP_QPKG" session in sample start script. It is for Resource Monitor to monitor the folk process of your QPKG.
*Add creating md5sum file after qbuild the package.
*Support png format for icon files.
*Change order of installation logs.
 
[http://download.qnap.com/QPKG/QDK/QDK_2.2.14.zip 2.2.14]
 
*Add QNAP display name in qpkg.cfg.(The QPKG name displayed on QTS Web UI)
*Add support maxmum QTS version limitation.
*Fix template sample code bug.
 
[http://download.qnap.com/QPKG/QDK/QDK_2.2.13.zip 2.2.13]
 
*Add QTS HTTP Proxy and set Proxy_Path function in qpkg.cfg.
*Add Timeout (in seconds) for QPKG Enable (first integer) and Timeout for QPKG Disable (second integer) function in qpkg.cfg. (since 4.1.0)
*Add Visible setting for If the QPKG has web UI, show this QPKG on the Main menu function in qpkg.cfg.


[http://download.qnap.com/QPKG/QDK/QDK_2.2.12.zip 2.2.12]


== Changelog ==
*Add QTS system volume mount check.


2.2.10
2.2.11
 
*Modify installation succeeded system logs.
 
[http://download.qnap.com/QPKG/QDK/QDK_2.2.10.zip 2.2.10]


*Add installation log to system logs.
*Add installation log to system logs.


2.2.9
[http://download.qnap.com/QPKG/QDK/QDK_2.2.9.zip 2.2.9]


*Support volume selection / migration (requires minimum QTS 4.2.1)
*Support volume selection / migration (requires minimum QTS 4.2.1)


2.2.8
[http://download.qnap.com/QPKG/QDK/QDK_2.2.8.zip 2.2.8]


*Add to support minimum QTS version limitation.
*Add to support minimum QTS version limitation.
Line 40: Line 73:
*Command qbuild could use build bumber
*Command qbuild could use build bumber


2.2.6
[http://download.qnap.com/QPKG/QDK/QDK_2.2.6.zip 2.2.6]


*Enhance recognition of different platforms
*Enhance recognition of different platforms


2.2.4
[http://download.qnap.com/QPKG/QDK/QDK_2.2.4.zip 2.2.4]


*New platform - support arm_x31, ce53xx(TS-269H) and arm_x41(TS-x31+) architecture string.
*New platform - support arm_x31, ce53xx(TS-269H) and arm_x41(TS-x31+) architecture string.
Line 57: Line 90:
2.0
2.0


* New upgrade handling. The new version is installed over the old version and then any obsolete files are removed. No other files are removed.
*New upgrade handling. The new version is installed over the old version and then any obsolete files are removed. No other files are removed.
* The new upgrade handling means that QPKG_CONFIG_DIR has no effect any longer and can be removed from the QPKG configuration file.
*The new upgrade handling means that QPKG_CONFIG_DIR has no effect any longer and can be removed from the QPKG configuration file.
* Support for other compression algorithms. Currently, QDK supports gzip, bzip2, and 7-zip.
*Support for other compression algorithms. Currently, QDK supports gzip, bzip2, and 7-zip.
* Support for specifying requirements on Optware packages (both in QPKG_REQUIRE and QPKG_CONFLICT)
*Support for specifying requirements on Optware packages (both in QPKG_REQUIRE and QPKG_CONFLICT)
* Support for installing required Optware packages automatically at installation.
*Support for installing required Optware packages automatically at installation.
* Support to include Optware packages in the QPKG package and access them as part of a local repository at installation.<br/>* New function to extract data archives can be used in package specific functions, extract_data ARCHIVE [DIRECTORY]
*Support to include Optware packages in the QPKG package and access them as part of a local repository at installation.
* Support for more verbose output and debug messages when running qbuild.
*New function to extract data archives can be used in package specific functions, extract_data ARCHIVE [DIRECTORY]
* Possible to use | in QPKG_REQUIRE to separate requirements where only one of the requirements has to be true.
*Support for more verbose output and debug messages when running qbuild.
* The data in the QPKG package has been split into several parts, control files, data files, and any extra data files. Provides better performance and easier access to the control files.
*Possible to use | in QPKG_REQUIRE to separate requirements where only one of the requirements has to be true.
* Support for digital signatures that can be used to make sure a package has not been modified after the package builder created it.
*The data in the QPKG package has been split into several parts, control files, data files, and any extra data files. Provides better performance and easier access to the control files.
* New QDK area has been added to QPKG format. At the moment only used for the optional digital signature.
*Support for digital signatures that can be used to make sure a package has not been modified after the package builder created it.
* Query option to retrieve information about a QPKG package without extracting the content.
*New QDK area has been added to QPKG format. At the moment only used for the optional digital signature.
* Name changes for some definitions. The old definitions can still be used, but a warning is output if they are found.
*Query option to retrieve information about a QPKG package without extracting the content.
* Several minor bugs have been fixed.
*Name changes for some definitions. The old definitions can still be used, but a warning is output if they are found.
*Several minor bugs have been fixed.


1.2.3
1.2.3
* Fixed bug that could make the cleanup function after a failed installation run when it shouldn't run.
 
* Obsolete configuration files were not removed from /etc/config/qpkg.conf.
*Fixed bug that could make the cleanup function after a failed installation run when it shouldn't run.
* Support function that could be used to add configuration files in the package specific functions.
*Obsolete configuration files were not removed from /etc/config/qpkg.conf.
*Support function that could be used to add configuration files in the package specific functions.


1.2.2
1.2.2


* New 64-bit systems could not install x86 packages. Architecture check has been updated to also allow the x86_64 architecture string.<br/>* Changed location for the saved configuration data during an upgrade.
*New 64-bit systems could not install x86 packages. Architecture check has been updated to also allow the x86_64 architecture string.
*Changed location for the saved configuration data during an upgrade.


1.2.1
1.2.1


* Support for variables defined at run-time in the remove functions (PKG_PRE_REMOVE, PKG_MAIN_REMOVE, and PKG_POST_REMOVE)<br/>* New package specific function, pkg_init, that can be used for initialization before the installation is started.
*Support for variables defined at run-time in the remove functions (PKG_PRE_REMOVE, PKG_MAIN_REMOVE, and PKG_POST_REMOVE)
*New package specific function, pkg_init, that can be used for initialization before the installation is started.


1.2
1.2


* New option --build-model that is used to include a check for given model in the QPKG file.<br/>* New option --force-config that is used to ignore missing configuration files specified in QPKG_CONFIG.
*New option --build-model that is used to include a check for given model in the QPKG file.
 
*New option --force-config that is used to ignore missing configuration files specified in QPKG_CONFIG.
* New option --no-compress that is used to not compress QPKG meta-files.
*New option --no-compress that is used to not compress QPKG meta-files.
* Changed --extract option to make it possible to specify where the data shall be extracted (default is still the current directory).
*Changed --extract option to make it possible to specify where the data shall be extracted (default is still the current directory).
* Template init-script is included when creating build environment using --create-env option.
*Template init-script is included when creating build environment using --create-env option.
* List of available definitions included in template qpkg.cfg and package_routines files.
*List of available definitions included in template qpkg.cfg and package_routines files.
* Name and location of system shares are available in shell definitions.
*Name and location of system shares are available in shell definitions.
* Extra source packages can be included using QDK_EXTRA_SRC_FILE
*Extra source packages can be included using QDK_EXTRA_SRC_FILE
* Upgrade functions in the installation scripts are replaced with a re-installation where specified config files are restored if necessary.
*Upgrade functions in the installation scripts are replaced with a re-installation where specified config files are restored if necessary.
* Configuration files that shall be restored at an upgrade can be specified using QPKG_CONFIG
*Configuration files that shall be restored at an upgrade can be specified using QPKG_CONFIG
* Directory with configuration data that shall be restored at an upgrade can be specified using QPKG_CONFIG_DIR
*Directory with configuration data that shall be restored at an upgrade can be specified using QPKG_CONFIG_DIR
* Added support function that can write warning messages to system log, warn_log
*Added support function that can write warning messages to system log, warn_log
* QPKG icons contributed by WatskeBart
*QPKG icons contributed by WatskeBart
* Optimized functions in generic installation script for slightly faster installation (5-10 seconds) of created packages.
*Optimized functions in generic installation script for slightly faster installation (5-10 seconds) of created packages.


1.0
1.0


* First release
*First release


<br/>Special thanks to [http://forum.qnap.com/memberlist.php?mode=viewprofile&u=54331 micke]&nbsp;for the new QPKG development kit (QDK), which can be followed in [http://forum.qnap.com/viewtopic.php?f=131&t=36132 this]&nbsp;thread.
Special thanks to [http://forum.qnap.com/memberlist.php?mode=viewprofile&u=54331 micke]&nbsp;for the new QPKG development kit (QDK), which can be followed in [http://forum.qnap.com/viewtopic.php?f=131&t=36132 this thread].
[[Category:QPKG]] [[Category:QPKG Development|Development]]
[[Category:QPKG|Development]] [[Category:QPKG Development|Development]]

Revision as of 16:23, 19 October 2017

Description

QDK is used to build QPKG files/applications for QNAP Turbo NAS. A QPKG file makes it easy for anyone to install and remove packages. It also gives a package maintainer almost total control on how the package is installed on the NAS.

The major design goal of QDK is to make it easy for the package maintainer to create simple QPKG files and at the same time also support more advanced packages. QDK started out as a simple modification of the first official release of the QPKG SDK, but now supersedes it. It includes many new features like architecture check at installation, support for digital signatures, different compression algorithms, a comprehensive option to check that other required QPKG packages or Optware packages are installed (or that conflicting packages are not installed), automatic installation of required Optware packages, and a powerful build script.

License

QDK is distributed under the GPL making it completely open and available for anyone to use.

Installation

Download and install the QPKG file and it will automatically create the system-wide configuration file, /etc/config/qdk.conf, and when enabled it also creates a symlink for qbuild in /usr/bin. The reference manual is included in a separate zip file. There is also a document (QDK Cookbook) with solutions to different common situations that you could run into when using QDK to build QPKG packages.

Document

  1. QDK Cookbook
  2. QDK 2.0 Documentation
  3. QDK Quick Start Guide
  4. QPKG Developer FAQ

Downloads

  1. QDK 2.2.16

History

2.2.16

  • Support ARM 64bit platform

2.2.15

  • Add "export QNAP_QPKG" session in sample start script. It is for Resource Monitor to monitor the folk process of your QPKG.
  • Add creating md5sum file after qbuild the package.
  • Support png format for icon files.
  • Change order of installation logs.

2.2.14

  • Add QNAP display name in qpkg.cfg.(The QPKG name displayed on QTS Web UI)
  • Add support maxmum QTS version limitation.
  • Fix template sample code bug.

2.2.13

  • Add QTS HTTP Proxy and set Proxy_Path function in qpkg.cfg.
  • Add Timeout (in seconds) for QPKG Enable (first integer) and Timeout for QPKG Disable (second integer) function in qpkg.cfg. (since 4.1.0)
  • Add Visible setting for If the QPKG has web UI, show this QPKG on the Main menu function in qpkg.cfg.

2.2.12

  • Add QTS system volume mount check.

2.2.11

  • Modify installation succeeded system logs.

2.2.10

  • Add installation log to system logs.

2.2.9

  • Support volume selection / migration (requires minimum QTS 4.2.1)

2.2.8

  • Add to support minimum QTS version limitation.
  • Add QTS apache root path.

2.2.7

  • Command qbuild could use build bumber

2.2.6

  • Enhance recognition of different platforms

2.2.4

  • New platform - support arm_x31, ce53xx(TS-269H) and arm_x41(TS-x31+) architecture string.
  • New option - “Web_SSL_Port” that can access Web via SSL port.
  • Bug fix: support extract QPKG that builded by previous QDK.
  • Add QPKG_DESKTOP_APP="1" option.

2.0.1

  • Bug fix: List of installed files is not updated when using 7-zip. This would make an upgrade of a package behave as if it was a new installation.

2.0

  • New upgrade handling. The new version is installed over the old version and then any obsolete files are removed. No other files are removed.
  • The new upgrade handling means that QPKG_CONFIG_DIR has no effect any longer and can be removed from the QPKG configuration file.
  • Support for other compression algorithms. Currently, QDK supports gzip, bzip2, and 7-zip.
  • Support for specifying requirements on Optware packages (both in QPKG_REQUIRE and QPKG_CONFLICT)
  • Support for installing required Optware packages automatically at installation.
  • Support to include Optware packages in the QPKG package and access them as part of a local repository at installation.
  • New function to extract data archives can be used in package specific functions, extract_data ARCHIVE [DIRECTORY]
  • Support for more verbose output and debug messages when running qbuild.
  • Possible to use | in QPKG_REQUIRE to separate requirements where only one of the requirements has to be true.
  • The data in the QPKG package has been split into several parts, control files, data files, and any extra data files. Provides better performance and easier access to the control files.
  • Support for digital signatures that can be used to make sure a package has not been modified after the package builder created it.
  • New QDK area has been added to QPKG format. At the moment only used for the optional digital signature.
  • Query option to retrieve information about a QPKG package without extracting the content.
  • Name changes for some definitions. The old definitions can still be used, but a warning is output if they are found.
  • Several minor bugs have been fixed.

1.2.3

  • Fixed bug that could make the cleanup function after a failed installation run when it shouldn't run.
  • Obsolete configuration files were not removed from /etc/config/qpkg.conf.
  • Support function that could be used to add configuration files in the package specific functions.

1.2.2

  • New 64-bit systems could not install x86 packages. Architecture check has been updated to also allow the x86_64 architecture string.
  • Changed location for the saved configuration data during an upgrade.

1.2.1

  • Support for variables defined at run-time in the remove functions (PKG_PRE_REMOVE, PKG_MAIN_REMOVE, and PKG_POST_REMOVE)
  • New package specific function, pkg_init, that can be used for initialization before the installation is started.

1.2

  • New option --build-model that is used to include a check for given model in the QPKG file.
  • New option --force-config that is used to ignore missing configuration files specified in QPKG_CONFIG.
  • New option --no-compress that is used to not compress QPKG meta-files.
  • Changed --extract option to make it possible to specify where the data shall be extracted (default is still the current directory).
  • Template init-script is included when creating build environment using --create-env option.
  • List of available definitions included in template qpkg.cfg and package_routines files.
  • Name and location of system shares are available in shell definitions.
  • Extra source packages can be included using QDK_EXTRA_SRC_FILE
  • Upgrade functions in the installation scripts are replaced with a re-installation where specified config files are restored if necessary.
  • Configuration files that shall be restored at an upgrade can be specified using QPKG_CONFIG
  • Directory with configuration data that shall be restored at an upgrade can be specified using QPKG_CONFIG_DIR
  • Added support function that can write warning messages to system log, warn_log
  • QPKG icons contributed by WatskeBart
  • Optimized functions in generic installation script for slightly faster installation (5-10 seconds) of created packages.

1.0

  • First release

Special thanks to micke for the new QPKG development kit (QDK), which can be followed in this thread.