aboutsummaryrefslogtreecommitdiff
blob: d2f5bfe47240499a646ad9fd37f5ac5e9f7a4d0c (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit autotools multilib

DESCRIPTION="NFSv4 ID <-> name mapping library"
HOMEPAGE="http://www.citi.umich.edu/projects/nfsv4/linux/"
#SRC_URI="http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${P}.tar.gz"
SRC_URI="https://fedorapeople.org/~steved/${PN}/${PV}/${P}.tar.bz2"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
IUSE="ldap static-libs"

DEPEND="ldap? ( net-nds/openldap )"
RDEPEND="
	${DEPEND}
	!<net-fs/nfs-utils-1.2.2
	!net-fs/idmapd
"

PATCHES=(
	"${FILESDIR}"/${PN}-0.27-getgrouplist.patch #169909
	"${FILESDIR}"/${PN}-0.21-headers.patch
)

src_prepare() {
	default
	# Ideally the build would use -DLIBDIR=$(libdir) at build time.
	sed -i \
		-e "/PATH_PLUGINS/s:/usr/lib/libnfsidmap:${EPREFIX}/usr/$(get_libdir)/libnfsidmap:" \
		libnfsidmap.c || die #504666

	if use elibc_musl ; then
		"${FILESDIR}"/${PN}-0.27-configure-musl.patch
		"${FILESDIR}"/0001-add_missing_header_musl.patch
	fi

	eautoreconf
}

src_configure() {
	local myeconfargs=(
		--disable-dependency-tracking
		$(use_enable static-libs static)
		$(use_enable ldap)
	)
	econf "${myeconfargs[@]}"
}

src_install() {
	default

	insinto /etc
	doins idmapd.conf

	# remove useless files
	rm -f "${ED%/}"/usr/$(get_libdir)/libnfsidmap/*.{a,la}
	use static-libs || find "${ED%/}"/usr -name '*.la' -delete || die
}