Diff libxcrypt-2.4 with a libxcrypt-4.4.10-r1

/usr/portage/sys-libs/libxcrypt/libxcrypt-4.4.10-r1.ebuild 2019-11-07 09:09:00.000000000 +0300
1
# Copyright 1999-2013 Gentoo Foundation
1
# Copyright 1999-2019 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=5
5
inherit eutils multilib
4
EAPI=7
5
PYTHON_COMPAT=( python3_{6,7} )
6
inherit autotools multibuild python-any-r1 multilib-minimal
7

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

  
7
DESCRIPTION="A replacement for libcrypt with DES, MD5 and blowfish support"
8
SRC_URI="mirror://debian/pool/main/libx/${PN}/${PN}_${PV}.orig.tar.gz"
9
HOMEPAGE="http://packages.debian.org/sid/libxcrypt1"
10

  
11
LICENSE="LGPL-2"
12
SLOT="0"
12
LICENSE="LGPL-2.1+ public-domain BSD BSD-2"
13
SLOT="0/1"
13 14
KEYWORDS="~amd64 ~x86"
14
IUSE=""
15
IUSE="+compat split-usr static-libs system test"
16

  
17
DEPEND="system? (
18
		elibc_glibc? ( sys-libs/glibc[-crypt(+)] )
19
		!sys-libs/musl
20
	)"
21
RDEPEND="${DEPEND}"
22
BDEPEND="sys-apps/findutils
23
	test? (
24
		${PYTHON_DEPS}
25
		$(python_gen_any_dep 'dev-python/passlib[${PYTHON_USEDEP}]')
26
	)"
27

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

  
31
PATCHES=(
32
	"${FILESDIR}/libxcrypt-4.4.10-pythonver.patch"
33
	"${FILESDIR}/libxcrypt-4.4.10-multibuild.patch"
34
)
35

  
36
pkg_setup() {
37
	MULTIBUILD_VARIANTS=(
38
		$(usex compat 'xcrypt_compat' '')
39
		xcrypt_nocompat
40
	)
41

  
42
	use test && python-any-r1_pkg_setup
43
}
15 44

  
16 45
src_prepare() {
17
	epatch "${FILESDIR}/${PN}-2.4-glibc-2.16.patch"
46
	default
47
	eautoreconf
18 48
}
19 49

  
20 50
src_configure() {
21
	# Do not install into /usr so that tcb and pam can use us.
22
	econf --libdir=/$(get_libdir) --disable-static
51
	multibuild_foreach_variant multilib-minimal_src_configure
52
}
53

  
54
get_xclibdir() {
55
	printf -- "%s\n" "$(usex split-usr '' '/usr')/$(get_libdir)/$(usex system '' 'xcrypt')"
56
}
57

  
58
multilib_src_configure() {
59
	local -a myconf=(
60
		--libdir=$(get_xclibdir)
61
		--with-pkgconfigdir=/usr/$(get_libdir)/pkgconfig
62
		--includedir="${EPREFIX}/usr/include/$(usex system '' 'xcrypt')"
63
	)
64

  
65
	case "${MULTIBUILD_ID}" in
66
		xcrypt_compat-*)
67
			myconf+=(
68
				--disable-static
69
				--disable-xcrypt-compat-files
70
				--enable-obsolete-api=yes
71
			)
72
			;;
73
		xcrypt_nocompat-*)
74
			myconf+=(
75
				--enable-obsolete-api=no
76
				$(use_enable static-libs static)
77
			)
78
			;;
79
		*) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
80
	esac
81

  
82
	ECONF_SOURCE="${S}" econf "${myconf[@]}"
83
}
84

  
85
src_compile() {
86
	multibuild_foreach_variant multilib-minimal_src_compile
87
}
88

  
89
multilib_src_test() {
90
	emake check
91
}
92

  
93
src_test() {
94
	multibuild_foreach_variant multilib-minimal_src_test
23 95
}
24 96

  
25 97
src_install() {
26
	default
27
	prune_libtool_files
98
	multibuild_foreach_variant multilib-minimal_src_install
99

  
100
	(
101
		shopt -s failglob || die "failglob failed"
102

  
103
		# make sure out man pages don't collide with glibc or man-pages
104
		for manpage in "${ED}"/usr/share/man/man3/crypt{,_r}.?*; do
105
			mv -n "${manpage}" "$(dirname "${manpage}")/xcrypt_$(basename "${manpage}")" \
106
				|| die "mv failed"
107
		done
108
	) || die "failglob error"
109

  
110
	# remove useless stuff from installation
111
	find "${D}"/usr/share/doc/${PF} -type l -delete || die
112
	find "${D}" -name '*.la' -delete || die
113
}
114

  
115
multilib_install() {
116
	local install_target
117

  
118
	case "${MULTIBUILD_ID}" in
119
		xcrypt_compat-*) install_target="install-libLTLIBRARIES";;
120
		xcrypt_nocompat-*)
121
			if is_final_abi; then
122
				install_target="install"
123
			else
124
				install_target="install-libLTLIBRARIES"
125
			fi
126
			;;
127
		*) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
128
	esac
129

  
130
	emake DESTDIR="${D}" ${install_target}
131

  
132
	# don't install the libcrypt.so symlink for the "compat" version
133
	case "${MULTIBUILD_ID}" in
134
		xcrypt_compat-*)
135
			rm "${D}"$(get_xclibdir)/libcrypt$(get_libname) \
136
				"${D}"/usr/include/$(usex system '' 'xcrypt/')xcrypt.h || die
137
		;;
138
		xcrypt_nocompat-*)
139
			if use split-usr; then
140
				(
141
					shopt -s failglob || die "failglob failed"
142

  
143
					for so_file in "${D}"$(get_xclibdir)/*$(get_libname)*; do
144
						so_file=$(basename "${so_file}") || die
145

  
146
						dosym ../../$(usex system '' '../')$(get_libdir)/$(usex system '' 'xcrypt')/${so_file} \
147
							/usr/$(get_libdir)/$(usex system '' 'xcrypt/')${so_file}
148
					done
149
				) || die "symlinking library failure"
150
			fi
151
			;;
152
	esac
28 153
}
Thank you!