# Copyright 1999-2010 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" INDEX_HELPERS="pdf gs msdoc msxls msppt wordperfect rtf tex dvi djvu mp3 flac ogg exif chm ics zip lyx" IUSE="+spell +inotify +gui +session camelcase qt3 qt4 xattr fam $INDEX_HELPERS" DEPEND=" virtual/libiconv >=dev-libs/xapian-1.0.5 sys-libs/zlib spell? ( app-text/aspell ) !inotify? ( fam? ( virtual/fam ) ) gui? ( || ( qt4? ( x11-libs/qt-gui:4[qt3support] x11-libs/qt-core:4[qt3support] ) qt3? ( =x11-libs/qt-3.3* ) || ( ( x11-libs/qt-gui:4[qt3support] x11-libs/qt-core:4[qt3support] ) ( =x11-libs/qt-3.3* ) ) ) ) session? ( inotify? ( x11-libs/libX11 x11-libs/libSM x11-libs/libICE ) !inotify? ( fam? ( x11-libs/libX11 x11-libs/libSM x11-libs/libICE ) ) ) " RDEPEND=" ${DEPEND} app-arch/unzip sys-apps/sed || ( sys-apps/gawk sys-apps/mawk ) 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 ) tex? ( dev-tex/detex ) dvi? ( virtual/tex-base ) djvu? ( >=app-text/djvu-3.5.15 ) mp3? ( media-libs/id3lib ) flac? ( media-libs/flac ) ogg? ( media-sound/vorbis-tools ) exif? ( media-libs/exiftool ) chm? ( virtual/python dev-python/pychm ) ics? ( virtual/python dev-python/icalendar ) zip? ( virtual/python ) lyx? ( app-office/lyx ) " 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 enable any of the optional file format flags." ewarn "Recoll can read some file formats natively, but many of them" ewarn "are optional since they require external helpers." ewarn ebeep 1 epause fi } src_prepare() { default epatch "${FILESDIR}/${P}-gentoo1.patch" # we've changed configure.ac, need to re-generate the build system eautoreconf } src_configure() { local qtconf famconf x11monconf if use gui; then if use qt4; then qtconf="QMAKEPATH=/usr/bin/qmake" elif use qt3; then qtconf="QMAKEPATH=${QTDIR}/bin/qmake" else qtconf="" fi 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 if use session && ! ( use inotify || use fam ); then ewarn ewarn "You have enabled the session use flag for X11 session monitoring" ewarn "support, but real-time indexing is not enabled. Session support" ewarn "will be disabled. To enable real-time indexing (and session" ewarn "support), enable either the inotify or fam use flags." ewarn ebeep 3 epause 3 x11monconf="--disable-x11mon" else x11monconf=$(use_enable session x11mon) fi econf \ $(use_with spell aspell) \ $(use_enable xattr) \ $(use_with inotify) \ $(use_enable gui qtgui) \ $(use_enable camelcase) \ ${x11monconf} \ ${famconf} \ ${qtconf} \ || die "Configure failed." } src_install() { einstall || die "Installation failed." dodoc ChangeLog README VERSION 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 }