From 650b669bd2cd479cdd03ed8a527e2be6d0efa60f Mon Sep 17 00:00:00 2001 From: Edwin Groothuis Date: Wed, 15 Dec 2004 05:14:36 +0000 Subject: update port: net/boinc-client - fixes for FreeBSD 4.X and for 64-bit archs Update of boinc-client port to address issues with reentrancy problems on FreeBSD 4.x (malloc() called recursively) and also to address differences in rc.d files on 4.X. Update also fixes compilation problems on 64-bit architectures. PR: ports/75062 Submitted by: J.R. Oldroyd --- net/boinc-client/Makefile | 26 ++++++--- net/boinc-client/files/boinc.sh-4.x | 61 ++++++++++++++++++++++ .../files/extra-patch-api::boinc_api.C | 11 ++++ .../files/patch-client::gui_rpc_server.C | 17 ++++++ net/boinc-client/files/patch-client::net_xfer.C | 17 ++++++ 5 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 net/boinc-client/files/boinc.sh-4.x create mode 100644 net/boinc-client/files/extra-patch-api::boinc_api.C create mode 100644 net/boinc-client/files/patch-client::gui_rpc_server.C create mode 100644 net/boinc-client/files/patch-client::net_xfer.C (limited to 'net') diff --git a/net/boinc-client/Makefile b/net/boinc-client/Makefile index 6641b0377db2..3d29eba67f37 100644 --- a/net/boinc-client/Makefile +++ b/net/boinc-client/Makefile @@ -7,6 +7,7 @@ PORTNAME= boinc-client PORTVERSION= 4.13 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://boinc.berkeley.edu/source/nightly/ DISTNAME= boinc_public-cvs-2004-10-14 @@ -17,7 +18,7 @@ COMMENT= Berkeley Open Infrastructure for Network Computing client USE_REINPLACE= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-server -CONFIGURE_ENV= CPPFLAGS=-I/usr/X11R6/include CXXFLAGS=-I/usr/X11R6/include +CONFIGURE_ENV= CPPFLAGS=-I${X11BASE}/include CXXFLAGS=-I${X11BASE}/include WRKSRC= ${WRKDIR}/boinc_public PKGINSTALL= ${WRKDIR}/pkg-install @@ -25,7 +26,7 @@ PKGPLIST= ${WRKDIR}/pkg-plist MAN1= boinc-client.1 -FIND_BOINC_BINARY=(cd ${WRKDIR}/boinc_public/client; make -V CLIENT_BIN_FILENAME)) +FIND_BOINC_BINARY=(cd ${WRKDIR}/boinc_public/client; make -V CLIENT_BIN_FILENAME) BOINC_USER= boinc BOINC_GROUP= nobody @@ -34,8 +35,8 @@ BOINC_DATADIR= ${PREFIX}/boinc .include -.if ${ARCH} != "i386" -BROKEN= Does not compile on 64-bit architectures +.if ${OSVERSION} < 500000 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-api::boinc_api.C .endif post-patch: @@ -60,18 +61,29 @@ post-build: -e "s:%%BOINC_USER%%:${BOINC_USER}:g" \ -e "s:%%BOINC_GROUP%%:${BOINC_GROUP}:g" \ < ${FILESDIR}/boinc-client.1 > ${WRKDIR}/boinc-client.1; \ + ${SED} -e "s:%%BOINC_BINARY%%:$$BBIN:g" \ + -e "s:%%BOINC_DATADIR%%:${PREFIX}/boinc:g" \ + -e "s:%%BOINC_HOME%%:${BOINC_HOME}:g" \ + -e "s:%%BOINC_USER%%:${BOINC_USER}:g" \ + -e "s:%%BOINC_GROUP%%:${BOINC_GROUP}:g" \ + < ${PKGDIR}/pkg-install > ${WRKDIR}/pkg-install +.if ${OSVERSION} >= 500000 + BBIN=`${FIND_BOINC_BINARY}`; \ ${SED} -e "s:%%BOINC_BINARY%%:$$BBIN:g" \ -e "s:%%BOINC_DATADIR%%:${BOINC_DATADIR}:g" \ -e "s:%%BOINC_HOME%%:${BOINC_HOME}:g" \ -e "s:%%BOINC_USER%%:${BOINC_USER}:g" \ -e "s:%%BOINC_GROUP%%:${BOINC_GROUP}:g" \ < ${FILESDIR}/boinc.sh > ${WRKDIR}/boinc.sh +.else + BBIN=`${FIND_BOINC_BINARY}`; \ ${SED} -e "s:%%BOINC_BINARY%%:$$BBIN:g" \ - -e "s:%%BOINC_DATADIR%%:${PREFIX}/boinc:g" \ + -e "s:%%BOINC_DATADIR%%:${BOINC_DATADIR}:g" \ -e "s:%%BOINC_HOME%%:${BOINC_HOME}:g" \ -e "s:%%BOINC_USER%%:${BOINC_USER}:g" \ -e "s:%%BOINC_GROUP%%:${BOINC_GROUP}:g" \ - < ${PKGDIR}/pkg-install > ${WRKDIR}/pkg-install + < ${FILESDIR}/boinc.sh-4.x > ${WRKDIR}/boinc.sh +.endif do-install: ${INSTALL_SCRIPT} ${WRKDIR}/boinc-client ${PREFIX}/bin @@ -90,7 +102,7 @@ do-install: ${MKDIR} ${PREFIX}/boinc/projects ${MKDIR} ${PREFIX}/etc/rc.d ${INSTALL_SCRIPT} ${WRKDIR}/boinc.sh ${PREFIX}/etc/rc.d - ${CAT} pkg-message + ${CAT} ${PKGMESSAGE} post-install: ${REINPLACE_CMD} \ diff --git a/net/boinc-client/files/boinc.sh-4.x b/net/boinc-client/files/boinc.sh-4.x new file mode 100644 index 000000000000..82ada6fea9a3 --- /dev/null +++ b/net/boinc-client/files/boinc.sh-4.x @@ -0,0 +1,61 @@ +#!/bin/sh +# +# $FreeBSD: /tmp/pcvs/ports/net/boinc-client/files/Attic/boinc.sh-4.x,v 1.1 2004-12-15 05:14:36 edwin Exp $ +# +# Start or stop BOINC +# + +. /usr/local/etc/rc.subr + +name="boinc" +rcvar=`set_rcvar` + +boinc_user=%%BOINC_USER%% +boinc_home=%%BOINC_HOME%% +program_file=%%BOINC_BINARY%% +program_path=%%BOINC_DATADIR%%/client/${program_file} + +[ -z "$boinc_enable" ] && boinc_enable="NO" + +load_rc_config $name + +case "$1" in +start) + if checkyesno boinc_enable + then + if [ ! -x ${program_path} ] + then + logger -sp ${syslog_facility} -t ${program_file} \ + "unable to start: ${program_path} is missing." + exit 72 + fi + if ps axo ucomm | egrep ${program_file}; then + logger -sp ${syslog_facility} -t ${program_file} \ + "unable to start: ${program_file} is already running." + exit 72 + fi + echo -n "BOINC " + idprio 31 su - ${boinc_user} -c "${program_path} >/dev/null &" + fi + ;; + +stop) + program=`expr ${program_file} : '^\(................\).*$'` + killall ${program} 2> /dev/null + ;; + +restart) + $0 stop + $0 start + ;; + +status) + ps auxww | egrep ${program_file} | egrep -v "($0|egrep)" + ;; + +*) + echo "usage: ${name} {start|stop|restart|status}" >&2 + exit 64 + ;; +esac + diff --git a/net/boinc-client/files/extra-patch-api::boinc_api.C b/net/boinc-client/files/extra-patch-api::boinc_api.C new file mode 100644 index 000000000000..49f74d3977df --- /dev/null +++ b/net/boinc-client/files/extra-patch-api::boinc_api.C @@ -0,0 +1,11 @@ +--- api/boinc_api.C.orig Sun Sep 5 19:28:46 2004 ++++ api/boinc_api.C Thu Dec 9 10:22:30 2004 +@@ -116,7 +116,7 @@ + options.handle_trickle_ups = true; + options.handle_trickle_downs = true; + options.handle_process_control = true; +- options.send_status_msgs = true; ++ options.send_status_msgs = false; + options.direct_process_action = true; + return boinc_init_options(options); + } diff --git a/net/boinc-client/files/patch-client::gui_rpc_server.C b/net/boinc-client/files/patch-client::gui_rpc_server.C new file mode 100644 index 000000000000..ead91b71a12d --- /dev/null +++ b/net/boinc-client/files/patch-client::gui_rpc_server.C @@ -0,0 +1,17 @@ +--- client/gui_rpc_server.C.orig Mon Sep 27 15:07:29 2004 ++++ client/gui_rpc_server.C Thu Dec 2 20:59:58 2004 +@@ -47,12 +47,10 @@ + + #if defined(_WIN32) + typedef int socklen_t; +-#elif defined ( __APPLE__) ++#elif defined(__APPLE__) + typedef int32_t socklen_t; +-#elif !GETSOCKOPT_SOCKLEN_T +-#ifndef socklen_t ++#elif !defined(GETSOCKOPT_SOCKLEN_T) && !defined(_SOCKLEN_T_DECLARED) && !defined(socklen_t) + typedef size_t socklen_t; +-#endif + #endif + + static void boinc_close_socket(int sock) { diff --git a/net/boinc-client/files/patch-client::net_xfer.C b/net/boinc-client/files/patch-client::net_xfer.C new file mode 100644 index 000000000000..8d34dc5b2561 --- /dev/null +++ b/net/boinc-client/files/patch-client::net_xfer.C @@ -0,0 +1,17 @@ +--- client/net_xfer.C.orig Mon Sep 27 15:07:30 2004 ++++ client/net_xfer.C Thu Dec 2 21:00:11 2004 +@@ -78,12 +78,10 @@ + + #if defined(_WIN32) + typedef int socklen_t; +-#elif defined ( __APPLE__) ++#elif defined(__APPLE__) + typedef int32_t socklen_t; +-#elif !GETSOCKOPT_SOCKLEN_T +-#ifndef socklen_t ++#elif !defined(GETSOCKOPT_SOCKLEN_T) && !defined(_SOCKLEN_T_DECLARED) && !defined(socklen_t) + typedef size_t socklen_t; +-#endif + #endif + + using std::vector; -- cgit v1.2.3