mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-26 05:02:18 +00:00
- Fix build with clang
- Change BOINC_CLIENT_HOME ownership only for owner - Fixes to rc script - Allow for spaces in paths PR: ports/171569 Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Feature safe: yes
This commit is contained in:
parent
1b8c640de0
commit
36a24a0477
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=306088
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= boinc-client
|
||||
PORTVERSION= 7.0.28
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
||||
MASTER_SITE_SUBDIR= pav
|
||||
@ -14,7 +15,6 @@ MASTER_SITE_SUBDIR= pav
|
||||
MAINTAINER= pav@FreeBSD.org
|
||||
COMMENT= Berkeley Open Infrastructure for Network Computing client
|
||||
|
||||
USE_GCC= any
|
||||
USE_XZ= yes
|
||||
GNU_CONFIGURE= yes
|
||||
USE_LDCONFIG= yes
|
||||
@ -149,6 +149,11 @@ post-patch:
|
||||
@${REINPLACE_CMD} -e 's|@BUILD_GRAPHICS_API_TRUE@|#&|' ${WRKSRC}/api/Makefile.in
|
||||
.endif
|
||||
|
||||
pre-install:
|
||||
.if ${PORT_OPTIONS:MUSER}
|
||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
.if ${PORT_OPTIONS:MMANAGER}
|
||||
${MKDIR} ${PREFIX}/share/boinc
|
||||
@ -176,8 +181,5 @@ post-install:
|
||||
. endif
|
||||
${CP} -R ${WRKSRC}/api/txf ${PREFIX}/share/boinc
|
||||
.endif
|
||||
.if ${PORT_OPTIONS:MUSER}
|
||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
@ -6,52 +6,48 @@
|
||||
# REQUIRE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# Add the following line to /etc/rc.conf to enable the BOINC client:
|
||||
#
|
||||
# boinc_client_enable="YES"
|
||||
# Add the following lines to /etc/rc.conf to enable the BOINC client:
|
||||
#
|
||||
# boinc_client_enable (boolean) Set to "YES" to enable boinc_client
|
||||
# (default is "NO").
|
||||
# boinc_client_flags (string) Additional flags for boinc_client.
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="boinc-client"
|
||||
name="boinc_client"
|
||||
rcvar=boinc_client_enable
|
||||
|
||||
boinc_client_user=%%BOINC_CLIENT_USER%%
|
||||
boinc_client_home=%%BOINC_CLIENT_HOME%%
|
||||
boinc_client_flags="--daemon --dir ${boinc_client_home}"
|
||||
|
||||
active_file="/var/run/${name}.active"
|
||||
|
||||
load_rc_config $name
|
||||
load_rc_config ${name}
|
||||
: ${boinc_client_enable="NO"}
|
||||
|
||||
command="%%PREFIX%%/bin/boinc_client"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
|
||||
boinc_client_user=%%BOINC_CLIENT_USER%%
|
||||
command_args="--daemon --dir \"%%BOINC_CLIENT_HOME%%\""
|
||||
|
||||
start_cmd=boinc_client_start
|
||||
stop_cmd=boinc_client_stop
|
||||
stop_postcmd=boinc_client_poststop
|
||||
|
||||
boinc_client_start()
|
||||
{
|
||||
if checkyesno boinc_client_enable; then
|
||||
if [ -f ${active_file} ]; then
|
||||
echo 1>&2 "${name} already running?"
|
||||
return 1
|
||||
fi
|
||||
echo "Starting ${name}."
|
||||
idprio 31 su - ${boinc_client_user} -c \
|
||||
"%%PREFIX%%/bin/boinc_client ${boinc_client_flags}"
|
||||
touch ${active_file}
|
||||
fi
|
||||
}
|
||||
local pid
|
||||
|
||||
boinc_client_stop()
|
||||
{
|
||||
if [ ! -f ${active_file} ]; then
|
||||
echo 1>&2 "${name} is not running."
|
||||
pid=$(check_pidfile "${pidfile}" "${command}")
|
||||
if [ -n "${pid}" ]; then
|
||||
echo 1>&2 "${name} already running? (pid=${pid})."
|
||||
return 1
|
||||
fi
|
||||
echo "Stopping ${name}."
|
||||
su - ${boinc_client_user} -c \
|
||||
"cd ${boinc_client_home} && %%PREFIX%%/bin/boinccmd --quit"
|
||||
rm ${active_file}
|
||||
echo "Starting ${name}."
|
||||
idprio 31 su - ${boinc_client_user} -c \
|
||||
"\"${command}\" ${boinc_client_flags} ${command_args}" || return 1
|
||||
pgrep -U ${boinc_client_user} -n -t - '^boinc_client$' \
|
||||
> "${pidfile}" || return 1
|
||||
}
|
||||
|
||||
boinc_client_poststop()
|
||||
{
|
||||
rm -f "${pidfile}"
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
|
11
net/boinc-client/files/patch-zip-unzip-extract.c
Normal file
11
net/boinc-client/files/patch-zip-unzip-extract.c
Normal file
@ -0,0 +1,11 @@
|
||||
--- zip/unzip/extract.c.orig 2012-04-09 13:58:50.000000000 +0300
|
||||
+++ zip/unzip/extract.c 2012-09-12 14:05:07.000000000 +0300
|
||||
@@ -218,7 +218,7 @@
|
||||
static ZCONST char Far InvalidComprData[] = "invalid compressed data to ";
|
||||
static ZCONST char Far Inflate[] = "inflate_boinc";
|
||||
|
||||
-extern int inflate_boinc(__G__ is_defl64);
|
||||
+extern int inflate_boinc(__GPRO__ int is_defl64);
|
||||
|
||||
#ifndef SFX
|
||||
static ZCONST char Far Explode[] = "explode";
|
@ -1,36 +1,42 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD:$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
|
||||
|
||||
user=%%BOINC_CLIENT_USER%%
|
||||
group=%%BOINC_CLIENT_GROUP%%
|
||||
home=%%BOINC_CLIENT_HOME%%
|
||||
home="%%BOINC_CLIENT_HOME%%"
|
||||
shell=/bin/sh
|
||||
|
||||
case $2 in
|
||||
POST-INSTALL)
|
||||
if ! pw usershow ${user} >/dev/null 2>&1; then
|
||||
if ! pw useradd ${user} -g ${group} -c "BOINC client user" -d ${home} -s ${shell}; then
|
||||
err=$?
|
||||
echo "WARNING: Unable to create user ${user}. pw returned ${err}"
|
||||
echo "You will need to create a BOINC client user and"
|
||||
echo "chown the BOINC client user directory."
|
||||
exit ${err}
|
||||
PRE-INSTALL)
|
||||
if ! pw usershow ${user} 2>/dev/null 1>&2; then
|
||||
if ! pw useradd ${user} -g ${group} -c "BOINC client user" \
|
||||
-d "${home}" -s ${shell}; then
|
||||
echo "Failed to create user \"${user}\"." >&2
|
||||
exit 1
|
||||
else
|
||||
echo "User \"${user}\" created successfully:"
|
||||
fi
|
||||
else
|
||||
echo "BOINC client user created."
|
||||
echo "Using existent user \"${user}\":"
|
||||
fi
|
||||
else
|
||||
echo "BOINC client user found. Using found account."
|
||||
fi
|
||||
mkdir -p ${home}
|
||||
if [ ! -e ${home}/skins -a ! -L ${home}/skins ]; then
|
||||
ln -s %%PREFIX%%/share/boinc/skins ${home}/skins
|
||||
chown -h ${user}:${group} ${home}/skins
|
||||
fi
|
||||
if [ ! -e ${home}/ca-bundle.crt -a ! -L ${home}/ca-bundle.crt ]; then
|
||||
ln -s %%LOCALBASE%%/share/certs/ca-root-nss.crt ${home}/ca-bundle.crt
|
||||
chown -h ${user}:${group} ${home}/ca-bundle.crt
|
||||
fi
|
||||
chown ${user}:${group} ${home}
|
||||
;;
|
||||
pw usershow ${user}
|
||||
mkdir -m u=rwx,go= -p "${home}"
|
||||
if [ ! -e "${home}/skins" -a ! -L "${home}/skins" ]; then
|
||||
ln -s "%%PREFIX%%/share/boinc/skins" "${home}/skins"
|
||||
fi
|
||||
if [ ! -e "${home}/ca-bundle.crt" -a ! -L "${home}/ca-bundle.crt" ]; then
|
||||
ln -s "%%LOCALBASE%%/share/certs/ca-root-nss.crt" "${home}/ca-bundle.crt"
|
||||
fi
|
||||
echo "Adjusting file ownership in \"${home}\" to ${user}:${group}"
|
||||
chown -hR ${user}:${group} "${home}"
|
||||
;;
|
||||
*)
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@ -448,6 +448,6 @@ lib/libboinc_zip.so.7
|
||||
%%X11%%@dirrm share/boinc
|
||||
%%NLS%%@dirrmtry share/locale/sv_SE/LC_MESSAGES
|
||||
%%NLS%%@dirrmtry share/locale/sv_SE
|
||||
%%USER%%@unexec if [ -d %%BOINC_CLIENT_HOME%% ]; then echo "If you are deinstalling boinc-client completely, remove the %%BOINC_CLIENT_HOME%% directory."; fi
|
||||
%%USER%%@unexec if [ -d %%BOINC_CLIENT_HOME%% ]; then echo -n "Also, d"; else echo -n "D"; fi
|
||||
%%USER%%@unexec if [ -d "%%BOINC_CLIENT_HOME%%" ]; then echo "If you are deinstalling boinc-client completely, remove the \"%%BOINC_CLIENT_HOME%%\" directory."; fi
|
||||
%%USER%%@unexec if [ -d "%%BOINC_CLIENT_HOME%%" ]; then echo -n "Also, d"; else echo -n "D"; fi
|
||||
%%USER%%@unexec echo "on't forget to remove the BOINC client user \"%%BOINC_CLIENT_USER%%\"."
|
||||
|
Loading…
Reference in New Issue
Block a user