From b9722a5f90ea7afeccf649bcb84668c236952d2f Mon Sep 17 00:00:00 2001 From: Mikhail Teterin Date: Fri, 27 Jul 2012 22:44:24 +0000 Subject: [PATCH] Add port of libutp -- a TCP-like networking API using UDP-transport. --- net/Makefile | 1 + net/libutp/Makefile | 31 +++++++++++++++++++++++++++++++ net/libutp/distinfo | 2 ++ net/libutp/files/BSDmakefile | 13 +++++++++++++ net/libutp/files/patch-utypes | 34 ++++++++++++++++++++++++++++++++++ net/libutp/pkg-descr | 12 ++++++++++++ net/libutp/pkg-plist | 7 +++++++ 7 files changed, 100 insertions(+) create mode 100644 net/libutp/Makefile create mode 100644 net/libutp/distinfo create mode 100644 net/libutp/files/BSDmakefile create mode 100644 net/libutp/files/patch-utypes create mode 100644 net/libutp/pkg-descr create mode 100644 net/libutp/pkg-plist diff --git a/net/Makefile b/net/Makefile index c6226ad22490..854225d1a411 100644 --- a/net/Makefile +++ b/net/Makefile @@ -347,6 +347,7 @@ SUBDIR += libtnl SUBDIR += libtrace SUBDIR += libunp + SUBDIR += libutp SUBDIR += libvncserver SUBDIR += liferea SUBDIR += linc diff --git a/net/libutp/Makefile b/net/libutp/Makefile new file mode 100644 index 000000000000..0139d4fd5a9c --- /dev/null +++ b/net/libutp/Makefile @@ -0,0 +1,31 @@ +# New ports collection makefile for: libutp +# Date created: July 26, 2012 +# Whom: Mikhail Teterin +# +# $FreeBSD$ +# + +PORTNAME= bittorrent-libutp +PORTVERSION= 0.20120526 +DISTVERSION= d4685a3 +CATEGORIES= net devel +MASTER_SITES= https://github.com/bittorrent/libutp/tarball/${DISTVERSION}/ + +MAINTAINER= mi@aldan.algebra.com +COMMENT= The uTorrent Transport Protocol library + +LICENSE= MIT + +USE_DOS2UNIX= yes +MAKEFILE= ${FILESDIR}/BSDmakefile +MAKE_JOBS_SAFE= yes +USE_LDCONFIG= yes +# GitHub will issue a 302 redirect, no way around that, so we +# have to allow fetch(1) to follow the redirect, which is normally +# prevented by the -A flag: +FETCH_ARGS= -Fpr + +pre-su-install: + ${MKDIR} ${PREFIX}/include/libutp + +.include diff --git a/net/libutp/distinfo b/net/libutp/distinfo new file mode 100644 index 000000000000..42a87285f583 --- /dev/null +++ b/net/libutp/distinfo @@ -0,0 +1,2 @@ +SHA256 (bittorrent-libutp-d4685a3.tar.gz) = 0b4096d3a03cd171743a6f1db37e4cb1d6c8ef27bbebbc21a3eb9ee93c37b37f +SIZE (bittorrent-libutp-d4685a3.tar.gz) = 70654 diff --git a/net/libutp/files/BSDmakefile b/net/libutp/files/BSDmakefile new file mode 100644 index 000000000000..5c3aa192af2c --- /dev/null +++ b/net/libutp/files/BSDmakefile @@ -0,0 +1,13 @@ +LIB= utp +SHLIB_MAJOR= 0 +SRCS= utp.cpp utp_utils.cpp + +CXXFLAGS+= -fno-exceptions -fno-rtti +CXXFLAGS+= -I${.CURDIR} -I${.CURDIR}/utp_config_lib -DPOSIX +CXXFLAGS+= -Wall + +INCLUDEDIR= ${PREFIX}/include/libutp +LIBDIR= ${PREFIX}/lib +INCS= utp.h utp_utils.h utypes.h + +.include diff --git a/net/libutp/files/patch-utypes b/net/libutp/files/patch-utypes new file mode 100644 index 000000000000..6d86afddb4ae --- /dev/null +++ b/net/libutp/files/patch-utypes @@ -0,0 +1,34 @@ +--- utypes.h 2012-05-26 22:02:05.000000000 -0400 ++++ utypes.h 2012-07-26 17:21:44.000000000 -0400 +@@ -2,13 +2,15 @@ + #define __UTYPES_H__ + ++#include ++ + // standard types +-typedef unsigned char byte; +-typedef unsigned char uint8; +-typedef signed char int8; +-typedef unsigned short uint16; +-typedef signed short int16; ++typedef uint8_t byte; ++typedef uint8_t uint8; ++typedef int8_t int8; ++typedef uint16_t uint16; ++typedef int16_t int16; + typedef unsigned int uint; +-typedef unsigned int uint32; +-typedef signed int int32; ++typedef uint32_t uint32; ++typedef int32_t int32; + + #ifdef _MSC_VER +@@ -16,6 +18,6 @@ + typedef signed __int64 int64; + #else +-typedef unsigned long long uint64; +-typedef long long int64; ++typedef uint64_t uint64; ++typedef int64_t int64; + #endif + diff --git a/net/libutp/pkg-descr b/net/libutp/pkg-descr new file mode 100644 index 000000000000..f7aeb17a2e67 --- /dev/null +++ b/net/libutp/pkg-descr @@ -0,0 +1,12 @@ +# libutp - The uTorrent Transport Protocol library. +Copyright (c) 2010 BitTorrent, Inc. + +uTP provides provides reliable, ordered delivery while maintaining +minimum extra delay. It is implemented on top of UDP to be +cross-platform and functional today. As a result, uTP is the primary +transport for uTorrent peer-to-peer connections. + +uTP is written in C++, but the external interface is strictly C +(ANSI C89). + +WWW: https://github.com/bittorrent/libutp diff --git a/net/libutp/pkg-plist b/net/libutp/pkg-plist new file mode 100644 index 000000000000..a7f198f12bd6 --- /dev/null +++ b/net/libutp/pkg-plist @@ -0,0 +1,7 @@ +lib/libutp.so.0 +lib/libutp.so +lib/libutp.a +include/libutp/utp.h +include/libutp/utp_utils.h +include/libutp/utypes.h +@dirrm include/libutp