Date: Wed, 16 May 2012 12:34:10 +1000 (EST) From: Peter Jeremy <peter@rulingia.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/167945: [patch] textproc/libexttextcat - make it a replacement for textproc/libtextcat Message-ID: <201205160234.q4G2YAok049133@server.rulingia.com> Resent-Message-ID: <201205160240.q4G2e2Av016466@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 167945 >Category: ports >Synopsis: [patch] textproc/libexttextcat - make it a replacement for textproc/libtextcat >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 16 02:40:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Peter Jeremy >Release: FreeBSD 8.3-STABLE amd64 >Organization: n/a >Environment: System: FreeBSD server.rulingia.com 8.3-STABLE FreeBSD 8.3-STABLE #16 r235229M: Fri May 11 12:02:41 EST 2012 root@server.rulingia.com:/var/obj/usr/src/sys/server amd64 >Description: libexttextcat is a fork of libtextcat that provides additional capabilities needed by LibreOffice. Whilst libexttextcat appears to provide a superset of libtextcat functionality, it mostly uses different file names so libexttextcat is not a drop-in replacement for libtextcat. Unfortunately, both ports install bin/createfp so they are marked conflicting. This makes it impossible to install both editors/libreoffice and ports depending on libtextcat (eg editors/openoffice-3). >How-To-Repeat: Try to install both editors/libreoffice and editors/openoffice-3 >Fix: The following patch optionally adds symlinks from the libexttextcat files to their equivalent libtextcat names. As a side-benefit, it also correctly installs the LICENSE file, misc documentation (as done by libtextcat) anhd adds support for the "make check" target (this latter needs a Makefile patch to remove a dependency on bash - mhich should be installed in the files directory). The approach of renaming the files was tested by compiling editors/openoffice-3. The resultant executable was able to open files, export files and print normally. Note that this patch is against libexttextcat-3.2.0_1 as I don't currently have access to libexttextcat-3.2.0_2. As far as I can see, the patches should still apply, though with some fuzz. Index: Makefile =================================================================== RCS file: /usr/ncvs/ports/textproc/libexttextcat/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- Makefile 22 Jan 2012 10:16:02 -0000 1.2 +++ Makefile 16 May 2012 01:46:46 -0000 @@ -15,6 +15,7 @@ COMMENT= Language guessing by N-Gram-Based Text Categorization LICENSE= BSD +LICENSE_FILE= ${WRKSRC}/LICENSE CONFLICTS_INSTALL= libtextcat* @@ -23,4 +24,46 @@ USE_GNOME= gnomehack USE_LDCONFIG= yes +PORTDOCS= README README.libtextcat TODO + +OPTIONS= COMPAT_TEXTCAT "Install libtextcat compatible files" Off \ + LM_FILES "Install language models" Off + +.include <bsd.port.options.mk> + +.if defined(WITH_COMPAT_TEXTCAT) +PLIST_SUB+= TEXTCAT='' +.else +PLIST_SUB+= TEXTCAT='@comment ' +.endif + +.if defined(WITH_LM_FILES) +PLIST_SUB+= LM='' +.else +PLIST_SUB+= LM='@comment ' +.endif + +post-install: +.if defined(WITH_COMPAT_TEXTCAT) + ${LN} -sf libexttextcat/textcat.h ${PREFIX}/include/ + ${LN} -sf libexttextcat ${PREFIX}/include/libtextcat + ${LN} -sf libexttextcat.a ${PREFIX}/lib/libtextcat.a + ${LN} -sf libexttextcat.la ${PREFIX}/lib/libtextcat.la + ${LN} -sf libexttextcat.so.0 ${PREFIX}/lib/libtextcat.so + ${LN} -sf libexttextcat.so.0 ${PREFIX}/lib/libtextcat.so.0 +.endif +.if defined(WITH_LM_FILES) + ${MKDIR} ${DATADIR}/LM + @${ECHO_MSG} "Installing language models provided in Gertjan van Noord's TextCat package" + (cd ${WRKSRC}/langclass/LM && \ + ${FIND} . -name "*.lm" -exec ${INSTALL_DATA} "{}" "${DATADIR}/LM/{}" \;) +.endif +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR} +.endif + +check: + cd ${WRKSRC}/src && make check + .include <bsd.port.mk> Index: pkg-plist =================================================================== RCS file: /usr/ncvs/ports/textproc/libexttextcat/pkg-plist,v retrieving revision 1.3 diff -u -r1.3 pkg-plist --- pkg-plist 22 Jan 2012 10:16:02 -0000 1.3 +++ pkg-plist 16 May 2012 02:21:44 -0000 @@ -6,10 +6,16 @@ include/libexttextcat/fingerprint.h include/libexttextcat/textcat.h include/libexttextcat/utf8misc.h +%%TEXTCAT%%include/textcat.h +%%TEXTCAT%%include/libtextcat lib/libexttextcat.a lib/libexttextcat.la lib/libexttextcat.so lib/libexttextcat.so.0 +%%TEXTCAT%%lib/libtextcat.a +%%TEXTCAT%%lib/libtextcat.la +%%TEXTCAT%%lib/libtextcat.so +%%TEXTCAT%%lib/libtextcat.so.0 libdata/pkgconfig/libexttextcat.pc @dirrmtry include/libexttextcat @dirrmtry %%DATADIR%% --- src/Makefile.in.bak 2011-11-14 09:27:18.000000000 +1100 +++ src/Makefile.in 2012-05-16 11:43:38.628608090 +1000 @@ -711,7 +711,7 @@ st sv sw ta tet th tg ti tk tl tn tpi tr ts \ tt ty ug uk uz ve vi wa xh yi yo zh-Hans \ zh-Hant zu; do \ - bash ./test-primary.sh $$primarylanguage; \ + sh ./test-primary.sh $$primarylanguage; \ if test x$$? != x0; then \ echo FAIL: $$primarylanguage && exit 1; \ else \ @@ -720,7 +720,7 @@ done @echo secondary languages @for secondarylanguage in sco; do \ - bash ./test-secondary.sh $$secondarylanguage; \ + sh ./test-secondary.sh $$secondarylanguage; \ if test x$$? != x0; then \ echo FAIL: $$secondarylanguage && exit 1; \ else \ >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205160234.q4G2YAok049133>