aboutsummaryrefslogtreecommitdiff
path: root/devel/jech-dht
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2012-07-28 20:48:23 +0000
committerMikhail Teterin <mi@FreeBSD.org>2012-07-28 20:48:23 +0000
commit4c41dd25d1b9625593b6535ab0168b3d482609da (patch)
treed07fcfacd289629bf14ff3b8e443141553d71bbb /devel/jech-dht
parent3dd9f499874b9ae5bd75883fc2f756f4f5e5b610 (diff)
downloadports-4c41dd25d1b9625593b6535ab0168b3d482609da.tar.gz
ports-4c41dd25d1b9625593b6535ab0168b3d482609da.zip
Notes
Diffstat (limited to 'devel/jech-dht')
-rw-r--r--devel/jech-dht/Makefile25
-rw-r--r--devel/jech-dht/distinfo2
-rw-r--r--devel/jech-dht/files/BSDmakefile14
-rw-r--r--devel/jech-dht/files/patch-warns121
-rw-r--r--devel/jech-dht/pkg-descr6
-rw-r--r--devel/jech-dht/pkg-plist5
6 files changed, 173 insertions, 0 deletions
diff --git a/devel/jech-dht/Makefile b/devel/jech-dht/Makefile
new file mode 100644
index 000000000000..134173adaed9
--- /dev/null
+++ b/devel/jech-dht/Makefile
@@ -0,0 +1,25 @@
+# New ports collection makefile for: jech-dht
+# Date created: July 28, 2012
+# Whom: Mikhail Teterin <mi@aldan.algebra.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= dht
+PORTVERSION= 0.21
+CATEGORIES= net devel
+MASTER_SITES= http://www.pps.univ-paris-diderot.fr/~jch/software/files/
+
+MAINTAINER= mi@aldan.algebra.com
+COMMENT= Mainline variant of Kademlia Distributed Hash Table (DHT)
+
+LICENSE= MIT
+
+MAKEFILE= ${FILESDIR}/BSDmakefile
+MAKE_JOBS_SAFE= yes
+USE_LDCONFIG= yes
+
+pre-su-install:
+ ${MKDIR} ${PREFIX}/include/dht
+
+.include <bsd.port.mk>
diff --git a/devel/jech-dht/distinfo b/devel/jech-dht/distinfo
new file mode 100644
index 000000000000..87d93eb60992
--- /dev/null
+++ b/devel/jech-dht/distinfo
@@ -0,0 +1,2 @@
+SHA256 (dht-0.21.tar.gz) = edf8fd9bf6225bbced38a74bb40592d46876fdfb74e9ebddecbdc1e805bdf44f
+SIZE (dht-0.21.tar.gz) = 27578
diff --git a/devel/jech-dht/files/BSDmakefile b/devel/jech-dht/files/BSDmakefile
new file mode 100644
index 000000000000..8ec2782c5070
--- /dev/null
+++ b/devel/jech-dht/files/BSDmakefile
@@ -0,0 +1,14 @@
+LIB= dht
+SHLIB_MAJOR= 0
+SHLIB_MINOR= 21
+
+SRCS= dht.c
+
+CFLAGS+=-DHAVE_MEMMEM
+WARNS= 3
+
+INCS= dht.h
+INCLUDEDIR=${PREFIX}/include/dht
+LIBDIR= ${PREFIX}/lib
+
+.include <bsd.lib.mk>
diff --git a/devel/jech-dht/files/patch-warns b/devel/jech-dht/files/patch-warns
new file mode 100644
index 000000000000..a2a8c2c737b1
--- /dev/null
+++ b/devel/jech-dht/files/patch-warns
@@ -0,0 +1,121 @@
+--- dht.c 2011-07-25 17:59:36.000000000 -0400
++++ dht.c 2012-07-28 16:21:07.000000000 -0400
+@@ -356,5 +356,5 @@
+ switch(sa->sa_family) {
+ case AF_INET: {
+- struct sockaddr_in *sin = (struct sockaddr_in*)sa;
++ const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
+ const unsigned char *address = (const unsigned char*)&sin->sin_addr;
+ return sin->sin_port == 0 ||
+@@ -364,5 +364,5 @@
+ }
+ case AF_INET6: {
+- struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
++ const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
+ const unsigned char *address = (const unsigned char*)&sin6->sin6_addr;
+ return sin6->sin6_port == 0 ||
+@@ -687,5 +687,5 @@
+ int i;
+
+- if(salen > sizeof(struct sockaddr_storage))
++ if((unsigned)salen > sizeof(struct sockaddr_storage))
+ abort();
+
+@@ -1281,13 +1281,13 @@
+ int i, len;
+ struct storage *st;
+- unsigned char *ip;
++ const unsigned char *ip;
+
+ if(sa->sa_family == AF_INET) {
+- struct sockaddr_in *sin = (struct sockaddr_in*)sa;
+- ip = (unsigned char*)&sin->sin_addr;
++ const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
++ ip = (const unsigned char*)&sin->sin_addr;
+ len = 4;
+ } else if(sa->sa_family == AF_INET6) {
+- struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
+- ip = (unsigned char*)&sin6->sin6_addr;
++ const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
++ ip = (const unsigned char*)&sin6->sin6_addr;
+ len = 16;
+ } else {
+@@ -1406,15 +1406,15 @@
+ make_token(const struct sockaddr *sa, int old, unsigned char *token_return)
+ {
+- void *ip;
++ const void *ip;
+ int iplen;
+ unsigned short port;
+
+ if(sa->sa_family == AF_INET) {
+- struct sockaddr_in *sin = (struct sockaddr_in*)sa;
++ const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
+ ip = &sin->sin_addr;
+ iplen = 4;
+ port = htons(sin->sin_port);
+ } else if(sa->sa_family == AF_INET6) {
+- struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
++ const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
+ ip = &sin6->sin6_addr;
+ iplen = 16;
+@@ -1892,5 +1892,5 @@
+ }
+
+- if(((char*)buf)[buflen] != '\0') {
++ if(((const char*)buf)[buflen] != '\0') {
+ debugf("Unterminated message.\n");
+ errno = EINVAL;
+@@ -2743,5 +2743,5 @@
+
+ #define CHECK(ptr, len) \
+- if(((unsigned char*)ptr) + (len) > (buf) + (buflen)) goto overflow;
++ if(((const unsigned char*)ptr) + (len) > (buf) + (buflen)) goto overflow;
+
+ if(tid_return) {
+@@ -2750,5 +2750,5 @@
+ long l;
+ char *q;
+- l = strtol((char*)p + 3, &q, 10);
++ l = strtol((const char*)p + 3, &q, 10);
+ if(q && *q == ':' && l > 0 && l < *tid_len) {
+ CHECK(q + 1, l);
+@@ -2782,5 +2782,5 @@
+ long l;
+ char *q;
+- l = strtol((char*)p + 5, &q, 10);
++ l = strtol((const char*)p + 5, &q, 10);
+ if(q && *q == 'e' && l > 0 && l < 0x10000)
+ *port_return = l;
+@@ -2804,5 +2804,5 @@
+ long l;
+ char *q;
+- l = strtol((char*)p + 7, &q, 10);
++ l = strtol((const char*)p + 7, &q, 10);
+ if(q && *q == ':' && l > 0 && l < *token_len) {
+ CHECK(q + 1, l);
+@@ -2820,5 +2820,5 @@
+ long l;
+ char *q;
+- l = strtol((char*)p + 7, &q, 10);
++ l = strtol((const char*)p + 7, &q, 10);
+ if(q && *q == ':' && l > 0 && l < *nodes_len) {
+ CHECK(q + 1, l);
+@@ -2836,5 +2836,5 @@
+ long l;
+ char *q;
+- l = strtol((char*)p + 8, &q, 10);
++ l = strtol((const char*)p + 8, &q, 10);
+ if(q && *q == ':' && l > 0 && l < *nodes6_len) {
+ CHECK(q + 1, l);
+@@ -2855,8 +2855,8 @@
+ long l;
+ char *q;
+- l = strtol((char*)buf + i, &q, 10);
++ l = strtol((const char*)buf + i, &q, 10);
+ if(q && *q == ':' && l > 0) {
+ CHECK(q + 1, l);
+- i = q + 1 + l - (char*)buf;
++ i = q + 1 + l - (const char*)buf;
+ if(l == 6) {
+ if(j + l > *values_len)
diff --git a/devel/jech-dht/pkg-descr b/devel/jech-dht/pkg-descr
new file mode 100644
index 000000000000..b02457a26cf2
--- /dev/null
+++ b/devel/jech-dht/pkg-descr
@@ -0,0 +1,6 @@
+The files dht.c and dht.h implement the variant of the Kademlia
+Distributed Hash Table (DHT) used in the Bittorrent network
+(``mainline'' variant).
+
+WWW: http://www.pps.univ-paris-diderot.fr/~jch/software/bittorrent/
+WWW: https://github.com/jech/dht
diff --git a/devel/jech-dht/pkg-plist b/devel/jech-dht/pkg-plist
new file mode 100644
index 000000000000..5d87e1c05872
--- /dev/null
+++ b/devel/jech-dht/pkg-plist
@@ -0,0 +1,5 @@
+lib/libdht.so.0
+lib/libdht.so
+lib/libdht.a
+include/dht/dht.h
+@dirrm include/dht