# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit eutils autotools qt3 qt4 linux-info DESCRIPTION="A personal full text search package" HOMEPAGE="http://www.lesbonscomptes.com/recoll/" SRC_URI="http://www.lesbonscomptes.com/recoll/${P}.tar.gz" RESTRICT="mirror" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" PATCHES=( "${FILESDIR}/${P}-detect-qt4.patch" ) INDEX_HELPERS="pdf gs msdoc msxls msppt wordperfect rtf dvi djvu mp3 exif" IUSE="+spell +inotify qt3 qt4 xattr fam $INDEX_HELPERS" DEPEND=" virtual/libiconv >=dev-libs/xapian-1.0.5 spell? ( app-text/aspell ) !inotify? ( fam? ( virtual/fam ) ) qt4? ( x11-libs/qt-gui:4[qt3support] x11-libs/qt-core:4[qt3support] ) !qt4? ( qt3? ( =x11-libs/qt-3.3* ) !qt3? ( || ( ( x11-libs/qt-gui:4[qt3support] x11-libs/qt-core:4[qt3support] ) ( =x11-libs/qt-3.3* ) ) ) ) " RDEPEND=" ${DPEND} app-arch/unzip pdf? ( app-text/xpdf ) gs? ( app-text/pstotext ) msdoc? ( app-text/antiword ) msxls? ( app-text/catdoc ) msppt? ( app-text/catdoc ) wordperfect? ( app-text/libwpd ) rtf? ( app-text/unrtf ) dvi? ( virtual/tex-base ) djvu? ( >=app-text/djvu-3.5.15 ) mp3? ( media-libs/id3lib ) exif? ( media-libs/exiftool ) " pkg_setup() { local i used_helpers qt4_pkg_setup if use inotify; then CONFIG_CHECK="~INOTIFY_USER" else CONFIG_CHECK="" fi linux-info_pkg_setup if use pdf ; then einfo einfo "You are building with pdf support enabled. If you don't already" einfo "have xpdf on your system and are concerned that Recoll is" einfo "pulling in not only xpdf, but also unwanted xpdf-dependencies" einfo "like openmotif, then you should consider building xpdf first," einfo "with graphics support disabled." einfo fi used_helpers=0 for i in $INDEX_HELPERS; do if use $i; then (( used_helpers++ )) fi done if [[ $used_helpers -eq 0 ]]; then ewarn ewarn "You did not select any of the external helpers needed for Recoll." ewarn ebeep 3 epause fi } src_configure() { local qtconf famconf if use qt4; then qtconf="QMAKEPATH=/usr/bin/qmake" elif use qt3; then qtconf="QMAKEPATH=${QTDIR}/bin/qmake" else qtconf="" fi if use inotify && use fam; then ewarn ewarn "You have enabled both the inotify and the fam use flags. Recoll" ewarn "can only support one of these mechanisms at a time. FAM support" ewarn "will be disabled. Building with inotify support." ewarn ebeep 1 epause 3 famconf="--without-fam" else famconf="$(use_with fam)" fi econf \ $(use_with spell aspell) \ $(use_enable xattr) \ $(use_with inotify) \ ${famconf} \ ${qtconf} \ || die "Configure failed." } src_install() { einstall || die "Installation failed." dodoc ChangeLog README VERSION doman doc/man/*.1 doc/man/*.5 mv "${D}/usr/share/${PN}/doc" "${D}/usr/share/doc/${PF}/html" ln -s "${D}/usr/share/doc/${PF}/html" "${D}/usr/share/${PN}/doc" } pkg_postinst() { einfo einfo einfo "If you have installed Recoll for the first time, you have" einfo "two ways of configuring it. In both cases, you begin by" einfo "launching Recoll as user. A dialog box will appear, giving" einfo "the choice of 'OK' or 'Cancel'. Select'OK' if you want Recoll" einfo "to use the default configuration files -- recoll.conf," einfo "mimeconf & mimemap -- located at /usr/share/recoll/examples." einfo "Select cancel if you want to customize your configuration" einfo "before indexing begins. You can do so by editing three files" einfo "of the same name located in ~/.recoll/. You can also use this" einfo "method if you chose the default configuration and later want to" einfo "customize it." einfo einfo einfo "If you are upgrading from a version of Recoll prior to" einfo "1.4.2, you may want to modify the configuration files in your" einfo "home directory. Recoll now takes its configuration settings" einfo "from the systemwide files. You needn't use the local versions" einfo "unless you want to override the global settings." einfo einfo if use xattr; then einfo "Use flag \"xattr\" enables support for fetching field values" einfo "from extended file attributes. You will also need to set up a" einfo "map from the attributes names to the Recoll field names" einfo "(see comment at the end of the fields configuration file." fi }