From 55fed2af54fc02f9b70ca82ff63d748c427f21b3 Mon Sep 17 00:00:00 2001 From: hgy59 Date: Fri, 30 Apr 2021 20:11:31 +0200 Subject: [PATCH] fix resource linker for dsm6 (#4592) - fixes #4578 for packages without specific conf files --- mk/spksrc.service.mk | 9 ++++++--- mk/spksrc.spk.mk | 28 +++++++++++++++++++++------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/mk/spksrc.service.mk b/mk/spksrc.service.mk index 0d01787cff2..c2b1f0cc16d 100644 --- a/mk/spksrc.service.mk +++ b/mk/spksrc.service.mk @@ -170,6 +170,9 @@ ifneq ($(strip $(SERVICE_WIZARD_SHARE)),) '."data-share" = {"shares": [{"name": $$share, "permission":{"rw":[$$user]}} ] }' $@ 1<>$@ endif SERVICE_FILES += $(DSM_CONF_DIR)/resource +ifneq ($(findstring conf,$(SPK_CONTENT)),conf) +SPK_CONTENT += conf +endif # Less than DSM 6.0 else @@ -182,13 +185,13 @@ endif endif -DSM_SCRIPTS_ += service-setup +DSM_SCRIPT_FILES += service-setup SERVICE_FILES += $(DSM_SCRIPTS_DIR)/service-setup # Control use of generic installer ifeq ($(strip $(INSTALLER_SCRIPT)),) -DSM_SCRIPTS_ += installer +DSM_SCRIPT_FILES += installer ifeq ($(call version_ge, ${TCVERSION}, 7.0),1) $(DSM_SCRIPTS_DIR)/installer: $(SPKSRC_MK)spksrc.service.installer.dsm7 @$(dsm_script_copy) @@ -204,7 +207,7 @@ endif # Control use of generic start-stop-status scripts ifeq ($(strip $(SSS_SCRIPT)),) -DSM_SCRIPTS_ += start-stop-status +DSM_SCRIPT_FILES += start-stop-status ifeq ($(STARTABLE),no) $(DSM_SCRIPTS_DIR)/start-stop-status: $(SPKSRC_MK)spksrc.service.non-startable @$(dsm_script_copy) diff --git a/mk/spksrc.spk.mk b/mk/spksrc.spk.mk index 69bd524899b..dc00e16a17e 100644 --- a/mk/spksrc.spk.mk +++ b/mk/spksrc.spk.mk @@ -1,3 +1,17 @@ +### Rules to create the spk package +# Most of the rules are imported from spksrc.*.mk files +# +# Variables used in this file: +# NAME: The internal name of the package. +# Note that all synocoummunity packages use lowercase names. +# This enables to have concurrent packages with synology.com, that use +# package names starting with upper case letters. +# (e.g. Mono => synology.com, mono => synocommunity.com) +# SPK_FILE_NAME: The full spk name with folder, package name, arch, tc- and package version. +# SPK_CONTENT: List of files and folders that are added to package.tgz within the spk file. +# DSM_SCRIPT_FILES: List of script files that are in the scripts folder within the spk file. +# + # Common makefiles include ../../mk/spksrc.common.mk include ../../mk/spksrc.directories.mk @@ -58,26 +72,26 @@ include ../../mk/spksrc.strip.mk DSM_SCRIPTS_DIR = $(WORK_DIR)/scripts # Generated scripts -DSM_SCRIPTS_ = preinst postinst -DSM_SCRIPTS_ += preuninst postuninst -DSM_SCRIPTS_ += preupgrade postupgrade +DSM_SCRIPT_FILES = preinst postinst +DSM_SCRIPT_FILES += preuninst postuninst +DSM_SCRIPT_FILES += preupgrade postupgrade # SPK specific scripts ifneq ($(strip $(SSS_SCRIPT)),) -DSM_SCRIPTS_ += start-stop-status +DSM_SCRIPT_FILES += start-stop-status $(DSM_SCRIPTS_DIR)/start-stop-status: $(SSS_SCRIPT) @$(dsm_script_copy) endif ifneq ($(strip $(INSTALLER_SCRIPT)),) -DSM_SCRIPTS_ += installer +DSM_SCRIPT_FILES += installer $(DSM_SCRIPTS_DIR)/installer: $(INSTALLER_SCRIPT) @$(dsm_script_copy) endif -DSM_SCRIPTS_ += $(notdir $(basename $(ADDITIONAL_SCRIPTS))) +DSM_SCRIPT_FILES += $(notdir $(basename $(ADDITIONAL_SCRIPTS))) SPK_CONTENT = package.tgz INFO scripts @@ -249,7 +263,7 @@ $(WORK_DIR)/package.tgz: icon service @[ -f $@ ] && rm $@ || true (cd $(STAGING_DIR) && tar cpzf $@ --owner=root --group=root *) -DSM_SCRIPTS = $(addprefix $(DSM_SCRIPTS_DIR)/,$(DSM_SCRIPTS_)) +DSM_SCRIPTS = $(addprefix $(DSM_SCRIPTS_DIR)/,$(DSM_SCRIPT_FILES)) define dsm_script_redirect $(create_target_dir)