app-text/docbook-sgml-utils: x86 stable (bug #647676)
[gentoo.git] / app-text / namazu / namazu-2.0.21.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5
6 inherit autotools elisp-common ltprune
7
8 DESCRIPTION="Namazu is a full-text search engine"
9 HOMEPAGE="http://www.namazu.org/"
10 SRC_URI="http://www.namazu.org/stable/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ~ppc ~ppc64 x86"
15 IUSE="emacs l10n_ja nls static-libs tk"
16
17 RDEPEND="dev-perl/File-MMagic
18         emacs? ( virtual/emacs )
19         l10n_ja? (
20                 app-i18n/nkf
21                 || (
22                         dev-perl/Text-Kakasi
23                         app-i18n/kakasi
24                         app-text/chasen
25                         app-text/mecab
26                 )
27         )
28         nls? ( virtual/libintl )
29         tk? (
30                 dev-lang/tk:0
31                 www-client/lynx
32         )"
33 DEPEND="${RDEPEND}
34         nls? ( sys-devel/gettext )"
35
36 PATCHES=(
37         "${FILESDIR}"/${PN}-gentoo.patch
38         "${FILESDIR}"/${PN}-perl-5.18.patch
39         "${FILESDIR}"/${PN}-perl-5.26.patch
40         "${FILESDIR}"/${P}-memmove.patch
41 )
42
43 src_prepare() {
44         default
45
46         mv configure.{in,ac}
47         mv tk${PN}/configure.{in,ac}
48         eautoreconf
49 }
50
51 src_configure() {
52         local myconf=(
53                 $(use_enable nls)
54                 $(use_enable static-libs static)
55                 $(use_enable tk tk${PN})
56         )
57         use tk && myconf+=(
58                 --with-${PN}="${EPREFIX}"/usr/bin/${PN}
59                 --with-mknmz="${EPREFIX}"/usr/bin/mknmz
60                 --with-indexdir="${EPREFIX}"/var/lib/${PN}/index
61         )
62
63         econf "${myconf[@]}"
64 }
65
66 src_compile() {
67         emake
68
69         if use emacs; then
70                 cd lisp
71                 rm -f browse*
72                 elisp-compile *.el
73         fi
74 }
75
76 src_test() {
77         emake -j1 check
78 }
79
80 src_install () {
81         emake DESTDIR="${D}" install
82
83         if use emacs; then
84                 elisp-install ${PN} lisp/*.el*
85                 elisp-site-file-install "${FILESDIR}"/50${PN}-gentoo.el
86
87                 docinto lisp
88                 dodoc lisp/ChangeLog*
89         fi
90
91         prune_libtool_files
92 }
93
94 pkg_postinst() {
95         use emacs && elisp-site-regen
96 }
97
98 pkg_postrm() {
99         use emacs && elisp-site-regen
100 }