View | Details | Raw Unified | Return to bug 183205
Collapse All | Expand All

(-)Makefile (-33 / +18 lines)
Lines 11-65 Link Here
11
MAINTAINER=	mi@aldan.algebra.com
11
MAINTAINER=	mi@aldan.algebra.com
12
COMMENT=	SSL extensions for TCL; dynamicly loadable
12
COMMENT=	SSL extensions for TCL; dynamicly loadable
13
13
14
LIB_DEPENDS+=	tcl${TCLVND}:${PORTSDIR}/lang/tcl${TCLVND}
14
OPTIONS_DEFINE=	DOCS
15
15
16
USE_TCL=	84+
16
USES+=		tcl
17
USE_OPENSSL=	yes
17
USE_OPENSSL=	yes
18
GNU_CONFIGURE=	yes
19
CONFIGURE_ARGS+=--with-tcl=${TCL_LIBDIR} \
20
		--with-ssl-dir=${OPENSSLBASE}
18
21
19
WRKSRC=	${WRKDIR}/tls${PORTVERSION}
22
TCLPKG=		tls${PORTVERSION}
23
WRKSRC=		${WRKDIR}/${TCLPKG}
24
PLIST_FILES=	lib/${TCLPKG}/lib${TCLPKG}.so \
25
		lib/${TCLPKG}/pkgIndex.tcl \
26
		lib/${TCLPKG}/tls.tcl
27
PLIST_DIRS=	lib/${TCLPKG}
28
PORTDOCS=	*
20
29
21
PLIST_SUB+=	TCL_VER=${TCL_VER} DISTNAME="${DISTNAME}"
30
.include <bsd.port.options.mk>
22
MAKEFILE=	${FILESDIR}/Makefile.bsd
23
MAKE_ENV=	TCL_VER=${TCL_VER} MKDIR="${MKDIR}" \
24
		INSTALL_DATA="${INSTALL_DATA}" \
25
		SHLIB_NAME=libtls.so.1 \
26
		PORTVERSION="${PORTVERSION}" SED="${SED}"
27
REINPLACE_ARGS=	-i ""
28
ALL_TARGET=	-j`${SYSCTL} -n hw.ncpu` all
29
PLIST_SUB=	TLS_VERSION=${PORTVERSION}
30
31
31
NO_STAGE=	yes
32
post-patch:
32
post-patch:
33
	${REINPLACE_CMD} -e \
33
	${REINPLACE_CMD} -e \
34
		's,package require tls.*,load ${WRKSRC}/libtls.so;\
34
		's,package require tls.*,load ${WRKSRC}/lib${TCLPKG}.so;\
35
			source ${WRKSRC}/tls.tcl,' \
35
			source ${WRKSRC}/tls.tcl,' \
36
		${WRKSRC}/tests/*.test
36
		${WRKSRC}/tests/*.test
37
	# The tests in ciphers.test are meaningless so far:
37
	# The tests in ciphers.test are meaningless so far:
38
	${MV} ${WRKSRC}/tests/ciphers.test ${WRKSRC}/tests/ciphers.test.broken
38
	${MV} ${WRKSRC}/tests/ciphers.test ${WRKSRC}/tests/ciphers.test.broken
39
39
40
.if !defined(NOPORTDOCS)
40
.if ${PORT_OPTIONS:MDOCS}
41
post-install:
41
post-install:
42
	${MKDIR} ${PREFIX}/share/doc/tls
42
	${MKDIR} ${STAGEDIR}${DOCSDIR}
43
	${INSTALL_DATA} ${WRKSRC}/tls.htm ${PREFIX}/share/doc/tls/
43
	${INSTALL_DATA} ${WRKSRC}/tls.htm ${STAGEDIR}${DOCSDIR}
44
.endif
44
.endif
45
45
46
post-build:
46
regression-test:
47
	#
48
	#
49
	# Please, try performing `make test' now and report any failures
50
	# to the ${PORTNAME} developers:
51
	#	http://sourceforge.net/tracker/?group_id=13248&atid=113248
52
	# and/or ${MAINTAINER}.
53
	#
54
	#
55
56
test:
57
	cd ${WRKSRC}/tests && env TCL_LIBRARY="${WRKSRC}" \
47
	cd ${WRKSRC}/tests && env TCL_LIBRARY="${WRKSRC}" \
58
		tclsh${TCL_VER} all.tcl
48
		tclsh${TCL_VER} all.tcl
59
49
60
TCLVND=		${TCL_VER:S/.//}
61
62
.include <bsd.port.mk>
50
.include <bsd.port.mk>
63
64
PLIST_SUBP!=	${SETENV} ${MAKE_ENV} ${MAKE} -f ${MAKEFILE} environ
65
PLIST_SUB+=	${PLIST_SUBP}
(-)files/Makefile.bsd (-52 lines)
Lines 1-52 Link Here
1
PACKAGE		= tls
2
VERSION		?= ${PORTVERSION}
3
.ifndef(SHLIB_NAME)
4
LIB		= ${PACKAGE}
5
SHLIB_MAJOR	= ${VERSION:R}
6
SHLIB_MINOR	= ${VERSION:E}
7
.endif
8
9
SRCS		= tls.c tlsIO.c tlsBIO.c tlsX509.c # fixstrtod.c strncasecmp.c
10
11
PREFIX		?=/usr/local
12
TCL_VER		?=8.3
13
14
.if exists(${PREFIX}/lib/tcl${TCL_VER}/tclConfig.sh)
15
# If for some reason  the file does not exist -- make the best guess. In
16
# reality, it will exist by the time we are actually doing the build, so
17
# the quality of the guess does not matter. But we still try well. -mi
18
TCL_STUB_LIB_SPEC!=	. ${PREFIX}/lib/tcl${TCL_VER}/tclConfig.sh; \
19
		echo $$TCL_STUB_LIB_SPEC
20
.else
21
TCL_STUB_LIB_SPEC=	-L${PREFIX}/lib -ltclstub${TCL_VER:S/.//}
22
.endif
23
24
LDADD		+= ${TCL_STUB_LIB_SPEC} -L${OPENSSLLIB} -lcrypto -lssl
25
26
CFLAGS		+=-I${PREFIX}/include/tcl${TCL_VER} -I${OPENSSLINC}
27
CFLAGS		+=-DNDEBUG -I. -DUSE_TCL_STUBS -I${PREFIX}/include
28
CFLAGS		+=-DPACKAGE_VERSION=\"${VERSION}\" -DPACKAGE_NAME=\"${PACKAGE}\"
29
30
all: ${SHLIB_NAME} pkgIndex.tcl
31
32
pkgIndex.tcl:
33
	(echo 'package ifneeded $(PACKAGE) $(VERSION) \
34
	    "[list source [file join $$dir tls.tcl]] ; \
35
	     [list tls::initlib ${LIBDIR} ${SHLIB_NAME}]"'\
36
	) > pkgIndex.tcl
37
38
SCRIPTDIR	= lib/tls
39
SCRIPTPATH	= ${PREFIX}/${SCRIPTDIR}
40
LIBDIR		= ${PREFIX}/lib
41
42
${SCRIPTPATH}:
43
	${MKDIR} ${SCRIPTPATH}
44
45
environ:
46
	@${ECHO} SHLIB_NAME="${SHLIB_NAME}" SHLIB_LINK="${SHLIB_LINK}" \
47
		SCRIPTDIR="${SCRIPTDIR}"
48
49
beforeinstall: ${SCRIPTPATH}
50
	${INSTALL_DATA} pkgIndex.tcl ${.CURDIR}/tls.tcl ${SCRIPTPATH}
51
52
.include <bsd.lib.mk>
(-)files/patch-warnings (-5 / +31 lines)
Lines 84-92 Link Here
84
+    dprintf(stderr,"\nWaitForConnect(%p)", (void *)statePtr);
84
+    dprintf(stderr,"\nWaitForConnect(%p)", (void *)statePtr);
85
 
85
 
86
     for (;;) {
86
     for (;;) {
87
--- tls.c	Thu Feb 12 21:09:21 2004
87
 
88
+++ tls.c	Mon Jun 20 10:23:44 2005
88
--- tls.c.orig	2008-03-19 23:06:13.000000000 +0100
89
@@ -459,5 +459,5 @@
89
+++ tls.c	2013-10-22 14:32:14.000000000 +0200
90
@@ -468,7 +468,7 @@
91
 	"ssl2",	"ssl3",	"tls1",	NULL
90
     };
92
     };
91
     enum protocol {
93
     enum protocol {
92
-	TLS_SSL2, TLS_SSL3, TLS_TLS1, TLS_NONE
94
-	TLS_SSL2, TLS_SSL3, TLS_TLS1, TLS_NONE
Lines 93-102 Link Here
93
+	TLS_SSL2, TLS_SSL3, TLS_TLS1
95
+	TLS_SSL2, TLS_SSL3, TLS_TLS1
94
     };
96
     };
95
     Tcl_Obj *objPtr;
97
     Tcl_Obj *objPtr;
96
@@ -1168,5 +1168,5 @@
98
     SSL_CTX *ctx = NULL;
99
@@ -1225,7 +1225,7 @@
100
     Tcl_Obj	*CONST objv[];
97
 {
101
 {
98
     const char *commands [] = { "req", NULL };
102
     CONST84 char *commands [] = { "req", NULL };
99
-    enum command { C_REQ, C_DUMMY };
103
-    enum command { C_REQ, C_DUMMY };
100
+    enum command { C_REQ };
104
+    enum command { C_REQ };
101
     int cmd;
105
     int cmd;
102
 
106
 
107
     if (objc < 2) {
108
@@ -1329,13 +1329,13 @@
109
 		
110
 		name=X509_get_subject_name(cert);
111
 
112
-		X509_NAME_add_entry_by_txt(name,"C", MBSTRING_ASC, k_C, -1, -1, 0);
113
-		X509_NAME_add_entry_by_txt(name,"ST", MBSTRING_ASC, k_ST, -1, -1, 0);
114
-		X509_NAME_add_entry_by_txt(name,"L", MBSTRING_ASC, k_L, -1, -1, 0);
115
-		X509_NAME_add_entry_by_txt(name,"O", MBSTRING_ASC, k_O, -1, -1, 0);
116
-		X509_NAME_add_entry_by_txt(name,"OU", MBSTRING_ASC, k_OU, -1, -1, 0);
117
-		X509_NAME_add_entry_by_txt(name,"CN", MBSTRING_ASC, k_CN, -1, -1, 0);
118
-		X509_NAME_add_entry_by_txt(name,"Email", MBSTRING_ASC, k_Email, -1, -1, 0);
119
+		X509_NAME_add_entry_by_txt(name,"C",     MBSTRING_ASC, (const unsigned char *)k_C, -1, -1, 0);
120
+		X509_NAME_add_entry_by_txt(name,"ST",    MBSTRING_ASC, (const unsigned char *)k_ST, -1, -1, 0);
121
+		X509_NAME_add_entry_by_txt(name,"L",     MBSTRING_ASC, (const unsigned char *)k_L, -1, -1, 0);
122
+		X509_NAME_add_entry_by_txt(name,"O",     MBSTRING_ASC, (const unsigned char *)k_O, -1, -1, 0);
123
+		X509_NAME_add_entry_by_txt(name,"OU",    MBSTRING_ASC, (const unsigned char *)k_OU, -1, -1, 0);
124
+		X509_NAME_add_entry_by_txt(name,"CN",    MBSTRING_ASC, (const unsigned char *)k_CN, -1, -1, 0);
125
+		X509_NAME_add_entry_by_txt(name,"Email", MBSTRING_ASC, (const unsigned char *)k_Email, -1, -1, 0);
126
 
127
 		X509_set_subject_name(cert,name);
128
 
(-)pkg-descr (-3 lines)
Lines 2-8 Link Here
2
This extension can be used to utilize SSL encryption on top of any valid
2
This extension can be used to utilize SSL encryption on top of any valid
3
Tcl Channel - not just sockets!
3
Tcl Channel - not just sockets!
4
4
5
Note,  that Scriptics  has released  this newer  version (1.4),  but the
6
author's web-site listed below still only lists 1.3.
7
8
WWW: http://www.sensus.org/tcl/tls.htm
5
WWW: http://www.sensus.org/tcl/tls.htm
(-)pkg-plist (-7 lines)
Lines 1-7 Link Here
1
%%SCRIPTDIR%%/pkgIndex.tcl
2
%%SCRIPTDIR%%/tls.tcl
3
@dirrm %%SCRIPTDIR%%
4
lib/%%SHLIB_NAME%%
5
lib/%%SHLIB_LINK%%
6
%%PORTDOCS%%share/doc/tls/tls.htm
7
%%PORTDOCS%%@dirrm share/doc/tls

Return to bug 183205