diff options
author | miwi <miwi@FreeBSD.org> | 2012-02-07 14:32:04 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2012-02-07 14:32:04 +0800 |
commit | 39c9a147957c0fce568803a82b847aa180d29d38 (patch) | |
tree | d6b41fe2df83fd7ad94217d55bcec6f509887915 /textproc/sphinxsearch | |
parent | f61519484e9fc467a2f1a61bdbf3d93a3cfbe607 (diff) | |
download | freebsd-ports-gnome-39c9a147957c0fce568803a82b847aa180d29d38.tar.gz freebsd-ports-gnome-39c9a147957c0fce568803a82b847aa180d29d38.tar.zst freebsd-ports-gnome-39c9a147957c0fce568803a82b847aa180d29d38.zip |
* Add libstemmer support, disabled by default. This adds stemming
support for French, Spanish, Portuguese, Italian, Romanian,
German, Dutch, Swedish, Norwegian, Danish, Finnish and Hungarian
* Clean up various OPTIONS related make code: if WITH_FOO is defined,
then WITHOUT_FOO isn't, and vice-versa. Even if make config has
never been run.
* Fix build with clang
PR: 164635
Submitted by: Matthew Seaman <m.seaman@infracaninophile.co.uk> (maintainer)
Diffstat (limited to 'textproc/sphinxsearch')
-rw-r--r-- | textproc/sphinxsearch/Makefile | 66 | ||||
-rw-r--r-- | textproc/sphinxsearch/distinfo | 2 | ||||
-rw-r--r-- | textproc/sphinxsearch/files/patch-configure | 14 | ||||
-rw-r--r-- | textproc/sphinxsearch/files/patch-src_sphinxexpr.cpp | 32 |
4 files changed, 88 insertions, 26 deletions
diff --git a/textproc/sphinxsearch/Makefile b/textproc/sphinxsearch/Makefile index 76ec85486386..a339d9a0853a 100644 --- a/textproc/sphinxsearch/Makefile +++ b/textproc/sphinxsearch/Makefile @@ -14,6 +14,7 @@ PORTREVISION= 1 CATEGORIES= textproc databases MASTER_SITES= http://sphinxsearch.com/files/ DISTNAME= sphinx-${PORTVERSION}-release +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= m.seaman@infracaninophile.co.uk COMMENT= Sphinx Full-Text Search Engine @@ -31,10 +32,8 @@ OPTIONS= MYSQL "MySQL support" on \ OPTIMIZED_CFLAGS "Use compiler optimization (-O3)" off \ ID64 "use 64-bit document and word IDs" off \ UNIXODBC "unixODBC support" off \ - SYSLOG "enable logging via syslog" on - -## FFR -## LIBSTEMMER "compile with libstemmer support" off + SYSLOG "enable logging via syslog" on \ + LIBSTEMMER "compile with libstemmer support" off CONFLICTS= sphinxsearch-devel-[0-9]* @@ -43,21 +42,21 @@ CONFLICTS= sphinxsearch-devel-[0-9]* # The port will successfully compile with both PGSQL and MYSQL support # simultaneously. Not sure how useful that is in practice though. -.if defined(WITH_MYSQL) && !defined(WITHOUT_MYSQL) +.if defined(WITH_MYSQL) CONFIGURE_ARGS+= --with-mysql USE_MYSQL= yes .else CONFIGURE_ARGS+= --without-mysql .endif -.if defined(WITH_PGSQL) && !defined(WITHOUT_PGSQL) +.if defined(WITH_PGSQL) CONFIGURE_ARGS+= --with-pgsql USE_PGSQL= yes .else CONFIGURE_ARGS+= --without-pgsql .endif -.if defined(WITH_ICONV) && !defined(WITHOUT_ICONV) +.if defined(WITH_ICONV) CONFIGURE_ARGS+= --with-iconv USE_ICONV= yes .else @@ -82,29 +81,38 @@ LIB_DEPENDS+= odbc.2:${PORTSDIR}/databases/unixODBC CONFIGURE_ARGS+= --without-unixodbc .endif -.if defined(WITH_SYSLOG) && !defined(WITHOUT_SYSLOG) +.if defined(WITH_SYSLOG) CONFIGURE_ARGS+= --with-syslog .else CONFIGURE_ARGS+= --without-syslog .endif -## FFR. The snowball project doesn't release numbered versions of -## it's pre-processors. Instead, at arbitrary intervals a snapshot of -## their source repository is turned into a tarball (always the same -## filename) and placed on their web site. It's like they want to -## make it as hard as possible for anyone to package and use their -## software. -## -## # Adds support for two additional word stemmming pre-processors -## # from the Snowball project (http://snowball.tartarus.org/) -- -## # these essentially do exactly the same thing as the built in -## # English and Russian stemmers but are slightly slower and may -## # produce subtly different output. Disabled by default. -## .if defined(WITH_LIBSTEMMER) && !defined(WITHOUT_LIBSTEMMER) -## CONFIGURE_ARGS+= --with-libstemmer -## .else -## CONFIGURE_ARGS+= --without-libstemmer -## .endif +# Note: The snowball project doesn't release numbered versions of it's +# pre-processors. Instead, at arbitrary but fairly long intervals a +# snapshot of their source repository is turned into a tarball (always +# the same filename) and placed on their web site. It's like they +# want to make it as hard as possible for anyone to package and use +# their software. +# +# Adds support for two additional word stemmming pre-processors from +# the Snowball project (http://snowball.tartarus.org/) -- these +# essentially do exactly the same thing as the built in English, +# Russian and Czech stemmers but also support French, Spanish, +# Portuguese, Italian, Romanian, German, Dutch, Swedish, Norwegian, +# Danish, Finnish, Hungarian. Disabled by default. + +.if defined(WITH_LIBSTEMMER) || make(makesum) || defined(FETCH_ALL) +MASTER_SITES+= http://snowball.tartarus.org/dist/:libstemmer +LIBSTEMMER_TGZ= libstemmer_c.tgz +DISTFILES+= ${LIBSTEMMER_TGZ}:libstemmer +EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} +.endif + +.if defined(WITH_LIBSTEMMER) +CONFIGURE_ARGS+= --with-libstemmer +.else +CONFIGURE_ARGS+= --without-libstemmer +.endif USERS?= _sphinx GROUPS?= _sphinx @@ -138,8 +146,14 @@ PORTEXAMPLES= * DOCS= doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml .endif -# Fix up the sample configuration file to correspond to FreeBSD norms +post-extract: +.if defined(WITH_LIBSTEMMER) + @( cd ${WRKSRC} && \ + ${GZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${LIBSTEMMER_TGZ} \ + ${EXTRACT_AFTER_ARGS} ) +.endif +# Fix up the sample configuration file to correspond to FreeBSD norms post-patch: @${REINPLACE_CMD} \ -e "s!@CONFDIR@/log/searchd.pid!${SPHINX_RUN}/searchd.pid!" \ diff --git a/textproc/sphinxsearch/distinfo b/textproc/sphinxsearch/distinfo index db70671a46dd..e2e27e0d6db2 100644 --- a/textproc/sphinxsearch/distinfo +++ b/textproc/sphinxsearch/distinfo @@ -1,2 +1,4 @@ SHA256 (sphinx-2.0.3-release.tar.gz) = 875af63473875b7c7e152e85ed34bd1a92d09db062a289b594bf049b3a8c82dd SIZE (sphinx-2.0.3-release.tar.gz) = 1923911 +SHA256 (libstemmer_c.tgz) = e9c3a2c13acf34945054e35ad53b7410c61f046d4044c0ade620fdac253bab46 +SIZE (libstemmer_c.tgz) = 129529 diff --git a/textproc/sphinxsearch/files/patch-configure b/textproc/sphinxsearch/files/patch-configure new file mode 100644 index 000000000000..e55be031654c --- /dev/null +++ b/textproc/sphinxsearch/files/patch-configure @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- configure.orig ++++ configure +@@ -4361,7 +4361,7 @@ + + #ifdef __GNUC__ + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3) +-void main() {} ++int main() {return 0;} + #else + syntax error + #endif diff --git a/textproc/sphinxsearch/files/patch-src_sphinxexpr.cpp b/textproc/sphinxsearch/files/patch-src_sphinxexpr.cpp new file mode 100644 index 000000000000..b19e04736ed4 --- /dev/null +++ b/textproc/sphinxsearch/files/patch-src_sphinxexpr.cpp @@ -0,0 +1,32 @@ + +$FreeBSD$ + +--- src/sphinxexpr.cpp.orig ++++ src/sphinxexpr.cpp +@@ -1796,7 +1796,7 @@ + /// evaluate arg, return interval id + virtual int IntEval ( const CSphMatch & tMatch ) const + { +- T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage ++ T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage + ARRAY_FOREACH ( i, this->m_dValues ) // FIXME! OPTIMIZE! perform binary search here + if ( val<this->m_dValues[i] ) + return i; +@@ -1827,7 +1827,7 @@ + /// evaluate arg, return interval id + virtual int IntEval ( const CSphMatch & tMatch ) const + { +- T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage ++ T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage + ARRAY_FOREACH ( i, m_dTurnPoints ) + if ( val < Expr_ArgVsSet_c<T>::ExprEval ( m_dTurnPoints[i], tMatch ) ) + return i; +@@ -1873,7 +1873,7 @@ + /// evaluate arg, check if the value is within set + virtual int IntEval ( const CSphMatch & tMatch ) const + { +- T val = ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage ++ T val = this->ExprEval ( this->m_pArg, tMatch ); // 'this' fixes gcc braindamage + return this->m_dValues.BinarySearch ( val )!=NULL; + } + |