summaryrefslogtreecommitdiff
blob: 93bc10d01ca61cdeffe0682ac0f107bc30cae719 (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
PYTHON_COMPAT=( python3_{6,7} )
inherit python-any-r1 autotools

DESCRIPTION="Extended crypt library for descrypt, md5crypt, bcrypt, and others "
SRC_URI="https://github.com/besser82/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
HOMEPAGE="https://github.com/besser82/libxcrypt"

LICENSE="LGPL-2.1+ public-domain BSD BSD-2"
SLOT="0/2"
KEYWORDS="~amd64 ~x86"
IUSE="split-usr test"

BDEPEND="sys-apps/findutils
	test? ( ${PYTHON_DEPS} )"

# Gentoo CI complained about not having this
RESTRICT="!test? ( test )"

PATCHES=(
	"${FILESDIR}/libxcrypt-4.4.10-pythonver.patch"
)

pkg_setup() {
	use test && python-any-r1_pkg_setup
}

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	econf \
		--disable-static \
		--enable-obsolete-api=no \
		--libdir=$(usex split-usr '/usr' '')/$(get_libdir)/xcrypt \
		--with-pkgconfigdir=/usr/$(get_libdir)/pkgconfig \
		--includedir="${EPREFIX}/usr/include/xcrypt"
}

src_test() {
	emake check
}

src_install() {
	default

	# make sure out man pages don't collide with glibc or man-pages
	(
		shopt -s failglob || die "failglob failed"
		for manpage in "${ED}"/usr/share/man/man*/*.?*; do
			mv -n "${manpage}" "$(dirname "${manpage}")/xcrypt_$(basename "${manpage}")" \
				|| die "mv failed"
		done
	) || die "no man pages to rename"
}