New port Sockets version 1.7.1: A C++ wrapper for BSD-style sockets

This commit is contained in:
Mario Sergio Fujikawa Ferreira 2005-01-16 05:04:44 +00:00
parent e7f5b677c7
commit 758b6a8fe3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=126544
21 changed files with 473 additions and 0 deletions

View file

@ -10,6 +10,7 @@
SUBDIR += AquaGatekeeper
SUBDIR += DarwinStreamingServer
SUBDIR += GeoIP
SUBDIR += Sockets
SUBDIR += acx100
SUBDIR += adasockets
SUBDIR += aget

View file

@ -0,0 +1,45 @@
# New ports collection makefile for: C++ Sockets
# Date created: Sat Jan 15 16:17:20 UTC 2005
# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= Sockets
PORTVERSION= 1.7.1
CATEGORIES= net ipv6
MASTER_SITES= http://www.alhem.net/Sockets/
MAINTAINER= lioux@FreeBSD.org
COMMENT= A C++ wrapper for BSD-style sockets
USE_GMAKE= yes
USE_OPENSSL= yes
WITH_OPENSSL_BASE= yes
MAKE_ENV= CXX="${CXX}"
USE_REINPLACE= yes
post-patch:
# PREFIX safeness
# CXX safeness
# CXXFLAGS safeness
@${REINPLACE_CMD} -E \
-e 's|-O2||' \
-e 's|^PREFIX.+$$|PREFIX=${PREFIX}|' \
-e 's|^INCLUDE.+$$|INCLUDE=-I. -I${OPENSSLINC}|' \
-e 's|g\+\+|${CXX}|' \
${BUILD_WRKSRC}/${MAKEFILE}
# fix StdLog.h location
@${FIND} ${WRKSRC} -type f | \
${XARGS} -n 5 -x \
${REINPLACE_CMD} -E \
-e 's|"StdLog.h"|<StdLog.h>|'
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 500000
IGNORE= FreeBSD prior to 500000 does not support uuid(3) required\
for building
.endif
.include <bsd.port.post.mk>

View file

@ -0,0 +1,2 @@
MD5 (Sockets-1.7.1.tar.gz) = 8f3ac8d40c65f7545e358e03ea3eead4
SIZE (Sockets-1.7.1.tar.gz) = 46255

View file

@ -0,0 +1,10 @@
--- ListenSocket.h.orig Sat Jan 15 23:40:23 2005
+++ ListenSocket.h Sat Jan 15 23:41:10 2005
@@ -31,6 +31,7 @@
#include "Socket.h"
+#include <StdLog.h>
template <class X>
class ListenSocket : public Socket

View file

@ -0,0 +1,18 @@
--- Makefile.orig Sat Jan 15 23:06:28 2005
+++ Makefile Sat Jan 15 23:07:15 2005
@@ -59,11 +59,11 @@
ranlib $@
install: all
- cp libSockets.a $(PREFIX)/lib
- cp libSocketsEx.a $(PREFIX)/lib
+ @${BSD_INSTALL_DATA} libSockets.a $(PREFIX)/lib
+ @${BSD_INSTALL_DATA} libSocketsEx.a $(PREFIX)/lib
mkdir -p $(PREFIX)/include/Sockets
- cp -a *.h $(PREFIX)/include/Sockets
- install Sockets-config $(PREFIX)/bin
+ @${BSD_INSTALL_DATA} *.h $(PREFIX)/include/Sockets
+ @${BSD_INSTALL_PROGRAM} Sockets-config $(PREFIX)/bin
clean:
rm -f *.o *~ slask *.d $(PROGS) *.a

View file

@ -0,0 +1,22 @@
--- MinderHandler.cpp.orig Sun Jan 16 02:22:51 2005
+++ MinderHandler.cpp Sun Jan 16 02:26:52 2005
@@ -20,6 +20,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
#ifdef _WIN32
#pragma warning(disable:4786)
#endif
@@ -428,6 +432,8 @@
msg += ":" + tmp;
#ifdef _WIN32
msg += ":Win32";
+#elif defined __FreeBSD__
+ msg += ":FreeBSD";
#else
msg += ":Linux";
#endif

View file

@ -0,0 +1,23 @@
--- Sockets-config.cpp.orig Sun Jan 16 02:23:14 2005
+++ Sockets-config.cpp Sun Jan 16 02:26:07 2005
@@ -3,6 +3,10 @@
CFLAGS = -Wall -g -O2 $(INCLUDE) -MD -D_VERSION='"$(VERSION)"'
# manual autoconf ....
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
# uncomment if your operating system is linux, mac os x, or solaris
#CFLAGS += -DLINUX
#CFLAGS += -DMACOSX
@@ -19,6 +23,9 @@
printf(" -D_VERSION='\"%s\"'", _VERSION);
#ifdef LINUX
printf(" -DLINUX");
+#endif
+#if defined __FreeBSD__
+ printf(" -DFREEBSD");
#endif
#ifdef MACOSX
printf(" -DMACOSX");

View file

@ -0,0 +1,36 @@
--- Uid.cpp.orig Sat Jan 15 21:36:02 2005
+++ Uid.cpp Sat Jan 15 22:41:30 2005
@@ -20,12 +20,22 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#ifdef _WIN32
#include <objbase.h>
#elif defined MACOSX
#include "uuid.h"
+#elif defined __FreeBSD__
+# if __FreeBSD_version >= 500000
+# include <uuid.h>
+# else
+# error FreeBSD versions prior to 500000 does not support uuid(3)
+# endif
#else
#include <uuid/uuid.h>
#endif
@@ -49,6 +59,10 @@
exit(-1);
}
memcpy(m_bufuid, &randomGuid, 16);
+#elif defined __FreeBSD__
+ uuid_t uid;
+ uuid_create(&uid, NULL);
+ memcpy(m_bufuid, &uid, 16);
#else
uuid_t uid;
uuid_generate(uid);

View file

@ -0,0 +1,34 @@
--- socket_include.h.orig Sat Jan 15 14:48:57 2005
+++ socket_include.h Sat Jan 15 22:31:09 2005
@@ -1,10 +1,31 @@
#ifndef _SOCKET_INCLUDE_H
#define _SOCKET_INCLUDE_H
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
#ifdef SOLARIS
// ----------------------------------------
// Solaris
typedef unsigned short port_t;
+
+#elif defined __FreeBSD__
+// ----------------------------------------
+// FreeBSD
+# if __FreeBSD_version >= 400014
+# define s6_addr16 __u6_addr.__u6_addr16
+# if !defined(MSG_NOSIGNAL)
+# define MSG_NOSIGNAL 0
+# endif
+# include <netinet/in.h>
+typedef in_addr_t ipaddr_t;
+typedef in_port_t port_t;
+# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+# else
+# error FreeBSD versions prior to 400014 does not support ipv6
+# endif
#elif defined MACOSX
// ----------------------------------------

View file

@ -0,0 +1,12 @@
[ excerpt from developer's web site ]
This is a GPL licensed C++ class library wrapping the berkeley
sockets C API, and therefore works on most unixes and also win32.
Features include, but are not limited to, SSL support, IPv6 support,
tcp and udp sockets, encrypted tcp, http protocol, highly customizable
error handling. Testing has been done on Linux and Windows 2000,
and to some part on Solaris and Mac OS X.
WWW: http://www.alhem.net/Sockets/index.html
-- lioux@FreeBSD.org

View file

@ -0,0 +1,34 @@
bin/Sockets-config
include/Sockets/Base64.h
include/Sockets/CTcpSocket.h
include/Sockets/CircularBuffer.h
include/Sockets/HTTPSocket.h
include/Sockets/HttpDebugSocket.h
include/Sockets/HttpGetSocket.h
include/Sockets/HttpPostSocket.h
include/Sockets/HttpPutSocket.h
include/Sockets/HttpsGetSocket.h
include/Sockets/HttpsSocket.h
include/Sockets/ICrypt.h
include/Sockets/ListenSocket.h
include/Sockets/MinderHandler.h
include/Sockets/MinderSocket.h
include/Sockets/MinionSocket.h
include/Sockets/NullCrypt.h
include/Sockets/Parse.h
include/Sockets/PoolSocket.h
include/Sockets/SSLSocket.h
include/Sockets/Socket.h
include/Sockets/SocketHandler.h
include/Sockets/SocketThread.h
include/Sockets/StdLog.h
include/Sockets/StdoutLog.h
include/Sockets/TcpSocket.h
include/Sockets/Thread.h
include/Sockets/UdpSocket.h
include/Sockets/Uid.h
include/Sockets/Utility.h
include/Sockets/socket_include.h
lib/libSockets.a
lib/libSocketsEx.a
@dirrm include/Sockets

45
net/Sockets/Makefile Normal file
View file

@ -0,0 +1,45 @@
# New ports collection makefile for: C++ Sockets
# Date created: Sat Jan 15 16:17:20 UTC 2005
# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= Sockets
PORTVERSION= 1.7.1
CATEGORIES= net ipv6
MASTER_SITES= http://www.alhem.net/Sockets/
MAINTAINER= lioux@FreeBSD.org
COMMENT= A C++ wrapper for BSD-style sockets
USE_GMAKE= yes
USE_OPENSSL= yes
WITH_OPENSSL_BASE= yes
MAKE_ENV= CXX="${CXX}"
USE_REINPLACE= yes
post-patch:
# PREFIX safeness
# CXX safeness
# CXXFLAGS safeness
@${REINPLACE_CMD} -E \
-e 's|-O2||' \
-e 's|^PREFIX.+$$|PREFIX=${PREFIX}|' \
-e 's|^INCLUDE.+$$|INCLUDE=-I. -I${OPENSSLINC}|' \
-e 's|g\+\+|${CXX}|' \
${BUILD_WRKSRC}/${MAKEFILE}
# fix StdLog.h location
@${FIND} ${WRKSRC} -type f | \
${XARGS} -n 5 -x \
${REINPLACE_CMD} -E \
-e 's|"StdLog.h"|<StdLog.h>|'
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 500000
IGNORE= FreeBSD prior to 500000 does not support uuid(3) required\
for building
.endif
.include <bsd.port.post.mk>

2
net/Sockets/distinfo Normal file
View file

@ -0,0 +1,2 @@
MD5 (Sockets-1.7.1.tar.gz) = 8f3ac8d40c65f7545e358e03ea3eead4
SIZE (Sockets-1.7.1.tar.gz) = 46255

View file

@ -0,0 +1,10 @@
--- ListenSocket.h.orig Sat Jan 15 23:40:23 2005
+++ ListenSocket.h Sat Jan 15 23:41:10 2005
@@ -31,6 +31,7 @@
#include "Socket.h"
+#include <StdLog.h>
template <class X>
class ListenSocket : public Socket

View file

@ -0,0 +1,18 @@
--- Makefile.orig Sat Jan 15 23:06:28 2005
+++ Makefile Sat Jan 15 23:07:15 2005
@@ -59,11 +59,11 @@
ranlib $@
install: all
- cp libSockets.a $(PREFIX)/lib
- cp libSocketsEx.a $(PREFIX)/lib
+ @${BSD_INSTALL_DATA} libSockets.a $(PREFIX)/lib
+ @${BSD_INSTALL_DATA} libSocketsEx.a $(PREFIX)/lib
mkdir -p $(PREFIX)/include/Sockets
- cp -a *.h $(PREFIX)/include/Sockets
- install Sockets-config $(PREFIX)/bin
+ @${BSD_INSTALL_DATA} *.h $(PREFIX)/include/Sockets
+ @${BSD_INSTALL_PROGRAM} Sockets-config $(PREFIX)/bin
clean:
rm -f *.o *~ slask *.d $(PROGS) *.a

View file

@ -0,0 +1,22 @@
--- MinderHandler.cpp.orig Sun Jan 16 02:22:51 2005
+++ MinderHandler.cpp Sun Jan 16 02:26:52 2005
@@ -20,6 +20,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
#ifdef _WIN32
#pragma warning(disable:4786)
#endif
@@ -428,6 +432,8 @@
msg += ":" + tmp;
#ifdef _WIN32
msg += ":Win32";
+#elif defined __FreeBSD__
+ msg += ":FreeBSD";
#else
msg += ":Linux";
#endif

View file

@ -0,0 +1,23 @@
--- Sockets-config.cpp.orig Sun Jan 16 02:23:14 2005
+++ Sockets-config.cpp Sun Jan 16 02:26:07 2005
@@ -3,6 +3,10 @@
CFLAGS = -Wall -g -O2 $(INCLUDE) -MD -D_VERSION='"$(VERSION)"'
# manual autoconf ....
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
# uncomment if your operating system is linux, mac os x, or solaris
#CFLAGS += -DLINUX
#CFLAGS += -DMACOSX
@@ -19,6 +23,9 @@
printf(" -D_VERSION='\"%s\"'", _VERSION);
#ifdef LINUX
printf(" -DLINUX");
+#endif
+#if defined __FreeBSD__
+ printf(" -DFREEBSD");
#endif
#ifdef MACOSX
printf(" -DMACOSX");

View file

@ -0,0 +1,36 @@
--- Uid.cpp.orig Sat Jan 15 21:36:02 2005
+++ Uid.cpp Sat Jan 15 22:41:30 2005
@@ -20,12 +20,22 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
#include <stdio.h>
#include <assert.h>
#ifdef _WIN32
#include <objbase.h>
#elif defined MACOSX
#include "uuid.h"
+#elif defined __FreeBSD__
+# if __FreeBSD_version >= 500000
+# include <uuid.h>
+# else
+# error FreeBSD versions prior to 500000 does not support uuid(3)
+# endif
#else
#include <uuid/uuid.h>
#endif
@@ -49,6 +59,10 @@
exit(-1);
}
memcpy(m_bufuid, &randomGuid, 16);
+#elif defined __FreeBSD__
+ uuid_t uid;
+ uuid_create(&uid, NULL);
+ memcpy(m_bufuid, &uid, 16);
#else
uuid_t uid;
uuid_generate(uid);

View file

@ -0,0 +1,34 @@
--- socket_include.h.orig Sat Jan 15 14:48:57 2005
+++ socket_include.h Sat Jan 15 22:31:09 2005
@@ -1,10 +1,31 @@
#ifndef _SOCKET_INCLUDE_H
#define _SOCKET_INCLUDE_H
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+
#ifdef SOLARIS
// ----------------------------------------
// Solaris
typedef unsigned short port_t;
+
+#elif defined __FreeBSD__
+// ----------------------------------------
+// FreeBSD
+# if __FreeBSD_version >= 400014
+# define s6_addr16 __u6_addr.__u6_addr16
+# if !defined(MSG_NOSIGNAL)
+# define MSG_NOSIGNAL 0
+# endif
+# include <netinet/in.h>
+typedef in_addr_t ipaddr_t;
+typedef in_port_t port_t;
+# define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+# define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+# else
+# error FreeBSD versions prior to 400014 does not support ipv6
+# endif
#elif defined MACOSX
// ----------------------------------------

12
net/Sockets/pkg-descr Normal file
View file

@ -0,0 +1,12 @@
[ excerpt from developer's web site ]
This is a GPL licensed C++ class library wrapping the berkeley
sockets C API, and therefore works on most unixes and also win32.
Features include, but are not limited to, SSL support, IPv6 support,
tcp and udp sockets, encrypted tcp, http protocol, highly customizable
error handling. Testing has been done on Linux and Windows 2000,
and to some part on Solaris and Mac OS X.
WWW: http://www.alhem.net/Sockets/index.html
-- lioux@FreeBSD.org

34
net/Sockets/pkg-plist Normal file
View file

@ -0,0 +1,34 @@
bin/Sockets-config
include/Sockets/Base64.h
include/Sockets/CTcpSocket.h
include/Sockets/CircularBuffer.h
include/Sockets/HTTPSocket.h
include/Sockets/HttpDebugSocket.h
include/Sockets/HttpGetSocket.h
include/Sockets/HttpPostSocket.h
include/Sockets/HttpPutSocket.h
include/Sockets/HttpsGetSocket.h
include/Sockets/HttpsSocket.h
include/Sockets/ICrypt.h
include/Sockets/ListenSocket.h
include/Sockets/MinderHandler.h
include/Sockets/MinderSocket.h
include/Sockets/MinionSocket.h
include/Sockets/NullCrypt.h
include/Sockets/Parse.h
include/Sockets/PoolSocket.h
include/Sockets/SSLSocket.h
include/Sockets/Socket.h
include/Sockets/SocketHandler.h
include/Sockets/SocketThread.h
include/Sockets/StdLog.h
include/Sockets/StdoutLog.h
include/Sockets/TcpSocket.h
include/Sockets/Thread.h
include/Sockets/UdpSocket.h
include/Sockets/Uid.h
include/Sockets/Utility.h
include/Sockets/socket_include.h
lib/libSockets.a
lib/libSocketsEx.a
@dirrm include/Sockets