Skip to content

Commit

Permalink
net-p2p/prowlarr: Disable built-in updater
Browse files Browse the repository at this point in the history
PR:	261339
Reported by:	[email protected] (maintainer)
  • Loading branch information
mvanbaak authored and Muhammad Moinur Rahman committed Jan 27, 2022
1 parent 6bd874f commit 0ab8512
Show file tree
Hide file tree
Showing 5 changed files with 748 additions and 736 deletions.
14 changes: 10 additions & 4 deletions net-p2p/prowlarr/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PORTNAME= prowlarr
PORTVERSION= 0.1.10.1375
PORTREVISION= 1
CATEGORIES= net-p2p
MASTER_SITES= https://github.com/Prowlarr/Prowlarr/releases/download/v${PORTVERSION}/
DISTNAME= Prowlarr.develop.${PORTVERSION}.freebsd-core-x64
Expand All @@ -23,9 +24,11 @@ USE_RC_SUBR= ${PORTNAME}

NO_BUILD= YES

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

Expand All @@ -37,8 +40,11 @@ WRKSRC= ${WRKDIR}/Prowlarr
.include <bsd.port.options.mk>

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

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

.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions net-p2p/prowlarr/files/package_info.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PackageVersion=%%PKGNAME%%
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
11 changes: 5 additions & 6 deletions net-p2p/prowlarr/files/pkg-message.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ This package installs a service file.
Enable it with "sysrc %%PORTNAME%%_enable=TRUE"
Start it with "service %%PORTNAME%% start".

The service file uses daemon to restart %%PORTNAME%% if it crashes.
The service file will also change the permissions so that the updater works.
If this behavior is unwanted you will need to edit the RC file manually and
remove the daemon and/or the permissions changes.

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, while the built-in updater will update %%PORTNAME%% it has side-effects:
Finally, the built-in updater is disabled.
If you like to use the updater, remove the file %%DATADIR%%/package_info 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
Expand Down
7 changes: 4 additions & 3 deletions net-p2p/prowlarr/files/prowlarr.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ load_rc_config $name
: ${%%PORTNAME%%_enable:=NO}
: ${%%PORTNAME%%_user:="%%USERS%%"}
: ${%%PORTNAME%%_group:="%%GROUPS%%"}
: ${%%PORTNAME%%_exec_dir:="%%DATADIR%%"}
: ${%%PORTNAME%%_exec_dir:="%%DATADIR%%/bin"}
: ${%%PORTNAME%%_data_dir:="%%PREFIX%%/%%PORTNAME%%"}
: ${%%PORTNAME%%_pid_dir:="/var/run/%%PORTNAME%%"}

Expand All @@ -40,6 +40,9 @@ start_precmd=${name}_precmd
install -d -o ${%%PORTNAME%%_user} -g ${%%PORTNAME%%_group} ${%%PORTNAME%%_pid_dir}
fi

# Needed for built-in updater
chown -R ${%%PORTNAME%%_user}:${%%PORTNAME%%_group} ${%%PORTNAME%%_exec_dir}

# .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
Expand All @@ -48,8 +51,6 @@ start_precmd=${name}_precmd
export DOTNET_SYSTEM_NET_DISABLEIPV6=1
fi

chown -R ${%%PORTNAME%%_user}:${%%PORTNAME%%_group} ${%%PORTNAME%%_exec_dir}

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

Expand Down
Loading

0 comments on commit 0ab8512

Please sign in to comment.