From 52d7b3a13876a61ba8e37502b262028447f31ad8 Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Sat, 28 Feb 2004 12:56:51 +0000 Subject: Add libbt, a C implementation of core BitTorrent protocol. PR: ports/63404 Submitted by: Florent Thoumie --- net-p2p/libbt/Makefile | 41 ++++++++++++++++++++++++++++ net-p2p/libbt/distinfo | 2 ++ net-p2p/libbt/files/patch-include::bterror.h | 18 ++++++++++++ net-p2p/libbt/files/patch-src::Makefile.in | 19 +++++++++++++ net-p2p/libbt/files/patch-src::bitset.c | 12 ++++++++ net-p2p/libbt/files/patch-src::bterror.c | 13 +++++++++ net-p2p/libbt/files/patch-src::peer.c | 17 ++++++++++++ net-p2p/libbt/files/patch-src::stream.c | 16 +++++++++++ net-p2p/libbt/pkg-descr | 6 ++++ net-p2p/libbt/pkg-plist | 16 +++++++++++ 10 files changed, 160 insertions(+) create mode 100644 net-p2p/libbt/Makefile create mode 100644 net-p2p/libbt/distinfo create mode 100644 net-p2p/libbt/files/patch-include::bterror.h create mode 100644 net-p2p/libbt/files/patch-src::Makefile.in create mode 100644 net-p2p/libbt/files/patch-src::bitset.c create mode 100644 net-p2p/libbt/files/patch-src::bterror.c create mode 100644 net-p2p/libbt/files/patch-src::peer.c create mode 100644 net-p2p/libbt/files/patch-src::stream.c create mode 100644 net-p2p/libbt/pkg-descr create mode 100644 net-p2p/libbt/pkg-plist (limited to 'net-p2p') diff --git a/net-p2p/libbt/Makefile b/net-p2p/libbt/Makefile new file mode 100644 index 000000000000..714673129079 --- /dev/null +++ b/net-p2p/libbt/Makefile @@ -0,0 +1,41 @@ +# New ports collection makefile for: libbt +# Date created: Feb 26 2004 +# Whom: Florent Thoumie +# +# $FreeBSD$ +# + +PORTNAME= libbt +PORTVERSION= 0.02 +CATEGORIES= net devel +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} +EXTRACT_SUFX= .tgz + +MAINTAINER= flz@xbsd.org +COMMENT= C library implementing the core BitTorrent protocol + +LIB_DEPENDS= uuid.1:${PORTSDIR}/sysutils/e2fsprogs \ + curl.2:${PORTSDIR}/ftp/curl + +WRKSRC= ${WRKDIR}/${PORTNAME} + +GNU_CONFIGURE= yes + +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ + LDFLAGS="-L${LOCALBASE}/lib" + +do-install: + ${INSTALL_DATA} ${WRKSRC}/src/libbt.a ${PREFIX}/lib + ${MKDIR} ${PREFIX}/include/libbt +.for i in benc.h bitset.h bterror.h bts.h context.h peer.h random.h segmenter.h strbuf.h stream.h types.h util.h + ${INSTALL_DATA} ${WRKSRC}/include/${i} ${PREFIX}/include/libbt +.endfor + +post-install: +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_MAN} ${WRKSRC}/docs/protocol.txt ${DOCSDIR} +.endif + +.include diff --git a/net-p2p/libbt/distinfo b/net-p2p/libbt/distinfo new file mode 100644 index 000000000000..a7f9cb54c38d --- /dev/null +++ b/net-p2p/libbt/distinfo @@ -0,0 +1,2 @@ +MD5 (libbt-0.02.tgz) = a954666cb53b7a35f1793b531a6430bd +SIZE (libbt-0.02.tgz) = 333463 diff --git a/net-p2p/libbt/files/patch-include::bterror.h b/net-p2p/libbt/files/patch-include::bterror.h new file mode 100644 index 000000000000..1c63711ede3d --- /dev/null +++ b/net-p2p/libbt/files/patch-include::bterror.h @@ -0,0 +1,18 @@ +--- include/bterror.h.old Thu Feb 26 17:38:32 2004 ++++ include/bterror.h Thu Feb 26 17:38:53 2004 +@@ -15,15 +15,6 @@ + BTERR_LAST + }; + +-#ifdef BTERROR_BODY +-char *bterror_string[] = { +- "Bad protocol ID on peer connection", +- "Unrecognized Flags in peer protocol handshake", +- "Peer hash value doesn't match my hash value", +- "Peer disconnected after repeated errors" +-}; +-#else + extern char *bterror_string[]; +-#endif + + #endif diff --git a/net-p2p/libbt/files/patch-src::Makefile.in b/net-p2p/libbt/files/patch-src::Makefile.in new file mode 100644 index 000000000000..388c14074f76 --- /dev/null +++ b/net-p2p/libbt/files/patch-src::Makefile.in @@ -0,0 +1,19 @@ +--- src/Makefile.in.old Thu Feb 26 18:27:14 2004 ++++ src/Makefile.in Thu Feb 26 18:28:04 2004 +@@ -1,8 +1,8 @@ +-OBJS=benc.o bts.o types.o random.o strbuf.o stream.o peer.o segmenter.o util.o bitset.o context.o +-CFLAGS=-Wall -g -I../include ++OBJS=bterror.o benc.o bts.o types.o random.o strbuf.o stream.o peer.o segmenter.o util.o bitset.o context.o ++CFLAGS=@CFLAGS@ -Wall -I../include -I${PREFIX}/include + LIBS=@LIBS@ `curl-config --libs` + +-all: btlist btget btcheck ++all: libbt.a + btcheck: btcheck.c libbt.a + gcc ${CFLAGS} btcheck.c ${LIBS} -lbt -L. -o btcheck + +@@ -20,3 +20,4 @@ + + libbt.a: ${OBJS} + ar rc $@ ${OBJS} ++ ranlib libbt.a diff --git a/net-p2p/libbt/files/patch-src::bitset.c b/net-p2p/libbt/files/patch-src::bitset.c new file mode 100644 index 000000000000..3b616150dcd6 --- /dev/null +++ b/net-p2p/libbt/files/patch-src::bitset.c @@ -0,0 +1,12 @@ +--- src/bitset.c.old Thu Feb 26 15:21:52 2004 ++++ src/bitset.c Thu Feb 26 15:22:14 2004 +@@ -1,8 +1,6 @@ + #include "config.h" + +-#if HAVE_MALLOC_H +-#include +-#endif ++#include + #include + #include + #include "bitset.h" diff --git a/net-p2p/libbt/files/patch-src::bterror.c b/net-p2p/libbt/files/patch-src::bterror.c new file mode 100644 index 000000000000..bf255821bb74 --- /dev/null +++ b/net-p2p/libbt/files/patch-src::bterror.c @@ -0,0 +1,13 @@ +--- src/bterror.c.old Thu Feb 26 17:39:15 2004 ++++ src/bterror.c Thu Feb 26 17:39:54 2004 +@@ -1,3 +1,9 @@ + /* bterror.c */ +-#define BTERROR_BODY + #include "bterror.h" ++ ++char *bterror_string[] = { ++ "Bad protocol ID on peer connection", ++ "Unrecognized Flags in peer protocol handshake", ++ "Peer hash value doesn't match my hash value", ++ "Peer disconnected after repeated errors" ++}; diff --git a/net-p2p/libbt/files/patch-src::peer.c b/net-p2p/libbt/files/patch-src::peer.c new file mode 100644 index 000000000000..207e4fde9d7e --- /dev/null +++ b/net-p2p/libbt/files/patch-src::peer.c @@ -0,0 +1,17 @@ +--- src/peer.c.old Thu Feb 26 17:34:55 2004 ++++ src/peer.c Thu Feb 26 17:35:21 2004 +@@ -1,5 +1,6 @@ + #include "config.h" + ++#include + #if WIN32 + // #include + #else +@@ -13,7 +14,6 @@ + #include + #endif + #endif +-#include + #include + #include + #include diff --git a/net-p2p/libbt/files/patch-src::stream.c b/net-p2p/libbt/files/patch-src::stream.c new file mode 100644 index 000000000000..7397921d7a43 --- /dev/null +++ b/net-p2p/libbt/files/patch-src::stream.c @@ -0,0 +1,16 @@ +--- src/stream.c.old Thu Feb 26 17:34:48 2004 ++++ src/stream.c Thu Feb 26 17:35:11 2004 +@@ -1,4 +1,5 @@ + #include "config.h" ++#include + #include + #include + #include +@@ -14,7 +15,6 @@ + #include + #endif + #endif +-#include + #include "bterror.h" + #include "stream.h" + #undef DEBUG_STREAM diff --git a/net-p2p/libbt/pkg-descr b/net-p2p/libbt/pkg-descr new file mode 100644 index 000000000000..28aab005d572 --- /dev/null +++ b/net-p2p/libbt/pkg-descr @@ -0,0 +1,6 @@ +LIBBT is a C library implementing the core BitTorrent protocol. + +WWW: http://libbt.sourceforge.net/ + +- Florent Thoumie +flz@xbsd.org diff --git a/net-p2p/libbt/pkg-plist b/net-p2p/libbt/pkg-plist new file mode 100644 index 000000000000..5ed8658814e4 --- /dev/null +++ b/net-p2p/libbt/pkg-plist @@ -0,0 +1,16 @@ +include/libbt/benc.h +include/libbt/bitset.h +include/libbt/bterror.h +include/libbt/bts.h +include/libbt/context.h +include/libbt/peer.h +include/libbt/random.h +include/libbt/segmenter.h +include/libbt/strbuf.h +include/libbt/stream.h +include/libbt/types.h +include/libbt/util.h +lib/libbt.a +%%PORTDOCS%%%%DOCSDIR%%/protocol.txt +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm include/libbt -- cgit