Bug 183205 - [patch] devel/tcltls -- refactoring
Summary: [patch] devel/tcltls -- refactoring
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mikhail Teterin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-22 16:40 UTC by Pietro Cerutti
Modified: 2014-02-14 15:30 UTC (History)
0 users

See Also:


Attachments
file.diff (6.90 KB, patch)
2013-10-22 16:40 UTC, Pietro Cerutti
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pietro Cerutti freebsd_committer freebsd_triage 2013-10-22 16:40:01 UTC
The following patch is a general refactor to the devel/tcltls port, which brings these (imho) enhancements:

- no more custom Makefile; use the bundled TEA-based configure script instead, as most Tcl extensions do
- USE_TCL --> USES+=tcl
- Use PLIST_FILES and PLIST_DIRS, instead of a pkg-plist file for just a bunch of entries
- Switch to new OPTIONS framework (DOCS)
- A few other cleanups

Also, I'd be happy to take this port under the maintainership of tcltk@FreeBSD.org, if you agree.

Thanks.

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-22 16:40:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mi

mi@aldan.algebra.com => mi@ (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-22 16:40:18 UTC
Maintainer of devel/tcltls,

Please note that PR ports/183205 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/183205

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-22 16:40:19 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-02-14 15:26:03 UTC
Author: gahr
Date: Fri Feb 14 15:25:49 2014
New Revision: 344252
URL: http://svnweb.freebsd.org/changeset/ports/344252
QAT: https://qat.redports.org/buildarchive/r344252/

Log:
  - Convert to USES=tcl
  - Add LICENSE
  - Add TEA-based build infrastructure
  - Switch to new OPTIONS framework (DOCS)
  - Cleanups
  
  PR:		183205
  Submitted by:	gahr
  Approved by:	maintainer (timeout)

Deleted:
  head/devel/tcltls/files/Makefile.bsd
  head/devel/tcltls/pkg-plist
Modified:
  head/devel/tcltls/Makefile
  head/devel/tcltls/files/patch-warnings
  head/devel/tcltls/pkg-descr

Modified: head/devel/tcltls/Makefile
==============================================================================
--- head/devel/tcltls/Makefile	Fri Feb 14 15:25:32 2014	(r344251)
+++ head/devel/tcltls/Makefile	Fri Feb 14 15:25:49 2014	(r344252)
@@ -11,55 +11,46 @@ DISTNAME=	tls${PORTVERSION}-src
 MAINTAINER=	mi@aldan.algebra.com
 COMMENT=	SSL extensions for TCL; dynamicly loadable
 
-LIB_DEPENDS+=	tcl${TCLVND}:${PORTSDIR}/lang/tcl${TCLVND}
+LICENSE=	TclTk
+LICENSE_NAME=	Tcl/Tk License
+LICENSE_FILE=	${WRKSRC}/license.terms
+LICENSE_PERMS=	auto-accept dist-mirror dist-sell pkg-mirror pkg-sell
 
-USE_TCL=	84+
-USE_OPENSSL=	yes
+OPTIONS_DEFINE=	DOCS
 
-WRKSRC=	${WRKDIR}/tls${PORTVERSION}
+USES+=		tcl
+USE_OPENSSL=	yes
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS+=--exec-prefix=${PREFIX} \
+		--with-tcl=${TCL_LIBDIR} \
+		--with-ssl-dir=${OPENSSLBASE}
+
+TCLPKG=		tls${PORTVERSION}
+WRKSRC=		${WRKDIR}/${TCLPKG}
+PLIST_FILES=	lib/${TCLPKG}/lib${TCLPKG}.so \
+		lib/${TCLPKG}/pkgIndex.tcl \
+		lib/${TCLPKG}/tls.tcl
+PLIST_DIRS=	lib/${TCLPKG}
+PORTDOCS=	*
 
-PLIST_SUB+=	TCL_VER=${TCL_VER} DISTNAME="${DISTNAME}"
-MAKEFILE=	${FILESDIR}/Makefile.bsd
-MAKE_ENV=	TCL_VER=${TCL_VER} MKDIR="${MKDIR}" \
-		INSTALL_DATA="${INSTALL_DATA}" \
-		SHLIB_NAME=libtls.so.1 \
-		PORTVERSION="${PORTVERSION}" SED="${SED}"
-REINPLACE_ARGS=	-i ""
-ALL_TARGET=	-j`${SYSCTL} -n hw.ncpu` all
-PLIST_SUB=	TLS_VERSION=${PORTVERSION}
+.include <bsd.port.options.mk>
 
-NO_STAGE=	yes
 post-patch:
 	${REINPLACE_CMD} -e \
-		's,package require tls.*,load ${WRKSRC}/libtls.so;\
+		's,package require tls.*,load ${WRKSRC}/lib${TCLPKG}.so;\
 			source ${WRKSRC}/tls.tcl,' \
 		${WRKSRC}/tests/*.test
 	# The tests in ciphers.test are meaningless so far:
 	${MV} ${WRKSRC}/tests/ciphers.test ${WRKSRC}/tests/ciphers.test.broken
 
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 post-install:
-	${MKDIR} ${PREFIX}/share/doc/tls
-	${INSTALL_DATA} ${WRKSRC}/tls.htm ${PREFIX}/share/doc/tls/
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/tls.htm ${STAGEDIR}${DOCSDIR}
 .endif
 
-post-build:
-	#
-	#
-	# Please, try performing `make test' now and report any failures
-	# to the ${PORTNAME} developers:
-	#	http://sourceforge.net/tracker/?group_id=13248&atid=113248
-	# and/or ${MAINTAINER}.
-	#
-	#
-
-test:
-	cd ${WRKSRC}/tests && env TCL_LIBRARY="${WRKSRC}" \
+regression-test:
+	cd ${WRKSRC}/tests && ${SETENV} TCL_LIBRARY="${WRKSRC}" \
 		tclsh${TCL_VER} all.tcl
 
-TCLVND=		${TCL_VER:S/.//}
-
 .include <bsd.port.mk>
-
-PLIST_SUBP!=	${SETENV} ${MAKE_ENV} ${MAKE} -f ${MAKEFILE} environ
-PLIST_SUB+=	${PLIST_SUBP}

Modified: head/devel/tcltls/files/patch-warnings
==============================================================================
--- head/devel/tcltls/files/patch-warnings	Fri Feb 14 15:25:32 2014	(r344251)
+++ head/devel/tcltls/files/patch-warnings	Fri Feb 14 15:25:49 2014	(r344252)
@@ -84,19 +84,45 @@
 +    dprintf(stderr,"\nWaitForConnect(%p)", (void *)statePtr);
  
      for (;;) {
---- tls.c	Thu Feb 12 21:09:21 2004
-+++ tls.c	Mon Jun 20 10:23:44 2005
-@@ -459,5 +459,5 @@
+ 
+--- tls.c.orig	2008-03-19 23:06:13.000000000 +0100
++++ tls.c	2013-10-22 14:32:14.000000000 +0200
+@@ -468,7 +468,7 @@
+ 	"ssl2",	"ssl3",	"tls1",	NULL
      };
      enum protocol {
 -	TLS_SSL2, TLS_SSL3, TLS_TLS1, TLS_NONE
 +	TLS_SSL2, TLS_SSL3, TLS_TLS1
      };
      Tcl_Obj *objPtr;
-@@ -1168,5 +1168,5 @@
+     SSL_CTX *ctx = NULL;
+@@ -1225,7 +1225,7 @@
+     Tcl_Obj	*CONST objv[];
  {
-     const char *commands [] = { "req", NULL };
+     CONST84 char *commands [] = { "req", NULL };
 -    enum command { C_REQ, C_DUMMY };
 +    enum command { C_REQ };
      int cmd;
  
+     if (objc < 2) {
+@@ -1329,13 +1329,13 @@
+ 		
+ 		name=X509_get_subject_name(cert);
+ 
+-		X509_NAME_add_entry_by_txt(name,"C", MBSTRING_ASC, k_C, -1, -1, 0);
+-		X509_NAME_add_entry_by_txt(name,"ST", MBSTRING_ASC, k_ST, -1, -1, 0);
+-		X509_NAME_add_entry_by_txt(name,"L", MBSTRING_ASC, k_L, -1, -1, 0);
+-		X509_NAME_add_entry_by_txt(name,"O", MBSTRING_ASC, k_O, -1, -1, 0);
+-		X509_NAME_add_entry_by_txt(name,"OU", MBSTRING_ASC, k_OU, -1, -1, 0);
+-		X509_NAME_add_entry_by_txt(name,"CN", MBSTRING_ASC, k_CN, -1, -1, 0);
+-		X509_NAME_add_entry_by_txt(name,"Email", MBSTRING_ASC, k_Email, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"C",     MBSTRING_ASC, (const unsigned char *)k_C, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"ST",    MBSTRING_ASC, (const unsigned char *)k_ST, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"L",     MBSTRING_ASC, (const unsigned char *)k_L, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"O",     MBSTRING_ASC, (const unsigned char *)k_O, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"OU",    MBSTRING_ASC, (const unsigned char *)k_OU, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"CN",    MBSTRING_ASC, (const unsigned char *)k_CN, -1, -1, 0);
++		X509_NAME_add_entry_by_txt(name,"Email", MBSTRING_ASC, (const unsigned char *)k_Email, -1, -1, 0);
+ 
+ 		X509_set_subject_name(cert,name);
+ 

Modified: head/devel/tcltls/pkg-descr
==============================================================================
--- head/devel/tcltls/pkg-descr	Fri Feb 14 15:25:32 2014	(r344251)
+++ head/devel/tcltls/pkg-descr	Fri Feb 14 15:25:49 2014	(r344252)
@@ -2,7 +2,4 @@ A portable extension that provides the p
 This extension can be used to utilize SSL encryption on top of any valid
 Tcl Channel - not just sockets!
 
-Note,  that Scriptics  has released  this newer  version (1.4),  but the
-author's web-site listed below still only lists 1.3.
-
 WWW: http://www.sensus.org/tcl/tls.htm
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Pietro Cerutti freebsd_committer freebsd_triage 2014-02-14 15:27:26 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!