Skip to content
hgy59 edited this page Apr 22, 2022 · 77 revisions

Available Variables in local.mk

Variable name Explanation Example
PUBLISH_URL
PUBLISH_API_KEY
DISTRIBUTOR
DISTRIBUTOR_URL
PUBLISH_URL
REPORT_URL
DEFAULT_TC Define default DSM version to be built by default.
Multiple version can be passed in argument.
This will be used to build all required packages when using make all-supported
DEFAULT_TC = 6.1 7.0
PSTAT Enable parallel compile stats using time when compiling
This generates a build.stats.log in the working directory
===> MAKELEVEL: 1, PARALLEL_MAKE: max, ARCH: native, NAME: python3
90.55user 7.09system 0:11.58elapsed 842%CPU (0avgtext+0avgdata 115260maxresident)k
649375inputs+219627outputs (30major+1471914minor)pagefaults 0swaps
PARALLEL_MAKE Ability to build multiple archs in parallel.
This also honor the -j flag within each arch parallel builds
PARALLEL_BUILD=4 make -j4 all-supported
PARALLEL_BUILD=max make all-supported

Available Variables in src/service-setup.sh

Variable name Explanation Example
SYNOPKG_PKGDEST Default application path. Variable provided by Synology DSM environment natively. /var/packages/<app>/target
SYNOPKG_SPKVAR Default application var directory DSM6:
/var/packages/<app>/target/var
DSM7:
/var/packages/<app>/var

Available Variables in cross/ Makefiles

Variable name Explanation Example
%_TARGET ability to overwrite the default target values: (CONFIGURE, BUILD, INSTALL, PATCH, PATCH, DOWNLOAD, STRIP) also every PRE_ and POST_ state CONFIGURE_TARGET=umurmur_configure POST_PATCH_TARGET=python_post_patch
GNU_CONFIGURE Use GNU Configure (adds --host --target flags) GNU_CONFIGURE = 1
CONFIGURE_ARGS add some extra flags to the configure option CONFIGURE_ARGS = --disable-test
ADDITIONAL_%_FLAGS add some extra flags besides the one set by spksrc values (ld, cxx, c) ADDITIONAL_LD_FLAGS = -L$(STAGING_INSTALL_PREFIX)/lib
DEPENDS package depends on those tools or libraries. DEPENDS = cross/openssl
BUILD_DEPENDS package depends only needed for build (will not be included in spk) BUILD_DEPENDS = cross/ffmpeg
OPTIONAL_DEPENDS package depends conditonally for instance only for some arch, used for dependency scanning OPTIONAL_DEPENDS = cross/rnm
UNSUPPORTED_ARCHS exclude those arches from being built UNSUPPORTED_ARCHS=cedarview
KERNEL_ROOT Root directory of the kernel source tree.
Enabled when REQUIRE_KERNEL = 1
spksrc/cross/<app>/work-<arch>-<v>/linux
REQUIRE_KERNEL The build process will prepare corresponding DSM kernel for module building. REQUIRE_KERNEL = 1
REQUIRE_TOOLKIT The build process will download and extract the corresponding DSM development toolkit. REQUIRE_TOOLKIT = 1
REQUIRED_MIN_DSM The build process will exit when a lower than required DSM toolchain is used. Used for DSM archs only. REQUIRED_MIN_DSM = 5.2
REQUIRED_MAX_DSM The build process will exit when a higher than DSM toolchain version is used. Used for DSM archs only. REQUIRED_MAX_DSM = 6.999 to disable build for DSM >= 7
REQUIRED_MIN_SRM The build process will exit when a lower than required SRM toolchain is used. Used for SRM archs only. REQUIRED_MIN_SRM = 1.2
PKG_DIST_NAME The name of the source file to download. When this name does not contain the package name add a definition for PKG_DIST_FILE PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_FILE Provide a custom Name for the downloaded source file. Needed when filename does not contain package name (i.e. version only) to avoid conflicts in distrib folder. PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_ARCH PKG_DIST_ARCH_LIST For packages that have arch specific source files. Use PKG_DIST_ARCH in the definition of PKG_DIST_NAME and define a list of all dist archs with PKG_DIST_ARCH_LIST. As example see cross/libstd++ PKG_DIST_NAME = $(PKG_NAME).master.$(PKG_VERS).linux-core-$(PKG_DIST_ARCH).$(PKG_EXT)
PKG_DIST_ARCH_LIST = x64 arm arm64

Available Variables in native/ Makefiles

Variable name Explanation Example
%_TARGET ability to overwrite the default target values: (CONFIGURE, BUILD, INSTALL, PATCH, PATCH, DOWNLOAD, STRIP) also every PRE_ and POST_ state PRE_INSTALL_TARGET=mysql-connector-c_pre_install
GNU_CONFIGURE Use GNU Configure (adds --host --target flags) GNU_CONFIGURE = 1
CONFIGURE_ARGS add some extra flags to the configure option CONFIGURE_ARGS = --disable-test
NATIVE_%_FLAGS add some extra flags besides the one set by spksrc values (ld, cxx, c) NATIVE_LD_FLAGS=-L/some/path
DEPENDS package depends on those tools DEPENDS = native/go-1.4
PKG_DIST_NAME The name of the source file to download. When this name does not contain the package name add a definition for PKG_DIST_FILE PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_FILE Provide a custom Name for the downloaded source file. Needed when filename does not contain package name (i.e. version only) to avoid conflicts in distrib folder. PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)

Available Variables in spk/ Makefiles

Variable name Explanation Example
SPK_NAME Package name SPK_NAME = deluge
SPK_VERS Software version SPK_VERS = 1.3.12
SPK_REV Package Revision number. Starts at 1, goes up 1 for every subsequent release unrelated to SPK_VERS SPK_REV = 5
SPK_ICON Icon to be used in DSM. Must be of quadratic shape. Use at least 256x256 pixel. SPK_ICON = src/deluge.png
DSM_UI_DIR DSM UI directory location, relative to /var/packages/$PACKAGE/target/. Must be defined to provide a shortcut (icon) in DSM DSM_UI_DIR = app
BETA Marks a package as beta. Remove variable if not BETA=1
REPORT_URL Link to beta package feedback submission. In local.mk REPORT_URL = https://github.com/SynoCommunity/spksrc/issues
ARCH Sets the arch to the specified value. Omitting a value sets noarch ARCH =
BUILD_DEPENDS Dependencies declared here are used during the build process, but are not included in the final package. BUILD_DEPENDS = cross/python3
DEPENDS Requirements to compile and/or run the software after packaging DEPENDS = cross/libtorrent cross/$(SPK_NAME)
WHEELS See Using Python wheels WHEELS = src/requirements.txt
SPK_DEPENDS Packages that must be installed before installation of this package is allowed SPK_DEPENDS = "python3>=3.7.7-15:gnupg>=2.1.6"
REQUIRED_MIN_DSM The build process will exit when a lower than required DSM toolchain is used. Used for DSM archs only. REQUIRED_MIN_DSM = 5.2
REQUIRED_MAX_DSM The build process will exit when a higher than DSM toolchain version is used. Used for DSM archs only. REQUIRED_MAX_DSM = 6.999 to disable build for DSM >= 7
REQUIRED_MIN_SRM The build process will exit when a lower than required SRM toolchain is used. Used for SRM archs only. REQUIRED_MIN_SRM = 1.2
FIRMWARE The minimum DSM version for DSM < 6.1 FIRMWARE = 4.3-3776
OS_MIN_VERS The minimum DSM version for DSM >= 6.1 OS_MIN_VERS = 6.2-23739
UNSUPPORTED_ARCHS Exclude these arches from being built UNSUPPORTED_ARCHS=cedarview
MAINTAINER The creator of the package or current maintainer. Please use a github username. If you don't use a github username, you must define the MAINTAINER_URL MAINTAINER = Diaoul
MAINTAINER_URL URL of the creator or maintainer of the package. If the MAINTAINER is a valid github user the MAINTAINER_URL is evaluated to the github user account. If the MAINTAINER is not a github user, you sould define a valid URL. MAINTAINER_URL = https://gihub.com/synocommunity
DESCRIPTION Package description shown in Package Center. Multiple languages are supported. Double quotes must be escaped by backslash. DESCRIPTION = "It's a \"great\" package", DESCRIPTION_FRE = "C'est un \"super\" package (in French)"
ADMIN_PORT Port for web based management interface of package. For new packages please choose a free port and update the list SynoCommunity Used Ports ADMIN_PORT = 9091
ADMIN_PROTOCOL Protocol for web based management interface. Optional ADMIN_PROTOCOL = http
ADMIN_URL URL context for web based management interface. Optional ADMIN_URL = /
RELOAD_UI obsolete, not documented by synology
DISPLAY_NAME The name displayed in Package Center DISPLAY_NAME = Transmission
CHANGELOG Description of changes related to the SPK_REV. CHANGELOG = "Enable sc-download group", CHANGELOG = "1. First entry<br>2. Second entry"
HOMEPAGE Software homepage HOMEPAGE = http://www.transmissionbt.com
LICENSE Software license LICENSE = GPLv2/GPLv3
WIZARDS_DIR Location of the wizard UI files WIZARDS_DIR = src/wizard
CONF_DIR Location of the conf/ directory to include in package CONF_DIR = src/conf
STARTABLE Required. Declares if package starts a service STARTABLE = no
SERVICE_USER Runtime user account for generic service support. auto is recommended SERVICE_USER=auto
SERVICE_SETUP Shell script functions and variables for package specific installation or service startup/stop process. Is not DSM start-stop-status script. When ever possible prefere SERVICE_SETUP over SSS_SCRIPT and INSTALLER_SCRIPT. SERVICE_SETUP = src/service-setup.sh
SERVICE_PORT TCP port of generic service support for firewall and DSM shortcut. May be identical to ADMIN_PORT SERVICE_PORT = $(ADMIN_PORT)
SERVICE_PORT_TITLE Protocol name for firewall interface. Default is package name SERVICE_PORT_TITLE=imaps
SERVICE_PORT_PROTOCOL Protocol for DSM shortcut. Default is http SERVICE_PORT_PROTOCOL=https
SERVICE_PORT_URL URL context path to access application from DSM shortcut. Default is / SERVICE_PORT_URL=/myapp
SERVICE_PORT_ALL_USERS Grant access to DSM shortcut for all users. Default is true SERVICE_PORT_ALL_USERS = true
NO_SERVICE_SHORTCUT Prevents DSM shortcut generation if set, when SERVICE_PORT does not provide http NO_SERVICE_SHORTCUT = true
SERVICE_WIZARD_SHARE Variable name from wizard which holds service storage on Shared Folder SERVICE_WIZARD_SHARE = wizard_share
SERVICE_WIZARD_GROUP Variable name from wizard which holds group name which controls service permissions to files on Shared Folder SERVICE_WIZARD_GROUP = wizard_group
SERVICE_CERT Configure DSM certificate management for this service name from the firewall config file (*.sc). If several services are defined, only one can be picked here. SERVICE_CERT = syncthing_webui
SERVICE_CERT_RELOAD Package-relative path to a script for reloading the service after certificate changes SERVICE_CERT_RELOAD = tools/ca_reloader.sh
SERVICE_COMMAND Service complete command line to fork with generic service support SERVICE_COMMAND = $${SYNOPKG_PKGDEST}/bin/myservice --port $${SERVICE_PORT}
SERVICE_EXE (deprecated) Process executable absolute path for BusyBox start-stop-daemon with generic service support
Deprecated as not supported with DSM 7.
SERVICE_EXE = $${SYNOPKG_PKGDEST}/bin/myservice
SERVICE_OPTIONS Process options for BusyBox start-stop-daemon with generic service support SERVICE_OPTIONS = --configuration $${SYNOPKG_PKGDEST}/var/myservice.conf --port $${SERVICE_PORT}
INSTALLER_SCRIPT Location of package specific installer script. Replace generic installer. Use SERVICE_SETUP instead, when possible. INSTALLER_SCRIPT = src/installer.sh
SSS_SCRIPT Location of package specific DSM start-stop-status. Use SERVICE_SETUP instead, when possible. SSS_SCRIPT = src/dsm-control.sh
FWPORTS Location of custom service configure file. Allows user to create firewall rules for this package. See SynoCommunity Ports FWPORTS = src/${SPK_NAME}.sc
INSTALL_PREFIX Obsolete. Default is INSTALL_PREFIX = /var/packages/$(SPK_NAME)/target and must not be changed.
POST_STRIP_TARGET Process extra installation after the stripping to the target files. POST_STRIP_TARGET = deluge_extra_install
SPK_COMMANDS List of folder/command to create soft links in /usr/local/{folder} for command line tools.
Requires use of generic installer.
SPK_COMMANDS = bin/lua bin/luac
SPK_USR_LOCAL_LINKS List of folder:command to create soft links for command line tools that are not located in a standard folder one level below the installation target.
Requires use of generic installer.
SPK_USR_LOCAL_LINKS = bin:env/bin/borg bin:env/bin/borgmatic
SPK_LINKS (deprecated) List of target:command to create soft links with different names for command line tools.
Deprecated, as not supported with DSM 7. Use SPK_USR_LOCAL_LINKS or SKP_COMMANDS.
Clone this wiki locally