summaryrefslogtreecommitdiff
blob: 8d57b0e5812d0dd6b4d6d91579e932267458b0a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI="6"

inherit autotools java-pkg-opt-2 perl-functions

IUSE="bzip2 debug java lzo mecab perl ruby +zlib"

DESCRIPTION="a full-text search system for communities"
HOMEPAGE="http://fallabs.com/hyperestraier/"
SRC_URI="http://fallabs.com/hyperestraier/${P}.tar.gz"

LICENSE="LGPL-2.1"
KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd"
SLOT="0"

RDEPEND="dev-db/qdbm
	bzip2? ( app-arch/bzip2 )
	java? ( >=virtual/jre-1.4:* )
	lzo? ( dev-libs/lzo )
	mecab? ( app-text/mecab )
	perl? ( dev-lang/perl )
	ruby? ( dev-lang/ruby:= )
	zlib? ( sys-libs/zlib )"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	java? ( >=virtual/jdk-1.4:* )"

PATCHES=(
	"${FILESDIR}"/${PN}-configure.patch
	"${FILESDIR}"/${PN}-perl.patch
	"${FILESDIR}"/${PN}-ruby19.patch
)
HTML_DOCS=( doc/. )

AT_NOELIBTOOLIZE="yes"

he_foreach_api() {
	local u d
	for u in java perl ruby; do
		if ! use "${u}"; then
			continue
		fi
		for d in ${u}native ${u}pure; do
			if [[ ! -d "${d}" ]]; then
				continue
			fi
			einfo "${EBUILD_PHASE} ${d}"
			cd "${d}"
			case "${EBUILD_PHASE}" in
			prepare)
				mv configure.{in,ac}
				eautoreconf
				;;
			configure)
				econf
				;;
			compile)
				emake
				;;
			test)
				if [[ "${d}" == "${u}native" ]]; then
					emake check
				fi
				;;
			install)
				if [[ "${u}" != "java" ]]; then
					emake DESTDIR="${D}" install
				else
					java-pkg_dojar *.jar
					if [[ "${d}" == "${u}native" ]]; then
						dolib.so lib*.so*
					fi
				fi
				;;
			esac
			cd - >/dev/null
		done
	done
}

src_prepare() {
	default
	java-pkg-opt-2_src_prepare

	sed -i \
		-e "/^CFLAGS/s|$| ${CFLAGS}|" \
		-e "/^JAVACFLAGS/s|$| ${JAVACFLAGS}|" \
		-e '/^LDENV/d' \
		-e 's/make\( \|$\)/$(MAKE)\1/g' \
		Makefile.in {java,perl,ruby}*/Makefile.in

	mv configure.{in,ac}
	eautoreconf
	he_foreach_api # prepare
}

src_configure() {
	econf \
		$(use_enable bzip2 bzip) \
		$(use_enable debug) \
		$(use_enable lzo) \
		$(use_enable mecab) \
		$(use_enable zlib)
	he_foreach_api
}

src_compile() {
	default
	he_foreach_api
}

src_test() {
	default
	he_foreach_api
}

src_install() {
	emake DESTDIR="${D}" MYDOCS= install
	einstalldocs
	he_foreach_api

	if use perl; then
		perl_delete_module_manpages
		perl_fix_packlist
	fi

	rm -f "${D}"/usr/bin/*test
}