Index: head/devel/Makefile =================================================================== --- head/devel/Makefile +++ head/devel/Makefile @@ -1142,6 +1142,7 @@ SUBDIR += libdisasm SUBDIR += libdisorder SUBDIR += libdispatch + SUBDIR += libdistance SUBDIR += libdlmalloc SUBDIR += libdlna SUBDIR += libdnsres Index: head/devel/libdistance/Makefile =================================================================== --- head/devel/libdistance/Makefile +++ head/devel/libdistance/Makefile @@ -0,0 +1,25 @@ +# $FreeBSD$ + +PORTNAME= libdistance +PORTVERSION= 0.2.2 +CATEGORIES= devel +MASTER_SITES= http://monkey.org/~jose/software/libdistance/ + +MAINTAINER= jonathan@FreeBSD.org +COMMENT= Compute the distance between two pieces of data + +LICENSE= BSD3CLAUSE + +BUILD_DEPENDS= swig2.0:${PORTSDIR}/devel/swig20 + +USES+= fakeroot pkgconfig tcl +USE_LDCONFIG= yes + +MAKE_ARGS+= INCLUDEDIR=${PREFIX}/include LIBDIR=${PREFIX}/lib +MAKE_ARGS+= MANDIR=${PREFIX}/man/man SWIG=swig2.0 +CFLAGS+= -fPIC + +pre-build: + mkdir -p ${STAGEDIR}/usr/local/tests/${PORTNAME} + +.include Index: head/devel/libdistance/distinfo =================================================================== --- head/devel/libdistance/distinfo +++ head/devel/libdistance/distinfo @@ -0,0 +1,2 @@ +SHA256 (libdistance-0.2.2.tar.gz) = 65364e07c9fe78ef34fc0e563aff2317ab0aba7549da07adea929426a708e6ad +SIZE (libdistance-0.2.2.tar.gz) = 31629 Index: head/devel/libdistance/files/patch-Makefile =================================================================== --- head/devel/libdistance/files/patch-Makefile +++ head/devel/libdistance/files/patch-Makefile @@ -0,0 +1,10 @@ +--- Makefile.orig 2014-10-10 13:11:38 UTC ++++ Makefile +@@ -3,6 +3,7 @@ + LIB= distance + SRCS= levenshtein.c hamming.c bloom.c needleman_wunsch.c jaccard.c + SRCS+= minkowski.c damerau.c ++INCS= distance.h + MAN= distance.3 + CFLAGS+= -g -Wall -Wunused + LDADD+= -g Index: head/devel/libdistance/files/patch-swig_tcl_Makefile =================================================================== --- head/devel/libdistance/files/patch-swig_tcl_Makefile +++ head/devel/libdistance/files/patch-swig_tcl_Makefile @@ -0,0 +1,29 @@ +--- swig/tcl/Makefile.orig 2014-10-10 13:11:38 UTC ++++ swig/tcl/Makefile +@@ -1,15 +1,16 @@ + # $Id: Makefile,v 1.2 2004/11/30 00:26:59 jose Exp $ + +-all: distance.so ++LIB= distance ++SHLIB_MAJOR= 1 + +-distance_wrap.o: ../distance.i +- swig -tcl -namespace -module distance -o distance_wrap.c \ +- -v ../distance.i +- gcc -c -I../.. -I/usr/local/include/tcl8.4 -fpic distance_wrap.c ++SRCS= distance_wrap.c # swig-generated source file ++CLEANFILES+= $(SRCS) + +-distance.so: distance_wrap.o +- gcc -shared distance_wrap.o ../../libdistance.a \ +- -o distance.so ++CFLAGS= -I ../.. `pkg-config --cflags tcl` -fPIC ++SWIG?= swig + +-clean: +- rm -f *.o distance_wrap.c *.so *.core *_wrap.c distance.py ++distance_wrap.c: ../distance.i ++ ${SWIG} -tcl -namespace -module distance -o distance_wrap.c \ ++ -v ../distance.i ++ ++.include Index: head/devel/libdistance/files/patch-test_Makefile =================================================================== --- head/devel/libdistance/files/patch-test_Makefile +++ head/devel/libdistance/files/patch-test_Makefile @@ -0,0 +1,14 @@ +--- test/Makefile.orig 2014-10-10 13:11:38 UTC ++++ test/Makefile +@@ -3,8 +3,10 @@ + PROG= test + CFLAGS+= -I.. -g + LDADD= -L.. -ldistance -lm +-NOMAN= Yes ++MAN= + + CLEANFILES+= test + ++BINDIR= ${PREFIX}/tests/libdistance ++ + .include Index: head/devel/libdistance/pkg-descr =================================================================== --- head/devel/libdistance/pkg-descr +++ head/devel/libdistance/pkg-descr @@ -0,0 +1,7 @@ +The distance library is used to compare pieces of data for similarity. +Specifically, it contains a number of methods to find the "edit distance" +between inputs, or the number of differences between them. These differences +are calculated using various mechanisms. The inputs to these functions can be +character strings or arbitrary data. + +WWW: http://monkey.org/~jose/software/libdistance Index: head/devel/libdistance/pkg-plist =================================================================== --- head/devel/libdistance/pkg-plist +++ head/devel/libdistance/pkg-plist @@ -0,0 +1,7 @@ +include/distance.h +lib/libdistance.a +lib/libdistance.so +lib/libdistance.so.1 +lib/libdistance_p.a +man/man3/distance.3.gz +tests/libdistance/test