1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils autotools toolchain-funcs
11 # This has been added by Gentoo, to explicitly version libstemmer.
12 # It is the date that http://snowball.tartarus.org/dist/libstemmer_c.tgz was
15 DESCRIPTION="Full-text search engine with support for MySQL and PostgreSQL"
16 HOMEPAGE="http://www.sphinxsearch.com/"
17 SRC_URI="http://sphinxsearch.com/files/${MY_P}.tar.gz
18 stemmer? ( mirror://gentoo/libstemmer_c-${STEMMER_PV}.tgz )"
22 KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc x86 ~amd64-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris"
23 IUSE="debug id64 mysql odbc postgres stemmer test"
25 RDEPEND="mysql? ( virtual/mysql )
26 postgres? ( dev-db/postgresql )
27 odbc? ( dev-db/unixODBC )
30 test? ( dev-lang/php )"
38 unpack libstemmer_c-${STEMMER_PV}.tgz
43 epatch "${FILESDIR}"/${PN}-2.0.1_beta-darwin8.patch
45 # drop nasty hardcoded search path breaking Prefix
46 # We patch configure directly since otherwise we need to run
47 # eautoreconf twice and that causes problems, bug 425380
48 sed -i -e 's/\/usr\/local\//\/someplace\/nonexisting\//g' configure || die
50 # Fix QA compilation warnings.
51 sed -i -e '19i#include <string.h>' api/libsphinxclient/test.c || die
53 pushd api/libsphinxclient || die
59 # fix libiconv detection
60 use !elibc_glibc && export ac_cv_search_iconv=-liconv
63 --sysconfdir="${EPREFIX}/etc/${PN}" \
67 $(use_with odbc unixodbc) \
68 $(use_with postgres pgsql) \
69 $(use_with stemmer libstemmer)
71 cd api/libsphinxclient || die
76 emake AR="$(tc-getAR)" || die "emake failed"
78 emake -j 1 -C api/libsphinxclient || die "emake libsphinxclient failed"
82 elog "Tests require access to a live MySQL database and may require configuration."
83 elog "You will find them in /usr/share/${PN}/test and they require dev-lang/php"
87 emake DESTDIR="${D}" install || die "install failed"
88 emake DESTDIR="${D}" -C api/libsphinxclient install || die "install libsphinxclient failed"
95 newinitd "${FILESDIR}"/searchd.rc searchd
98 insinto /usr/share/${PN}