Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deluge 2 upgrade to python 3.10 fix for DSM7 (follow-up #4153) #5398

Merged
merged 31 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ddb8f22
deluge: Import from PR #4153 with added changes
th0ma7 Aug 20, 2022
d6ffb2b
deluge: Add requirements specific to DSM6 vs DSM7
th0ma7 Aug 20, 2022
4222ac2
deluge: Remove support for c++0x
th0ma7 Aug 20, 2022
8e50be1
deluge: Align boost & libtorrent build options
th0ma7 Aug 22, 2022
87541c6
deluge: Missing common.mk for 32bit detection
th0ma7 Aug 22, 2022
b2fa147
deluge: Use master on original rencode source code
th0ma7 Aug 22, 2022
696f123
deluge: initial attempt for dual service startup
th0ma7 Aug 22, 2022
7bd6c4c
start-stop-status: Allow multiple daemon startup
th0ma7 Aug 22, 2022
fc33398
deluge: Fix rencode wheel building using abi3
th0ma7 Aug 22, 2022
f1a2efa
deluge: Re-order and misc cleanups
th0ma7 Aug 23, 2022
9b6c917
start-stop-status: Manage multi-daemons in non-background mode
th0ma7 Aug 23, 2022
28c130e
deluge: Add rencode requirement file as abi3 compatible
th0ma7 Aug 23, 2022
4381734
deluge: Enable multi-daemon in non-background mode
th0ma7 Aug 23, 2022
c9746f4
boost_1.78: Simplify re-using existing env variables
th0ma7 Aug 23, 2022
be6275c
deluge: permissions changes specific to version < DSM7 only
th0ma7 Aug 24, 2022
2bde393
start-stop-status: Fix counter management
th0ma7 Aug 24, 2022
dd2b3d0
deluge: Add french description
th0ma7 Aug 24, 2022
a7aefd9
deluge: Add precisions related to permissions DSM6 vs DSM7
th0ma7 Aug 24, 2022
5fa99a2
deluge: Fix DESCRIPTION field so it show properly in french
th0ma7 Aug 25, 2022
ebd1a89
deluge: Update wizard and service-setup.sh based on sabnzbd
th0ma7 Aug 27, 2022
c2b6d67
deluge: Update to latest version of core configuration file
th0ma7 Aug 27, 2022
baef9be
deluge: Add GeoIP wheel
th0ma7 Aug 27, 2022
18f0712
deluge: Refining install+upgrade scripts and wizard
th0ma7 Aug 27, 2022
2e4a82a
start-stop-status: Revert log keeping
th0ma7 Aug 27, 2022
a58d08d
deluge: Fix DSM6 upgrade
th0ma7 Aug 27, 2022
7098537
sabnzbd: Ensure group has write access to shared folder sub-dirs
th0ma7 Aug 28, 2022
7dda3d1
deluge: Do not migrate data as too prone to errors
th0ma7 Aug 28, 2022
e4e2722
installer.dsm6: Fix permission testing strings
th0ma7 Aug 28, 2022
06335fe
deluge: Optimize installation steps
th0ma7 Aug 29, 2022
84a1e13
sabnzbd: Use install vs mkdir to ensure group is properly set
th0ma7 Aug 29, 2022
1eebc07
sabnzbd: Forgot to specify group for DSM>=7 for isntall cmd
th0ma7 Aug 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions cross/boost_1.78/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ endif

include ../../mk/spksrc.common.mk

ifeq ($(call version_ge, $(call version_gcc), 7.5),1)
# fix compilation with newer compilers
ADDITIONAL_CXXFLAGS += -D_GLIBCXX_USE_C99_MATH -D_GLIBCXX_HAVE_OBSOLETE_ISNAN -D_GLIBCXX_HAVE_OBSOLETE_ISINF
endif

ifeq ($(findstring $(ARCH),$(64bit_ARCHS)),$(ARCH))
ADDRESS_MODEL = 64
else
Expand All @@ -60,6 +55,15 @@ endif

include ../../mk/spksrc.cross-cc.mk

ifeq ($(call version_ge, ${TC_GCC}, 7.5),1)
# fix compilation with newer compilers
ADDITIONAL_CXXFLAGS += -D_GLIBCXX_USE_C99_MATH
ADDITIONAL_CXXFLAGS += -D_GLIBCXX_HAVE_OBSOLETE_ISNAN
ADDITIONAL_CXXFLAGS += -D_GLIBCXX_HAVE_OBSOLETE_ISINF
else
ADDITIONAL_CXXFLAGS += -std=c++11
endif

.PHONY: boost_configure
boost_configure:
$(RUN) ./bootstrap.sh $(CONFIGURE_ARGS)
Expand All @@ -68,7 +72,7 @@ boost_configure:
boost_compile:
@# Recreate user-config.jam to include python-cc.mk on second run
@rm -rf $(WORK_DIR)/$(PKG_DIR)/user-config.jam
@echo "using gcc : `$(TC_PATH)$(TC_PREFIX)gcc -dumpversion` : $(TC_PATH)$(TC_PREFIX)g++ : <address-model>\"$(ADDRESS_MODEL)\" <cflags>\"$(CFLAGS)\" <cxxflags>\"$(CXXFLAGS)\" <linkflags>\"$(LDFLAGS)\" <link>\"shared\" ; " > $(WORK_DIR)/$(PKG_DIR)/user-config.jam
@echo "using gcc : ${TC_GCC} : ${CXX} : <address-model>\"$(ADDRESS_MODEL)\" <cflags>\"$(CFLAGS)\" <cxxflags>\"$(CXXFLAGS) $(ADDITIONAL_CXXFLAGS)\" <linkflags>\"$(LDFLAGS)\" <link>\"shared\" ; " > $(WORK_DIR)/$(PKG_DIR)/user-config.jam
ifneq ($(strip $(WITH_PYTHON)),)
@echo "using python : $(PYTHON_VERSION) : : $(STAGING_INSTALL_PREFIX)/$(PYTHON_INC_DIR) ;" >> $(WORK_DIR)/$(PKG_DIR)/user-config.jam
endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- boost/config/stdlib/libstdcpp3.hpp-orig 2021-12-02 06:47:31.000000000 +0000
+++ boost/config/stdlib/libstdcpp3.hpp 2022-06-19 20:47:46.528930819 +0000
@@ -334,7 +334,6 @@ extern "C" char *gets (char *__s);
// C++0x features in GCC 5.1 and later
//
#if (BOOST_LIBSTDCXX_VERSION < 50100) || !defined(BOOST_LIBSTDCXX11)
-# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
# define BOOST_NO_CXX11_STD_ALIGN
23 changes: 0 additions & 23 deletions cross/deluge/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion cross/deluge/PLIST

This file was deleted.

3 changes: 0 additions & 3 deletions cross/deluge/digests

This file was deleted.

47 changes: 0 additions & 47 deletions cross/libtorrent/Makefile

This file was deleted.

3 changes: 0 additions & 3 deletions cross/libtorrent/PLIST

This file was deleted.

3 changes: 0 additions & 3 deletions cross/libtorrent/digests

This file was deleted.

14 changes: 0 additions & 14 deletions cross/rencode/Makefile

This file was deleted.

Empty file removed cross/rencode/PLIST
Empty file.
3 changes: 0 additions & 3 deletions cross/rencode/digests

This file was deleted.

8 changes: 4 additions & 4 deletions mk/spksrc.service.installer.dsm6
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ set_syno_permissions ()
# Ensure directory resides in /volumeX before setting GROUP permissions
if [ "$(echo ${VOLUME} | cut -c2-7)" = "volume" ]; then
# Set read/write permissions for GROUP for folder and subfolders
if [ ! "$(synoacltool -get \"${DIRNAME}\"| grep \"group:${GROUP}:allow:rwxpdDaARWcC-:fd--\")" ]; then
if [ ! "$(synoacltool -get ""${DIRNAME}"" | grep ""group:${GROUP}:allow:rwxpdDaARWcC-:fd--"")" ]; then
# First Unix permissions, but only if it's in Linux mode
if [ "$(synoacltool -get \"${DIRNAME}\"| grep \"Linux mode\")" ]; then
if [ "$(synoacltool -get ""${DIRNAME}"" | grep -i 'Linux mode')" ]; then
set_unix_permissions "${DIRNAME}"
# If it is linux mode (due to old package) we need to add "administrators"-group,
# otherwise the folder is not accessible from File Station anymore!
Expand All @@ -156,9 +156,9 @@ set_syno_permissions ()

# Walk up the tree and set traverse execute permissions for GROUP up to VOLUME
while [ "${DIRNAME}" != "${VOLUME}" ]; do
if [ ! "$(synoacltool -get \"${DIRNAME}\"| grep \"group:${GROUP}:allow:r.x\")" ]; then
if [ ! "$(synoacltool -get ""${DIRNAME}"" | grep ""group:${GROUP}:allow:r.x"")" ]; then
# Here we also need to make sure the admin can access data via File Station
if [ "$(synoacltool -get \"${DIRNAME}\"| grep \"Linux mode\")" ]; then
if [ "$(synoacltool -get ""${DIRNAME}"" | grep -i 'Linux mode')" ]; then
synoacltool -add "${DIRNAME}" "group:administrators:allow:rwxpdDaARWc--:fd--"
fi
# Add the new group permissions
Expand Down
139 changes: 87 additions & 52 deletions mk/spksrc.service.start-stop-status
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ call_func ()

start_daemon ()
{
declare -i i=0
if [ -z "${SVC_QUIET}" ]; then
if [ -z "${SVC_KEEP_LOG}" ]; then
date > ${LOG_FILE}
Expand All @@ -37,95 +38,129 @@ start_daemon ()
fi
fi
call_func "service_prestart"
if [ -z "${SVC_QUIET}" ]; then
echo "Starting ${DNAME} command ${SERVICE_COMMAND} " >> ${LOG_FILE}
fi
if [ -n "${SERVICE_COMMAND}" ]; then
if [ -n "${SVC_NO_REDIRECT}" ]; then
OUT="/dev/null"
else
OUT="${LOG_FILE}"
for service in "${SERVICE_COMMAND[@]}"
do
let i=i+1
if [ -z "${SVC_QUIET}" ]; then
echo "Starting ${DNAME} command ${service}" >> ${LOG_FILE}
fi
if [ -n "${USER}" -a -n "${SYNOPKG_DSM_VERSION_MAJOR}" -a "$SYNOPKG_DSM_VERSION_MAJOR" -lt 6 ]; then
if [ -z "${SVC_CWD}" ]; then
SVC_CD=""
else
SVC_CD="cd ${SVC_CWD}; "
fi
if [ -n "${SYNOPKG_DSM_VERSION_MAJOR}" ] && [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
SU="su ${EFF_USER} -s"
if [ -n "${service}" ]; then
if [ -n "${SVC_NO_REDIRECT}" ]; then
OUT="/dev/null"
else
SU=""
fi
if [ -z "${SVC_BACKGROUND}" ]; then
$SU /bin/sh -c "${SVC_CD}${SERVICE_COMMAND}" >> ${OUT} 2>&1
else
$SU /bin/sh -c "${SVC_CD}${SERVICE_COMMAND}" >> ${OUT} 2>&1 &
OUT="${LOG_FILE}"
fi
if [ -n "${USER}" -a -n "${SYNOPKG_DSM_VERSION_MAJOR}" -a "$SYNOPKG_DSM_VERSION_MAJOR" -lt 6 ]; then
if [ -z "${SVC_CWD}" ]; then
SVC_CD=""
else
SVC_CD="cd ${SVC_CWD}; "
fi
if [ -n "${SYNOPKG_DSM_VERSION_MAJOR}" ] && [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
SU="su ${EFF_USER} -s"
else
SU=""
fi
if [ -z "${SVC_BACKGROUND}" ]; then
$SU /bin/sh -c "${SVC_CD}${service}" >> ${OUT} 2>&1
else
$SU /bin/sh -c "${SVC_CD}${service}" >> ${OUT} 2>&1 &
fi

else
# DSM 6 user is set by conf/privilege
if [ -n "${SVC_CWD}" ]; then
cd "${SVC_CWD}"
else
# DSM 6 user is set by conf/privilege
if [ -n "${SVC_CWD}" ]; then
cd "${SVC_CWD}"
fi
if [ -z "${SVC_BACKGROUND}" ]; then
${service} >> ${OUT} 2>&1
else
${service} >> ${OUT} 2>&1 &
fi
fi
if [ -z "${SVC_BACKGROUND}" ]; then
${SERVICE_COMMAND} >> ${OUT} 2>&1
if [ -n "${SVC_WRITE_PID}" -a -n "${SVC_BACKGROUND}" -a -n "${PID_FILE}" ]; then
[ $i -eq 1 ] && echo -ne "$!" > ${PID_FILE} || echo -ne " $!" >> ${PID_FILE}
else
${SERVICE_COMMAND} >> ${OUT} 2>&1 &
wait_for_status 0 ${SVC_WAIT_TIMEOUT:=20}
fi
fi
if [ -n "${SVC_WRITE_PID}" -a -n "${SVC_BACKGROUND}" -a -n "${PID_FILE}" ]; then
echo "$!" > "${PID_FILE}"
else
wait_for_status 0 ${SVC_WAIT_TIMEOUT}
fi
fi
done
}

stop_daemon ()
{
if [ -n "${PID_FILE}" -a -r "${PID_FILE}" ]; then
PID=$(cat "${PID_FILE}")
if [ -z "${SVC_QUIET}" ]; then
date >> ${LOG_FILE}
echo "Stopping ${DNAME} service ${PID} " >> ${LOG_FILE}
fi
kill -TERM $PID >> ${LOG_FILE} 2>&1
wait_for_status 1 ${SVC_WAIT_TIMEOUT} || kill -KILL $PID >> ${LOG_FILE} 2>&1
for pid in $(cat "${PID_FILE}")
do
if [ -z "${SVC_QUIET}" ]; then
date >> ${LOG_FILE}
echo "Stopping ${DNAME} service : $(ps -p${pid} -o comm=) (${pid})" >> ${LOG_FILE}
fi
kill -TERM ${pid} >> ${LOG_FILE} 2>&1
wait_for_status 1 ${SVC_WAIT_TIMEOUT:=20} ${pid} || kill -KILL ${pid} >> ${LOG_FILE} 2>&1
done
if [ -f "${PID_FILE}" ]; then
rm -f "${PID_FILE}" > /dev/null
fi
fi
call_func "service_poststop"
}

#------------------------------------------------------
# daemon_status()
# $1: PID to check, if empty use ${PID_FILE}
# status: Keeps track of kill -0 exit status
#
# Return 0 when all pid are OK, else return 1
#------------------------------------------------------
daemon_status ()
{

if [ -n "${PID_FILE}" -a -r "${PID_FILE}" ]; then
if kill -0 $(cat "${PID_FILE}") > /dev/null 2>&1; then
return
status=0
[ -z "${1}" ] && pid_list=$(cat ${PID_FILE} 2>/dev/null) || pid_list=${1}
if [ -n "${pid_list}" ]; then
for pid in ${pid_list}
do
kill -0 ${pid} > /dev/null 2>&1
let status=$status+$?
done
if [ $status -ne 0 ]; then
rm -f "${PID_FILE}" > /dev/null
return 1
else
return 0
fi
rm -f "${PID_FILE}" > /dev/null
else
return 1
fi
return 1
}

#------------------------------------------------------
# wait_for_status()
# $1: expected return from daemon_status() call
# $2: timeout (e.g. number of loop to be done)
# $3: PID to check being passed to daemon_status()
# counter: Number of 1sec iteration to wait until
# the return value from daemon_status()
# match expected value
#
# Wait for a duration of $counter seconds for the
# return value from daemon_status(). If it match
# return 0 else return 1 if wait time is over.
#------------------------------------------------------
wait_for_status ()
{
timeout=$2
# default value: 20 seconds
counter=${timeout:=20}
counter=${2}
counter=${counter:=20}
while [ ${counter} -gt 0 ]; do
daemon_status
daemon_status ${3}
[ $? -eq $1 ] && return
let counter=counter-1
sleep 1
done
return 1
}


case $1 in
start)
if daemon_status; then
Expand Down
2 changes: 0 additions & 2 deletions spk/deluge/BROKEN

This file was deleted.

Loading