summaryrefslogtreecommitdiff
path: root/dev-libs/yaz/yaz-5.37.0.ebuild
blob: bb66be4f99f9bdd738b5c1e75ac5624b6f2d9a0c (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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools

DESCRIPTION="C/C++ toolkit for Z39.50v3 clients and servers"
HOMEPAGE="https://www.indexdata.com/resources/software/yaz/"

if [[ ${PV} == *9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/indexdata/yaz.git"
else
	SRC_URI="https://ftp.indexdata.com/pub/${PN}/${P}.tar.gz"
	KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ppc ppc64 ~s390 ~sparc x86"
fi

LICENSE="BSD"
SLOT="0/5"
IUSE="memcached redis tcpd"

RDEPEND="
	dev-libs/icu:=
	dev-libs/libxml2:=
	dev-libs/libxslt
	net-libs/gnutls:=
	sys-libs/readline:=
	virtual/libintl
	memcached? (
		|| (
			dev-libs/libmemcached-awesome
			dev-libs/libmemcached
		)
	)
	redis? ( dev-libs/hiredis:= )
	tcpd? ( sys-apps/tcp-wrappers )
"
DEPEND="${RDEPEND}"
BDEPEND="
	app-alternatives/yacc
	dev-build/libtool:2
	dev-lang/tcl:0
	virtual/pkgconfig
"

DOCS=( NEWS README.md )

src_prepare() {
	default

	# Hardcoded assumption of libraries residing in lib/,  bug #730016
	if [[ $(get_libdir) != lib ]]; then
		sed -i -e "s|/lib\"|/$(get_libdir)\"|" configure.ac || die
	fi

	eautoreconf
}

src_configure() {
	local myeconfargs=(
		$(use_with memcached)
		$(use_with redis)
		$(use_enable tcpd tcpd /usr)
	)
	econf "${myeconfargs[@]}"
}

src_install() {
	local myemakeargs=(
		DESTDIR="${D}"
		docdir="${EPREFIX}/usr/share/doc/${PF}/html"
		# move common dir in html
		PACKAGE_SUFFIX="-${PVR}/html"
	)
	emake "${myemakeargs[@]}" install

	find "${D}" -name '*.la' -delete || die

	einstalldocs
}