Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2004 00:29:44 +0200 (CEST)
From:      Florent Thoumie <flz@xbsd.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/73139: Update port: net/bnbt - update to version 8.1b3
Message-ID:  <20041025222944.0423E196@gw.xbsd.org>
Resent-Message-ID: <200410252230.i9PMUM0N058874@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         73139
>Category:       ports
>Synopsis:       Update port: net/bnbt - update to version 8.1b3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 25 22:30:22 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Florent Thoumie
>Release:        FreeBSD 4.9-RC i386
>Organization:
Xbsd.org
>Environment:
System: FreeBSD gw 4.9-RC FreeBSD 4.9-RC #4: Sun Oct 5 14:25:09 CEST 2003 rf@gw:/usr/src/sys/compile/GW i386

>Description:

Update to version 8.1b3.

Add WITH_MYSQL knob.

>How-To-Repeat:

N/A

>Fix:

--- bnbt.diff begins here ---
diff -ruN bnbt/Makefile bnbt.new/Makefile
--- bnbt/Makefile	Sun Jun 27 14:07:25 2004
+++ bnbt.new/Makefile	Mon Oct 25 20:34:45 2004
@@ -6,33 +6,62 @@
 #
 
 PORTNAME=	bnbt
-PORTVERSION=	7.7b3
+PORTVERSION=	8.1b3
 CATEGORIES=	net
 MASTER_SITES=	http://bnbt.go-dedicated.com/
-DISTNAME=	bnbt77b-3
+DISTNAME=	bnbt81b-3
 
 MAINTAINER=	flz@xbsd.org
 COMMENT=	A C++ BitTorrent Tracker
 
 USE_ZIP=	yes
 WRKSRC=		${WRKDIR}/${PORTNAME}/src
+PKGMESSAGE=	${WRKDIR}/pkg-message
 
 USE_GMAKE=	yes
 USE_REINPLACE=	yes
+USE_RC_SUBR=	yes
+
+SED_SCRIPT=	-e 's,%%PREFIX%%,${PREFIX},g' \
+		-e 's,%%RC_SUBR%%,${RC_SUBR},g'
 
 PLIST_FILES=	bin/bnbt
 PORTDOCS=	footer.html header.html lesser.txt readme.txt users.txt
 
+.if defined(WITH_MYSQL)
+ALL_TARGET=	bnbtmysql
+PKGNAMESUFFIX=	-mysql
+USE_MYSQL=	yes
+.else
+ALL_TARGET=	bnbt
+.endif
+
+.include <bsd.port.pre.mk>
+
 post-patch:
-	@${REINPLACE_CMD} -e 's|-O2 -w|${CFLAGS}| ; \
-		s|LFLAGS = -pthread|LFLAGS = ${PTHREAD_LIBS}| ; \
-		s|CFLAGS = -pthread|CFLAGS = ${PTHREAD_CFLAGS}|' ${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -e 's|-O2|${CFLAGS} -I${PREFIX}/include| ; \
+		s|LFLAGS =|LFLAGS = -L${PREFIX}/lib/mysql|' ${WRKSRC}/Makefile
+	@${REINPLACE_CMD} -e 's|\([a-z]*\.bnbt\)|${PREFIX}/etc/${PORTNAME}/\1|' \
+		${WRKSRC}/config.cpp
+	@${REINPLACE_CMD} -e 's|bnbt.cfg|${PREFIX}/etc/${PORTNAME}/bnbt.cfg|' \
+		${WRKSRC}/config.h ${WRKSRC}/config.cpp ${WRKSRC}/tracker.cpp
+
+post-build:
+	@${SED} ${SED_SCRIPT} ${FILESDIR}/bnbt.sh > ${WRKDIR}/bnbt.sh
+	@${SED} ${SED_SCRIPT} ${FILESDIR}/pkg-message > ${WRKDIR}/pkg-message
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/bnbt ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/${ALL_TARGET} ${PREFIX}/bin/bnbt
+	${MKDIR} ${PREFIX}/etc/${PORTNAME}
 	${MKDIR} ${DOCSDIR}
 .for i in ${PORTDOCS}
 	${INSTALL_DATA} ${WRKDIR}/${PORTNAME}/$i ${DOCSDIR}
 .endfor
 
-.include <bsd.port.mk>
+post-install:
+	@${INSTALL_SCRIPT} ${WRKDIR}/bnbt.sh ${PREFIX}/etc/rc.d/bnbt.sh
+	@${ECHO_CMD} "etc/rc.d/bnbt.sh" >> ${TMPPLIST}
+	@${MKDIR} /var/log/${PORTNAME}
+	@${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff -ruN bnbt/distinfo bnbt.new/distinfo
--- bnbt/distinfo	Sun Jun 27 14:07:25 2004
+++ bnbt.new/distinfo	Sat Oct 23 11:08:15 2004
@@ -1,2 +1,2 @@
-MD5 (bnbt77b-3.zip) = 294489bf1d33f6e5327e6295cb5fe8c3
-SIZE (bnbt77b-3.zip) = 1111145
+MD5 (bnbt81b-3.zip) = 2935ffe0f51090a79d5bd76566af3b2b
+SIZE (bnbt81b-3.zip) = 741026
diff -ruN bnbt/files/bnbt.sh bnbt.new/files/bnbt.sh
--- bnbt/files/bnbt.sh	Thu Jan  1 00:00:00 1970
+++ bnbt.new/files/bnbt.sh	Sat Oct 23 15:20:18 2004
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: bnbt
+# REQUIRE: LOGIN abi
+# BEFORE:  securelevel
+# KEYWORD: FreeBSD shutdown
+
+# Add the following line to /etc/rc.conf to enable `bnbt':
+#
+#bnbt_enable="YES"
+#
+# See bnbt(1) for bnbt_flags
+#
+
+. "%%RC_SUBR%%"
+
+name="bnbt"
+rcvar=`set_rcvar`
+
+# path to your executable, might be libxec, bin, sbin, ...
+command="%%PREFIX%%/bin/$name"
+
+# extra required arguments
+command_args="&"
+
+# you can check for required_dirs and required_vars too, see rc.subr(8)
+#
+required_dirs="/var/log/$name"
+
+# read settings, set default values
+load_rc_config "$name"
+: ${bnbt_enable="NO"}
+: ${bnbt_flags=""}
+
+run_rc_command "$1"
diff -ruN bnbt/files/patch-client.cpp bnbt.new/files/patch-client.cpp
--- bnbt/files/patch-client.cpp	Thu Jan  1 00:00:00 1970
+++ bnbt.new/files/patch-client.cpp	Sat Oct 23 15:41:03 2004
@@ -0,0 +1,17 @@
+--- client.cpp	Wed Sep 29 21:38:32 2004
++++ client.cpp.new	Sat Oct 23 15:40:05 2004
+@@ -19,6 +19,7 @@
+ *
+ ***/
+ 
++#include <sys/time.h>
+ #include <fcntl.h>
+ 
+ #include "bnbt.h"
+@@ -639,4 +640,4 @@
+ 	rsp.strContent.reserve( 1024 );
+ 	rsp.bCompressOK = true;
+ 	m_iLast = GetTime( );
+-}
+\ No newline at end of file
++}
diff -ruN bnbt/files/patch-config.cpp bnbt.new/files/patch-config.cpp
--- bnbt/files/patch-config.cpp	Thu Jan  1 00:00:00 1970
+++ bnbt.new/files/patch-config.cpp	Sat Oct 23 14:54:49 2004
@@ -0,0 +1,15 @@
+--- config.cpp	Fri Sep 24 20:01:58 2004
++++ config.cpp.new	Sat Oct 23 14:42:45 2004
+@@ -147,10 +147,10 @@
+ 		CFG_SetString( "bnbt_realm", "BNBT" );
+ 
+ 	if( CFG_GetString( "bnbt_error_log_dir", string( ) ).empty( ) )
+-		CFG_SetString( "bnbt_error_log_dir", string( ) );
++		CFG_SetString( "bnbt_error_log_dir", "/var/log/bnbt/" );
+ 
+ 	if( CFG_GetString( "bnbt_access_log_dir", string( ) ).empty( ) )
+-		CFG_SetString( "bnbt_access_log_dir", string( ) );
++		CFG_SetString( "bnbt_access_log_dir", "/var/log/bnbt/" );
+ 
+ 	if( CFG_GetInt( "bnbt_flush_interval", 0 ) < 1 )
+ 		CFG_SetInt( "bnbt_flush_interval", 100 );
diff -ruN bnbt/files/patch-server.cpp bnbt.new/files/patch-server.cpp
--- bnbt/files/patch-server.cpp	Thu Jan  1 00:00:00 1970
+++ bnbt.new/files/patch-server.cpp	Sat Oct 23 15:42:40 2004
@@ -0,0 +1,11 @@
+--- server.cpp	Fri Sep 10 14:43:24 2004
++++ server.cpp.new	Sat Oct 23 15:40:21 2004
+@@ -19,6 +19,8 @@
+ *
+ ***/
+ 
++#include <sys/time.h>
++
+ #include "bnbt.h"
+ #include "client.h"
+ #include "config.h"
diff -ruN bnbt/files/pkg-message bnbt.new/files/pkg-message
--- bnbt/files/pkg-message	Thu Jan  1 00:00:00 1970
+++ bnbt.new/files/pkg-message	Sat Oct 23 13:50:32 2004
@@ -0,0 +1,12 @@
+************************************************************
+
+Bnbt has been successfully installed.
+
+In order to run bnbt, add the following lines to /etc/rc.conf:
+  bnbt_enable="YES"
+
+Then start the server with
+  %%PREFIX%%/etc/rc.d/bnbt.sh start
+or reboot.
+
+************************************************************
--- bnbt.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041025222944.0423E196>