Skip to content

Commit

Permalink
fix resource linker for dsm6 (#4592)
Browse files Browse the repository at this point in the history
- fixes #4578 for packages without specific conf files
  • Loading branch information
hgy59 authored Apr 30, 2021
1 parent 35e4364 commit 55fed2a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
9 changes: 6 additions & 3 deletions mk/spksrc.service.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down
28 changes: 21 additions & 7 deletions mk/spksrc.spk.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 55fed2a

Please sign in to comment.