| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-misc/sphinx/sphinx-2.0.5.ebuild,v 1.1 2012/09/20 05:20:19 graaff Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
inherit eutils autotools
|
| 7 |
|
| 8 |
#MY_P=${P/_/-}
|
| 9 |
MY_P=${P}-release
|
| 10 |
|
| 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
|
| 13 |
# fetched.
|
| 14 |
STEMMER_PV="20091122"
|
| 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 )"
|
| 19 |
|
| 20 |
LICENSE="GPL-2"
|
| 21 |
SLOT="0"
|
| 22 |
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris"
|
| 23 |
IUSE="debug id64 mysql odbc postgres stemmer test"
|
| 24 |
|
| 25 |
RDEPEND="mysql? ( virtual/mysql )
|
| 26 |
postgres? ( dev-db/postgresql-base )
|
| 27 |
odbc? ( dev-db/unixODBC )
|
| 28 |
virtual/libiconv"
|
| 29 |
DEPEND="${RDEPEND}
|
| 30 |
test? ( dev-lang/php )"
|
| 31 |
|
| 32 |
S=${WORKDIR}/${MY_P}
|
| 33 |
|
| 34 |
src_unpack() {
|
| 35 |
unpack ${MY_P}.tar.gz
|
| 36 |
if use stemmer; then
|
| 37 |
cd "${S}"
|
| 38 |
unpack libstemmer_c-${STEMMER_PV}.tgz
|
| 39 |
fi
|
| 40 |
}
|
| 41 |
|
| 42 |
src_prepare() {
|
| 43 |
epatch "${FILESDIR}"/${PN}-2.0.1_beta-darwin8.patch
|
| 44 |
|
| 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
|
| 49 |
|
| 50 |
pushd api/libsphinxclient || die
|
| 51 |
eautoreconf
|
| 52 |
popd || die
|
| 53 |
}
|
| 54 |
|
| 55 |
src_configure() {
|
| 56 |
# fix libiconv detection
|
| 57 |
use !elibc_glibc && export ac_cv_search_iconv=-liconv
|
| 58 |
|
| 59 |
econf \
|
| 60 |
--sysconfdir="${EPREFIX}/etc/${PN}" \
|
| 61 |
$(use_enable id64) \
|
| 62 |
$(use_with debug) \
|
| 63 |
$(use_with mysql) \
|
| 64 |
$(use_with odbc unixodbc) \
|
| 65 |
$(use_with postgres pgsql) \
|
| 66 |
$(use_with stemmer libstemmer)
|
| 67 |
|
| 68 |
cd api/libsphinxclient || die
|
| 69 |
econf STRIP=:
|
| 70 |
}
|
| 71 |
|
| 72 |
src_compile() {
|
| 73 |
emake || die "emake failed"
|
| 74 |
|
| 75 |
emake -j 1 -C api/libsphinxclient || die "emake libsphinxclient failed"
|
| 76 |
}
|
| 77 |
|
| 78 |
src_test() {
|
| 79 |
elog "Tests require access to a live MySQL database and may require configuration."
|
| 80 |
elog "You will find them in /usr/share/${PN}/test and they require dev-lang/php"
|
| 81 |
}
|
| 82 |
|
| 83 |
src_install() {
|
| 84 |
emake DESTDIR="${D}" install || die "install failed"
|
| 85 |
emake DESTDIR="${D}" -C api/libsphinxclient install || die "install libsphinxclient failed"
|
| 86 |
|
| 87 |
dodoc doc/*
|
| 88 |
|
| 89 |
dodir /var/lib/sphinx
|
| 90 |
dodir /var/log/sphinx
|
| 91 |
dodir /var/run/sphinx
|
| 92 |
|
| 93 |
newinitd "${FILESDIR}"/searchd.rc searchd
|
| 94 |
|
| 95 |
if use test; then
|
| 96 |
insinto /usr/share/${PN}
|
| 97 |
doins -r test
|
| 98 |
fi
|
| 99 |
}
|