aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2004-10-28 05:43:46 +0800
committerpav <pav@FreeBSD.org>2004-10-28 05:43:46 +0800
commit02911733a29287ec2e8bf2bfaa291592fea347e7 (patch)
treede75b74263360e2ebf803c67462443b8109f6c63 /net
parentc392117d3349e94aa35021ae6d64be1aa71f5c6f (diff)
downloadfreebsd-ports-graphics-02911733a29287ec2e8bf2bfaa291592fea347e7.tar.gz
freebsd-ports-graphics-02911733a29287ec2e8bf2bfaa291592fea347e7.tar.zst
freebsd-ports-graphics-02911733a29287ec2e8bf2bfaa291592fea347e7.zip
- Update to 8.1b3
- Add WITH_MYSQL knob - Introduce rcng script PR: ports/73139 Submitted by: Florent Thoumie <flz@xbsd.org> (maintainer)
Diffstat (limited to 'net')
-rw-r--r--net/bnbt/Makefile43
-rw-r--r--net/bnbt/distinfo4
-rw-r--r--net/bnbt/files/bnbt.sh38
-rw-r--r--net/bnbt/files/patch-client.cpp17
-rw-r--r--net/bnbt/files/patch-config.cpp15
-rw-r--r--net/bnbt/files/patch-server.cpp11
-rw-r--r--net/bnbt/files/pkg-message.in12
7 files changed, 131 insertions, 9 deletions
diff --git a/net/bnbt/Makefile b/net/bnbt/Makefile
index 4f0a29095f7..f3a9f3a28c3 100644
--- a/net/bnbt/Makefile
+++ b/net/bnbt/Makefile
@@ -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.in > ${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 --git a/net/bnbt/distinfo b/net/bnbt/distinfo
index 0471ee36321..e6c771dde97 100644
--- a/net/bnbt/distinfo
+++ b/net/bnbt/distinfo
@@ -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 --git a/net/bnbt/files/bnbt.sh b/net/bnbt/files/bnbt.sh
new file mode 100644
index 00000000000..d9f67bb8fee
--- /dev/null
+++ b/net/bnbt/files/bnbt.sh
@@ -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 --git a/net/bnbt/files/patch-client.cpp b/net/bnbt/files/patch-client.cpp
new file mode 100644
index 00000000000..da622fab52d
--- /dev/null
+++ b/net/bnbt/files/patch-client.cpp
@@ -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 --git a/net/bnbt/files/patch-config.cpp b/net/bnbt/files/patch-config.cpp
new file mode 100644
index 00000000000..f9a3636c1bb
--- /dev/null
+++ b/net/bnbt/files/patch-config.cpp
@@ -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 --git a/net/bnbt/files/patch-server.cpp b/net/bnbt/files/patch-server.cpp
new file mode 100644
index 00000000000..856ac603c77
--- /dev/null
+++ b/net/bnbt/files/patch-server.cpp
@@ -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 --git a/net/bnbt/files/pkg-message.in b/net/bnbt/files/pkg-message.in
new file mode 100644
index 00000000000..b13bde3da32
--- /dev/null
+++ b/net/bnbt/files/pkg-message.in
@@ -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.
+
+************************************************************