From 7a1f6f9ef0d7a9b7d44837154a55c55a8a8300b7 Mon Sep 17 00:00:00 2001
From: lwhsu <lwhsu@FreeBSD.org>
Date: Mon, 31 Dec 2007 21:45:21 +0000
Subject: Add py-libtre 0.7.5, python interface for the tre regular expressions
 library.

PR:		ports/113446
Submitted by:	bf <bf2006a at yahoo.com>
---
 textproc/Makefile            |  1 +
 textproc/py-libtre/Makefile  | 38 ++++++++++++++++++++++++++++++++++++++
 textproc/py-libtre/distinfo  |  3 +++
 textproc/py-libtre/pkg-descr | 14 ++++++++++++++
 4 files changed, 56 insertions(+)
 create mode 100644 textproc/py-libtre/Makefile
 create mode 100644 textproc/py-libtre/distinfo
 create mode 100644 textproc/py-libtre/pkg-descr

diff --git a/textproc/Makefile b/textproc/Makefile
index 58878f9156b5..a14a3048958a 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -802,6 +802,7 @@
     SUBDIR += py-hyperestraier
     SUBDIR += py-hyperestraier-python
     SUBDIR += py-jaxml
+    SUBDIR += py-libtre
     SUBDIR += py-libxml2
     SUBDIR += py-libxslt
     SUBDIR += py-ltxml
diff --git a/textproc/py-libtre/Makefile b/textproc/py-libtre/Makefile
new file mode 100644
index 000000000000..2865b55562d8
--- /dev/null
+++ b/textproc/py-libtre/Makefile
@@ -0,0 +1,38 @@
+# Ports collection makefile for:	py-libtre
+# Date created:				6 June 2007
+# Whom:					bf <bf2006a@yahoo.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME=	libtre
+PORTVERSION=	0.7.5
+CATEGORIES=	textproc python
+MASTER_SITES=	http://laurikari.net/tre/
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	tre-${PORTVERSION}
+
+MAINTAINER=	bf2006a@yahoo.com
+COMMENT=	Python interface for the tre regular expressions library
+
+LIB_DEPENDS=	tre.6:${PORTSDIR}/textproc/libtre
+
+USE_BZIP2=	yes
+USE_PYTHON=	yes
+USE_PYDISTUTILS=	yes
+PYDISTUTILS_PKGNAME=	tre
+
+BUILD_WRKSRC=	${WRKSRC}/python
+INSTALL_WRKSRC=	${WRKSRC}/python
+
+CFLAGS+=	-I${LOCALBASE}/include/ -L${LOCALBASE}/lib/
+
+.if defined(WITH_OPTIMIZED_CFLAGS)
+CFLAGS+=	-Wuninitialized -ffast-math -finline-functions \
+		-fomit-frame-pointer -fexpensive-optimizations \
+		-fforce-mem -fforce-addr -O3
+.endif
+
+PLIST_FILES=	%%PYTHON_SITELIBDIR%%/tre.so
+
+.include <bsd.port.mk>
diff --git a/textproc/py-libtre/distinfo b/textproc/py-libtre/distinfo
new file mode 100644
index 000000000000..0a7bf7698ea7
--- /dev/null
+++ b/textproc/py-libtre/distinfo
@@ -0,0 +1,3 @@
+MD5 (tre-0.7.5.tar.bz2) = e72e5c94008865cf720992a0b25d6e89
+SHA256 (tre-0.7.5.tar.bz2) = 030f25e6e4c1714df013105494bc5e24b3e0acc65887158a52a03efd8e0759aa
+SIZE (tre-0.7.5.tar.bz2) = 396346
diff --git a/textproc/py-libtre/pkg-descr b/textproc/py-libtre/pkg-descr
new file mode 100644
index 000000000000..19f483060dd0
--- /dev/null
+++ b/textproc/py-libtre/pkg-descr
@@ -0,0 +1,14 @@
+Libtre is an attempt to create a lightweight, robust, and efficient fully
+POSIX compliant regexp matching library. There is still some work left, but
+the results so far are promising.
+
+At the core of Libtre is a new algorithm for regular expression matching with
+submatch addressing. The algorithm uses linear worst-case time in the length
+of the text being searched, and quadratic worst-case time in the length of the
+used regular expression. In other words, the time complexity of the algorithm
+is O(M2N), where M is the length of the regular expression and N is the length
+of the text. The used space is also quadratic on the length of the regex, but
+does not depend on the searched string. This quadratic behaviour occurs only
+on pathological cases which are probably very rare in practice.
+
+WWW: http://laurikari.net/tre/
-- 
cgit