Skip to content

Commit

Permalink
net-p2p/sonarr-devel: add new port
Browse files Browse the repository at this point in the history
Main updates to sonarr:
* Switched from mono to .NET
* Release profiles have been deleted in favour of Custom Formats
* Authentication is now mandatory to prevent open instances on the internet that leak access to indexers
* dark theme included by default

Changes:	https://wiki.servarr.com/sonarr/faq-v4
PR:		273898
  • Loading branch information
mvanbaak authored and driesmp committed Sep 29, 2023
1 parent d5d7269 commit 379a07b
Show file tree
Hide file tree
Showing 10 changed files with 677 additions and 2 deletions.
1 change: 0 additions & 1 deletion MOVED
Expand Up @@ -5681,7 +5681,6 @@ biology/py-fastTSNE|math/py-openTSNE|2021-03-13|project renamed/reimplemented un
misc/py-XlsxWriter|textproc/py-xlsxwriter|2021-03-13|Remove duplicate
emulators/open-vm-tools-nox11|emulators/open-vm-tools@nox11|2021-03-17|Moved to a flavored, generic, version
math/s2geometry|graphics/s2|2021-03-22|Remove duplicate port
net-p2p/sonarr-devel|net-p2p/sonarr|2021-03-23|Removed, use net-p2p/sonarr instead
www/py-django-jsonfield||2021-03-24|Removed: This port will be deleted in the future, please switch to use www/py-jsonfield or www/py-jsonfield2
devel/hs-c2hs||2021-03-27|Has expired: Was used as BUILD_DEPENDS, not useful on its own
x11-toolkits/tile||2021-03-27|Has expired: The Tile widget set is part of Tk 8.5 and above, see TIP 248
Expand Down
1 change: 1 addition & 0 deletions net-p2p/Makefile
Expand Up @@ -93,6 +93,7 @@
SUBDIR += rtorrent
SUBDIR += shx
SUBDIR += sonarr
SUBDIR += sonarr-devel
SUBDIR += tooth
SUBDIR += torrent-file-editor
SUBDIR += torrentcheck
Expand Down
58 changes: 58 additions & 0 deletions net-p2p/sonarr-devel/Makefile
@@ -0,0 +1,58 @@
PORTNAME= sonarr
DISTVERSION= 4.0.0.682
CATEGORIES= net-p2p
MASTER_SITES= https://download.sonarr.tv/v4/develop/${PORTVERSION}/
PKGNAMESUFFIX= -devel
DISTNAME= Sonarr.develop.${DISTVERSION}.freebsd-x64

MAINTAINER= michiel@vanbaak.eu
COMMENT= PVR for Usenet and BitTorrent users
WWW= https://sonarr.tv

LICENSE= GPLv3

ONLY_FOR_ARCHS= amd64

RUN_DEPENDS= ca_root_nss>0:security/ca_root_nss \
icu>0:devel/icu \
krb5>0:security/krb5 \
libiconv>0:converters/libiconv \
libinotify>0:devel/libinotify \
libunwind>0:devel/libunwind

USES= ssl:run sqlite:3

USE_RC_SUBR= sonarr

CONFLICTS_INSTALL= sonarr

NO_BUILD= YES

SUB_FILES= sonarr package_info pkg-message
SUB_LIST= DATADIR=${DATADIR} \
GROUPS=${GROUPS} \
MAINTAINER=${MAINTAINER} \
PKGVERSION=${PKGVERSION} \
PORTNAME=${PORTNAME} \
USERS=${USERS}

WRKSRC= ${WRKDIR}/Sonarr

USERS= sonarr
GROUPS= sonarr

.include <bsd.port.options.mk>

post-extract:
${RM} -rf ${WRKSRC}/Sonarr.Update

do-install:
${INSTALL} -d -m 755 ${STAGEDIR}/${DATADIR}/bin/
cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DATADIR}/bin/ "! -name Sonarr -and ! -name ffprobe"
${INSTALL_PROGRAM} ${WRKSRC}/Sonarr ${STAGEDIR}/${DATADIR}/bin/
${INSTALL_PROGRAM} ${WRKSRC}/ffprobe ${STAGEDIR}/${DATADIR}/bin/

post-install:
${INSTALL_DATA} ${WRKDIR}/package_info ${STAGEDIR}/${DATADIR}/

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions net-p2p/sonarr-devel/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1695559560
SHA256 (Sonarr.develop.4.0.0.682.freebsd-x64.tar.gz) = b018f52e76f90e77bced639ef1e2f6ca4a62d9199e6a4735e0a7485a3036e0a0
SIZE (Sonarr.develop.4.0.0.682.freebsd-x64.tar.gz) = 57728821
5 changes: 5 additions & 0 deletions net-p2p/sonarr-devel/files/package_info.in
@@ -0,0 +1,5 @@
PackageVersion=%%PKGVERSION%%
PackageAuthor=%%MAINTAINER%%
UpdateMethod=External
UpdateMethodMessage=use 'pkg upgrade' or [create a PR](https://bugs.freebsd.org/bugzilla/enter_bug.cgi?component=Individual%20Port%28s%29&product=Ports%20%26%20Packages) requesting an update of the port
Branch=develop
33 changes: 33 additions & 0 deletions net-p2p/sonarr-devel/files/pkg-message.in
@@ -0,0 +1,33 @@
[
{ type: install
message: <<EOM

%%PORTNAME%% relies on Microsoft dotNET5+ SDK to be built
Microsoft does not have an official version of dotNET for FreeBSD

This package was built with an UNOFFICIAL UNSUPPORTED version of dotNET
If this is something that you do not want, remove this package with
"pkg remove %%PORTNAME%%"

This package installs a service file.
Enable it with "sysrc %%PORTNAME%%_enable=TRUE"
Start it with "service %%PORTNAME%% start".

If you are running this in a jail please set "allow_mlock=1" or similar
for this jail otherwise the program will fail to start

Finally, the built-in updater is disabled.
If you like to use the updater, remove the file %%DATADIR%%/package_info,
chown the directory %%DATADIR%%/bin to %%USERS%% and restart %%PORTNAME%%
The built-in updater can now be configured in the Settings tab of %%PORTNAME%%

NOTE: While the built-in updater will update %%PORTNAME%% it has side-effects:
it breaks the ability of pkg to check for corruption in %%PORTNAME%% files
it breaks the ability of pkg to determine if it has removed files correctly
during "pkg remove %%PORTNAME%%" and also
it breaks the fundamental understanding that updates should be handled only
by the system that put the files there in the first place.

EOM
}
]
54 changes: 54 additions & 0 deletions net-p2p/sonarr-devel/files/sonarr.in
@@ -0,0 +1,54 @@
#!/bin/sh

# PROVIDE: %%PORTNAME%%
# REQUIRE: LOGIN network
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf or use sysrc to enable %%PORTNAME%%
# ${%%PORTNAME%%_enable="YES"}
# Optionaly there are some other parameters
# ${%%PORTNAME%%_user="%%USERS%%"}
# ${%%PORTNAME%%_group="%%GROUPS%%"}
# This stores %%PORTNAME%% data (e.g., databases, configs, logs)
# ${%%PORTNAME%%_data_dir="%%PREFIX%%/%%PORTNAME%%"}
# This stores the PID files that daemon will use
# ${%%PORTNAME%%_pid_dir:="/var/run/%%PORTNAME%%"}

. /etc/rc.subr
name=%%PORTNAME%%
rcvar=%%PORTNAME%%_enable
load_rc_config $name

: ${%%PORTNAME%%_enable:=NO}
: ${%%PORTNAME%%_user:="%%USERS%%"}
: ${%%PORTNAME%%_group:="%%GROUPS%%"}
: ${%%PORTNAME%%_exec_dir:="%%DATADIR%%/bin"}
: ${%%PORTNAME%%_data_dir:="%%PREFIX%%/%%PORTNAME%%"}
: ${%%PORTNAME%%_pid_dir:="/var/run/%%PORTNAME%%"}

pidfile="${%%PORTNAME%%_pid_dir}/${name}_daemon.pid"
pidfile_child="${%%PORTNAME%%_pid_dir}/${name}_child.pid"
command="/usr/sbin/daemon"


start_precmd=${name}_precmd
%%PORTNAME%%_precmd() {
if [ ! -d ${%%PORTNAME%%_data_dir} ]; then
install -d -o ${%%PORTNAME%%_user} -g ${%%PORTNAME%%_group} ${%%PORTNAME%%_data_dir}
fi
if [ ! -d ${%%PORTNAME%%_pid_dir} ]; then
install -d -o ${%%PORTNAME%%_user} -g ${%%PORTNAME%%_group} ${%%PORTNAME%%_pid_dir}
fi

# .NET 6+ use dual mode sockets to avoid the separate AF handling.
# disable .NET use of V6 if no ipv6 is configured.
# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259194#c17
ifconfig -a -u -G lo | grep -q inet6
if [ $? == 1 ]; then
export DOTNET_SYSTEM_NET_DISABLEIPV6=1
fi

rc_flags="-r -f -p ${pidfile_child} -P ${pidfile} ${%%PORTNAME%%_exec_dir}/Sonarr --data=${%%PORTNAME%%_data_dir} --nobrowser >> /dev/null 2>&1 ${rc_flags}"
}

run_rc_command "$1"
1 change: 1 addition & 0 deletions net-p2p/sonarr-devel/pkg-descr
@@ -0,0 +1 @@
Sonarr is a PVR for Usenet and BitTorrent users.

0 comments on commit 379a07b

Please sign in to comment.