c628d1b0675e9818a1f8f9ef7a1f5c86199766ec
[gentoo.git] / app-text / groonga / groonga-8.0.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit libtool user
7
8 DESCRIPTION="An Embeddable Fulltext Search Engine"
9 HOMEPAGE="https://groonga.org/"
10 SRC_URI="https://packages.groonga.org/source/${PN}/${P}.tar.gz"
11
12 LICENSE="LGPL-2.1"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="abort benchmark debug doc dynamic-malloc-change +exact-alloc-count examples fmalloc futex jemalloc libedit libevent lzo +mecab msgpack +nfkc sphinx static-libs uyield zeromq zlib zstd"
16
17 RDEPEND=">=dev-libs/onigmo-6.1.1:0=
18         benchmark? ( >=dev-libs/glib-2.8 )
19         jemalloc? ( dev-libs/jemalloc:0= )
20         libedit? ( >=dev-libs/libedit-3 )
21         libevent? ( dev-libs/libevent:0= )
22         lzo? ( dev-libs/lzo )
23         mecab? ( >=app-text/mecab-0.80 )
24         msgpack? ( dev-libs/msgpack )
25         sphinx? ( >=dev-python/sphinx-1.0.1 )
26         zeromq? ( net-libs/zeromq:0= )
27         zlib? ( sys-libs/zlib:0= )
28         zstd? ( app-arch/zstd:0= )"
29 DEPEND="${RDEPEND}
30         virtual/pkgconfig
31         sphinx? ( dev-python/sphinx )"
32
33 REQUIRED_USE=" abort? ( dynamic-malloc-change ) fmalloc? ( dynamic-malloc-change ) sphinx? ( doc )"
34
35 pkg_setup() {
36         enewgroup groonga
37         enewuser groonga -1 -1 -1 groonga
38 }
39
40 src_prepare() {
41         default_src_prepare
42         elibtoolize
43 }
44
45 src_configure() {
46         # httpd is a bundled copy of nginx; disabled for security reasons
47         # prce only is used with httpd
48         # Apache arrow, kytea and libstemmer are not available in Gentoo repo
49         # ruby is only used for an http test
50         local econfopts=(
51                 --disable-groonga-httpd
52                 --without-pcre
53                 --without-kytea
54                 --without-libstemmer
55                 --disable-arrow
56                 --with-log-path="${EROOT%/}/var/log/${PN}.log"
57                 --docdir="${EROOT%/}/usr/share/doc/${P}"
58                 --without-ruby
59                 --with-shared-onigmo
60                 --with-onigmo=system
61                 $(use_enable abort)
62                 $(use_enable benchmark)
63                 $(use_enable debug memory-debug)
64                 $(use_enable doc document)
65                 $(use_enable dynamic-malloc-change)
66                 $(use_enable exact-alloc-count)
67                 $(use_enable fmalloc)
68                 $(use_enable futex)
69                 $(use_with jemalloc)
70                 $(use_enable libedit)
71                 $(use_with libevent)
72                 $(use_with lzo)
73                 $(use_with mecab)
74                 $(use_enable msgpack message-pack)
75                 $(use_with msgpack message-pack "${EROOT%/}/usr")
76                 $(use_enable nfkc)
77                 $(use_with sphinx sphinx-build)
78                 $(use_enable static-libs static)
79                 $(use_enable uyield)
80                 $(use_enable zeromq)
81                 $(use_with zlib)
82                 $(use_with zstd)
83         )
84         econf "${econfopts[@]}"
85 }
86
87 src_install() {
88         local DOCS=( README.md )
89         default
90
91         find "${D}" -name '*.la' -delete || die
92
93         newinitd "${FILESDIR}/${PN}.initd" ${PN}
94         newconfd "${FILESDIR}/${PN}.confd" ${PN}
95
96         keepdir /var/{log,lib}/${PN}
97         fowners groonga:groonga /var/{log,lib}/${PN}
98
99         use examples || rm -r "${D%/}/usr/share/${PN}" || die
100 }