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

SickChill use a pypi based install - from 5431 #5449

Merged
merged 15 commits into from
Oct 18, 2022
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ toolkit/*/work*
local.mk
*.DS_Store
*~

# PyCharm project settings
.idea
3 changes: 0 additions & 3 deletions spk/sickchill/BROKEN

This file was deleted.

18 changes: 11 additions & 7 deletions spk/sickchill/Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
SPK_NAME = sickchill
SPK_VERS = 20211110
SPK_REV = 5
SPK_VERS = 20221013
SPK_REV = 6
SPK_ICON = src/sickchill.png

BUILD_DEPENDS = cross/python310
DEPENDS = cross/$(SPK_NAME)

SPK_DEPENDS = "python310"

# Required for lxml wheel
# [lxml]
DEPENDS += cross/libxml2
DEPENDS += cross/libxslt

# Required for PyNaCl
# [PyNaCl]
DEPENDS += cross/libsodium
ENV += SODIUM_INSTALL=system

# [cryptography]
ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/
ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/

WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt

MAINTAINER = miigotu
DESCRIPTION = Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
STARTABLE = yes
DISPLAY_NAME = SickChill
CHANGELOG = "1. Migration to Python 3.10<br/>2. SickChill environment fix<br/>3. Added DSM7 Support<br/>4. cryptography resolution for armv7"
CHANGELOG = "Switched to a wheel based install, as source and git installs are no longer supported by upstream."

HOMEPAGE = https://sickchill.github.io/
LICENSE = GPLv3+

SERVICE_USER = auto
SERVICE_USER = AUTO
BKSteve marked this conversation as resolved.
Show resolved Hide resolved
SERVICE_SETUP = src/service-setup.sh
SERVICE_PORT = 8081
SERVICE_PORT_TITLE = $(DISPLAY_NAME)
Expand Down
20 changes: 10 additions & 10 deletions spk/sickchill/src/requirements-crossenv.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cffi==1.15.0
cryptography==3.3.2
greenlet==1.1.2
lxml==4.6.4
MarkupSafe==2.0.1
msgpack==1.0.2
PyNaCl==1.4.0
SQLAlchemy==1.4.26
tornado==6.1
wrapt==1.13.3
cffi==1.15.1
cryptography==38.0.1
BKSteve marked this conversation as resolved.
Show resolved Hide resolved
greenlet==1.1.3.post0
lxml==4.9.1
MarkupSafe==2.1.1
msgpack==1.0.4
PyNaCl==1.5.0
SQLAlchemy==1.4.41
tornado==6.2
wrapt==1.14.1
120 changes: 59 additions & 61 deletions spk/sickchill/src/requirements-pure.txt
Original file line number Diff line number Diff line change
@@ -1,85 +1,83 @@
sickchill==2022.10.13

appdirs==1.4.4
babelfish==0.6.0
beautifulsoup4==4.10.0
beekeeper-alt==2021.7.16
beautifulsoup4==4.11.1
beekeeper-alt==2022.9.3
bencode.py==4.0.0
CacheControl==0.12.9
#certifi==2021.10.8 ==> python310:pure
chardet==4.0.0
charset-normalizer==2.0.7
click==8.0.3
cloudscraper==1.2.58
colorama==0.4.4
CacheControl==0.12.11
# certifi==2022.9.24 ==> python 3.10
# cffi==1.15.1 ==> crossenv
chardet==5.0.0
charset-normalizer==2.1.1
cinemagoer==2022.2.11
click==8.1.3
configobj==5.0.6
decorator==5.1.0
# cryptography==38.0.1 ==> crossenv
decorator==5.1.1
deluge-client==1.9.0
Deprecated==1.2.13
dogpile.cache==1.1.4
# distlib==0.3.6 ==> python 3.10
dogpile.cache==1.1.8
enzyme==0.4.1
feedparser==6.0.8
# filelock==3.8.0N ==> python 3.10
future==0.18.2
gntp==1.0.3
guessit==3.4.0
html5lib==1.1
httplib2==0.20.2
idna==3.3
ifaddr==0.1.7
imagesize==1.2.0
IMDbPY==2021.4.18
importlib-metadata==1.7.0
# greenlet==1.1.3.post0 ==> crossenv
guessit==3.4.3
idna==3.4
ifaddr==0.2.0
imagesize==1.4.1
IMDbPY==2022.7.9
ipaddress==1.0.23
Js2Py==0.71
jsonrpclib-pelix==0.4.3.1
kodipydent-alt==2021.7.16
Mako==1.1.5
markdown2==2.4.1
jsonrpclib-pelix==0.4.3.2
kodipydent-alt==2022.9.3
# lxml==4.9.1 ==> crossenv
Mako==1.2.3
markdown2==2.4.5
# MarkupSafe==2.1.1 ==> crossenv
# msgpack==1.0.4 ==> crossenv
new-rtorrent-python==1.0.1a0
oauthlib==3.1.1
packaging==20.9
pbr==5.7.0
poetry==1.2.0a2
poetry-core==1.1.0a6
poetry-date-version-plugin==2021.7.16-6
oauthlib==3.2.1
packaging==21.3
pbr==5.10.0
# platformdirs==2.5.2 ==> python 3.10
profilehooks==1.12.0
putio.py==8.7.0
pycparser==2.20
pyopenssl==21.0.0
pyaes==1.6.1
pygithub==1.55
pyjsparser==2.7.1
PyJWT==2.3.0
pymediainfo==5.1.0
pycparser==2.21
PyGithub==1.56
PyJWT==2.5.0
# PyNaCl==1.5.0 ==> crossenv
PyNMA==1.0
pyparsing==2.4.7
pysocks==1.7.1
pyOpenSSL==22.1.0
pyparsing==3.0.9
pysrt==1.1.2
python3-fanart==2.0.0
python-dateutil==2.8.2
python-slugify==5.0.2
python-slugify==6.1.2
python-twitter==3.5
pytz==2021.3
qbittorrent-api==2021.8.23
python3-fanart==2.0.0
pytz==2022.4
qbittorrent-api==2022.8.38
rarfile==4.0
rebulk==3.1.0
requests==2.26.0
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
send2trash==1.8.0
six==1.16.0
sgmllib3k==1.0.0
soupsieve==2.3
stevedore==3.5.0
requests==2.28.1
requests-oauthlib==1.3.1
Send2Trash==1.8.0
#six==1.16.0 ==> python 3.10
soupsieve==2.3.2.post1
# SQLAlchemy==1.4.41 ==> crossenv
stevedore==4.0.0
subliminal==2.1.0
text-unidecode==1.3
timeago==1.0.15
tmdbsimple==2.8.0
timeago==1.0.16
tmdbsimple==2.9.1
# tornado==6.2 ==> crossenv
tus.py==1.3.4
tvdbsimple==1.0.6
tzlocal==4.1
Unidecode==1.3.2
urllib3==1.26.7
validators==0.18.2
webencodings==0.5.1
Unidecode==1.3.6
urllib3==1.26.12
validators==0.20.0
# virtualenv==20.16.5 ==> python 3.10
win-inet-pton==1.1.0
xmltodict==0.12.0
zipp==3.6.0
# wrapt==1.14.1 ==> crossenv
xmltodict==0.13.0
44 changes: 11 additions & 33 deletions spk/sickchill/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,50 @@ PYTHON_DIR="/var/packages/python310/target/bin"
PATH="${SYNOPKG_PKGDEST}/env/bin:${SYNOPKG_PKGDEST}/bin:${PYTHON_DIR}:${PATH}"
HOME="${SYNOPKG_PKGVAR}"
PYTHON="${SYNOPKG_PKGDEST}/env/bin/python3"
SC_INSTALL_DIR="${SYNOPKG_PKGDEST}/share/SickChill"
SC_BINARY="${SC_INSTALL_DIR}/SickChill.py"
SC_BINARY="${SYNOPKG_PKGDEST}/env/bin/SickChill"
SC_DATA_DIR="${SYNOPKG_PKGVAR}/data"
SC_CFG_FILE="${SC_DATA_DIR}/config.ini"


GROUP="sc-download"

SERVICE_COMMAND="${PYTHON} ${SC_BINARY} --daemon --nolaunch --pidfile ${PID_FILE} --config ${SC_CFG_FILE} --datadir ${SC_DATA_DIR}"
SERVICE_COMMAND="${SC_BINARY} --daemon --nolaunch --pidfile ${PID_FILE} --config ${SC_CFG_FILE} --datadir ${SC_DATA_DIR}"
separator="-----------------------------------------------"

set_config() {
. ${SYNOPKG_PKGDEST}/share/git_data

if [ -f "${SC_CFG_FILE}" ]; then
if [ -n "${wizard_username}" ] && [ -n "${wizard_password}" ]; then
sed -i "/^\s*web_username\s*=/s/\s*=\s*.*/ = ${wizard_username}/" ${SC_CFG_FILE}
sed -i "/^\s*web_password\s*=/s/\s*=\s*.*/ = ${wizard_password}/" ${SC_CFG_FILE}
fi
# update git commit to sickchill updater
sed -i "/^\s*branch\s*=/s/\s*=\s*.*/ = ${SC_GIT_BRANCH}/" ${SC_CFG_FILE}
sed -i "/^\s*cur_commit_hash\s*=/s/\s*=\s*.*/ = ${SC_GIT_COMMIT_HASH}/" ${SC_CFG_FILE}
sed -i "/^\s*cur_commit_branch\s*=/s/\s*=\s*.*/ = ${SC_GIT_COMMIT_BRANCH}/" ${SC_CFG_FILE}
else
mkdir -p ${SC_DATA_DIR}
cat << EOF > ${SC_CFG_FILE}
[General]
web_username = ${wizard_username}
web_password = ${wizard_password}
branch = ${SC_GIT_BRANCH}
cur_commit_hash = ${SC_GIT_COMMIT_HASH}
cur_commit_branch = ${SC_GIT_COMMIT_BRANCH}
EOF
fi
}

service_postinst() {
# Create a Python virtualenv
echo ${separator}
install_python_virtualenv
# Install the wheels
install_python_wheels --extra-index-url https://wheel-index.linuxserver.io/ubuntu/

echo ${separator}
install_python_wheels

if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then
set_config
fi

if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ]; then
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${SYNOPKG_PKGDEST}"
fi
}

service_postupgrade() {
set_config
if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 7 ]; then
set_unix_permissions "${SYNOPKG_PKGDEST}"
fi
}

service_preupgrade ()
{
# We have to reset /env folder to 3.8 so remove entire folder as it gets rebuilt in postinst and this avoids any conflicts.
# Revision 1 was python 3.7. For cleaner update remove share and lib folders for clean install, leave user data /var.
if [ "${SYNOPKG_PKG_STATUS}" != "INSTALL" ] && [ "$(echo ${SYNOPKG_OLD_PKGVER} | sed -r 's/^.*-([0-9]+)$/\1/')" -le 1 ]; then
echo "Removing old ${SYNOPKG_PKGDEST}/env and /share for new Python 3.8 and old install"
rm -rf ${SYNOPKG_PKGDEST}/env
rm -rf ${SYNOPKG_PKGDEST}/share
rm -rf ${SYNOPKG_PKGDEST}/lib
if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -lt 7 ]; then
set_unix_permissions "${SYNOPKG_PKGDEST}"
fi
}
5 changes: 3 additions & 2 deletions spk/sickchill/src/wizard/install_uifile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"allowBlank": true
}
}]
},{
},
{
"type": "password",
"desc": "HTTP password (blank = no authentication)",
"subitems": [{
Expand All @@ -22,6 +23,6 @@
}]
},
{
"desc": "<p>The first time SickChill is started it might take a few moments for the interface to become available!</p><p>Permissions for all download-related packages are managed with the group <b>'sc-download'</b> in DSM.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details.</p>"
"desc": "<p>The first time SickChill is started it will take a few moments for the interface to become available!</p><p>Permissions for SickChill are user <b>'sc-sickchill'</b> all download-related packages are managed with the group <b>'sc-download (DSM6) and synocommunity (DSM7)'</b>.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details.</p>"
}]
}]
27 changes: 0 additions & 27 deletions spk/sickchill/src/wizard/install_uifile_spn

This file was deleted.

2 changes: 1 addition & 1 deletion spk/sickchill/src/wizard/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[{
"step_title": "Attention!",
"items": [{
"desc": "<p>The first time SickChill is started it might take a few moments for the interface to become available!</p><p>Permissions for all download-related packages are managed with the group <b>'sc-download'</b> in DSM.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details.</p>"
"desc": "<p>The first time SickChill is started it will take a few moments for the interface to become available!</p><p>Permissions for SickChill are user <b>'sc-sickchill'</b> all download-related packages are managed with the group <b>'sc-download (DSM6) and synocommunity (DSM7)'</b>.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details.</p>"
}]
}]
6 changes: 0 additions & 6 deletions spk/sickchill/src/wizard/upgrade_uifile_spn

This file was deleted.