Import foma-0.9.16.

Foma is a compiler, programming language, and C library for constructing
finite-state automata and transducers for various uses. It has specific
support for many natural language processing applications such as
producing morphological analyzers. Although NLP applications are
probably the main use of foma, it is sufficiently generic to use for a
large number of purposes.

ok jeremy@ pirofti@
This commit is contained in:
bentley 2012-10-20 04:34:32 +00:00
parent 82a85dd3c0
commit 7fb44f7e59
7 changed files with 99 additions and 0 deletions

35
math/foma/Makefile Normal file
View File

@ -0,0 +1,35 @@
# $OpenBSD: Makefile,v 1.1.1.1 2012/10/20 04:34:32 bentley Exp $
COMMENT = finite-state compiler and C library
DISTNAME = foma-0.9.16alpha
PKGNAME = ${DISTNAME:S/alpha//}
SHARED_LIBS += foma 0.0 # 0.9.16
CATEGORIES = math devel
HOMEPAGE = https://code.google.com/p/foma/
# GPLv2
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB += c readline termcap z
MASTER_SITES = https://foma.googlecode.com/files/
MAKE_FLAGS = CC="${CC}" \
CFLAGS="${CFLAGS}" \
VERSION="${LIBfoma_VERSION}"
FAKE_FLAGS = prefix="${WRKINST}${PREFIX}"
USE_GMAKE = Yes
NO_REGRESS = Yes
WRKDIST = ${WRKDIR}/foma
.include <bsd.port.mk>

2
math/foma/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (foma-0.9.16alpha.tar.gz) = 3AGdzfbcj36IE5Tz12ghAG5/DPbj/hwSrCiH+kjYEgg=
SIZE (foma-0.9.16alpha.tar.gz) = 328482

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2012/10/20 04:34:32 bentley Exp $
Generate shared libraries correctly.
--- Makefile.orig Wed Dec 14 00:28:25 2011
+++ Makefile Fri Oct 12 23:56:56 2012
@@ -57,7 +57,7 @@ libfoma: $(SHAREDLIBV)
$(SHAREDLIBV): $(LIBOBJS)
$(AR) $(ARFLAGS) $(STATICLIB) $(LIBOBJS)
$(RANLIB) $(STATICLIB)
- $(CC) $(CFLAGS) -shared -Wl,$(DFLAG),$(SHAREDLIBM) -o $(SHAREDLIBV) $(LIBOBJS) $(LDFLAGS)
+ $(CC) $(CFLAGS) -shared -o $(SHAREDLIBV) $(LIBOBJS) $(LDFLAGS)
install: foma libfoma
-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
@@ -71,9 +71,6 @@ install: foma libfoma
cd $(libdir); chmod 755 $(LIBS); \
if test -f $(libdir)/$(SHAREDLIB); then rm $(libdir)/$(SHAREDLIB); fi
if test -f $(libdir)/$(SHAREDLIBM); then rm $(libdir)/$(SHAREDLIBM); fi
- cd $(libdir); ln -s $(SHAREDLIBV) $(SHAREDLIB); cd $(libdir); \
- ln -s $(SHAREDLIBV) $(SHAREDLIBM); (ldconfig || true) \
- >/dev/null 2>&1; \
$(OBJS): foma.h

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-flookup_c,v 1.1.1.1 2012/10/20 04:34:32 bentley Exp $
--- flookup.c.orig Wed Oct 10 03:07:37 2012
+++ flookup.c Wed Oct 10 03:07:53 2012
@@ -21,6 +21,7 @@
#include <limits.h>
#include <getopt.h>
#include <unistd.h>
+#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>

16
math/foma/pkg/DESCR Normal file
View File

@ -0,0 +1,16 @@
Foma is a compiler, programming language, and C library for constructing
finite-state automata and transducers for various uses. It has specific
support for many natural language processing applications such as
producing morphological analyzers. Although NLP applications are
probably the main use of foma, it is sufficiently generic to use for a
large number of purposes.
The foma interface is similar to the Xerox xfst interface, and supports
most of the commands and the regular expression syntax in xfst. Many
grammars written for xfst compile out-of-the-box with foma.
The library contains efficient implementations of all classical
automata/transducer algorithms: determinization, minimization,
epsilon-removal, composition, boolean operations. Also, more advanced
construction methods are available: context restriction, quotients,
first-order regular logic, transducers from replacement rules, etc.

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2012/10/20 04:34:32 bentley Exp $
@lib lib/libfoma.so.${LIBfoma_VERSION}

8
math/foma/pkg/PLIST Normal file
View File

@ -0,0 +1,8 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/10/20 04:34:32 bentley Exp $
%%SHARED%%
@bin bin/cgflookup
@bin bin/flookup
@bin bin/foma
include/fomalib.h
include/fomalibconf.h
lib/libfoma.a