1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 inherit toolchain-funcs qmake-utils qt4-r2 linux-info python-single-r1 readme.gentoo
10 DESCRIPTION="A personal full text search package"
11 HOMEPAGE="http://www.lesbonscomptes.com/recoll/"
12 SRC_URI="http://www.lesbonscomptes.com/recoll/${P}.tar.gz"
17 INDEX_HELPERS="chm djvu dvi exif postscript ics info lyx msdoc msppt msxls pdf rtf sound tex wordperfect xml"
18 IUSE="+spell inotify +qt4 +session camelcase xattr webkit fam ${INDEX_HELPERS}"
22 >=dev-libs/xapian-1.0.12
24 spell? ( app-text/aspell )
25 !inotify? ( fam? ( virtual/fam ) )
26 qt4? ( dev-qt/qtcore:4[qt3support] )
27 webkit? ( dev-qt/qtwebkit:4 )
29 inotify? ( x11-libs/libX11 x11-libs/libSM x11-libs/libICE )
30 !inotify? ( fam? ( x11-libs/libX11 x11-libs/libSM x11-libs/libICE ) )
40 pdf? ( app-text/poppler )
41 postscript? ( app-text/pstotext )
42 msdoc? ( app-text/antiword )
43 msxls? ( app-text/catdoc )
44 msppt? ( app-text/catdoc )
45 wordperfect? ( app-text/libwpd:0.9 )
46 rtf? ( app-text/unrtf )
47 tex? ( dev-tex/detex )
48 dvi? ( virtual/tex-base )
49 djvu? ( >=app-text/djvu-3.5.15 )
50 exif? ( media-libs/exiftool )
51 chm? ( dev-python/pychm[${PYTHON_USEDEP}] )
52 ics? ( dev-python/icalendar[${PYTHON_USEDEP}] )
53 lyx? ( app-office/lyx )
54 sound? ( media-libs/mutagen )
55 xml? ( dev-libs/libxslt )
56 info? ( sys-apps/texinfo )
59 REQUIRED_USE="session? ( || ( fam inotify ) )
60 ${PYTHON_REQUIRED_USE}"
64 CONFIG_CHECK="~INOTIFY_USER"
70 python-single-r1_pkg_setup
72 local i at_least_one_helper
75 for i in $INDEX_HELPERS; do
81 if [[ $at_least_one_helper -eq 0 ]]; then
83 ewarn "You did not enable any of the optional file format flags."
84 ewarn "Recoll can read some file formats natively, but many of them"
85 ewarn "are optional since they require external helpers."
91 use xattr && has_version "${CATEGORY}/${PN}:${SLOT}[-xattr]" && FORCE_PRINT_ELOG="yes"
92 ! use xattr && has_version "${CATEGORY}/${PN}:${SLOT}[xattr]" && FORCE_PRINT_ELOG="yes"
94 DOC_CONTENTS="Default configuration files located at
95 /usr/share/${PN}/examples. Either edit these files to match
96 your needs or copy them to ~/.recoll/ and edit these files
99 use xattr && DOC_CONTENTS+="
100 Use flag \"xattr\" enables support for fetching field values
101 from extended file attributes. You will also need to set up a
102 map from the attributes names to the Recoll field names
103 (see comment at the end of the fields configuration file."
105 # remember configure.ac is b0rked. Fix it before using eautoreconf in the
109 # do not strip binaries
110 sed -i -e "/STRIP/d" "${S}"/${PN}install.in \
111 || die "Failed to fix the installation script"
112 # Drop all the QMAKE lines. We will do it ourselves
113 sed -i -e "/QMAKE/d" Makefile.in || die
119 if use qt4 || use webkit; then
120 qtconf="QMAKEPATH=$(qt4_get_bindir)/qmake"
124 $(use_with spell aspell) \
125 $(use_enable xattr) \
126 $(use_with inotify) \
127 $(use_enable qt4 qtgui) \
128 $(use_enable camelcase) \
130 $(use_with inotify) \
131 $(use_enable session x11mon) \
134 cd qtgui && eqmake4 ${PN}.pro && cd ..
139 # Do not let upstream people decide on our behalf
140 sed -i "s:ar ru:$(tc-getAR) ru:" lib/Makefile || die
145 CFLAGS="${CFLAGS} ${LDFLAGS}" \
146 CXXFLAGS="${CXXFLAGS} ${LDFLAGS}"
150 # You probably wonder why I did not fix recollinstall in src_prepare.
151 # --prefix requires an absolute path but recollinstall requires prefix
152 # to be actually 'usr' because double // makes portage sad. And no, I am not
153 # gonna ask upstream to fix the build system
154 sed -i -e "/PREFIX/s:/usr:usr:" "${S}"/${PN}install || die
155 sed -i -e "/prefix/s:/usr:usr:" "${S}"/Makefile || die
157 emake DESTDIR="${D%/}" install
159 dodoc ChangeLog README
160 mv "${D}/usr/share/${PN}/doc" "${D}/usr/share/doc/${PF}/html"
161 dosym /usr/share/doc/${PF}/html /usr/share/${PN}/doc
163 readme.gentoo_create_doc
167 readme.gentoo_print_elog
169 if [[ -n ${REPLACING_VERSIONS} ]]; then
171 elog "1.18 introduces significant index formats"
172 elog "changes to support optional character case and diacritics"
173 elog "sensitivity, and it will be advisable to reset the index in"
174 elog "most cases. This will be best done by destroying the index"
175 elog "directory (rm -rf ~/.recoll/xapiandb). If 1.18 is not configured"
176 elog "for case and diacritics sensitivity, it is mostly compatible"
177 elog "with 1.17 indexes."