1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils toolchain-funcs flag-o-matic
10 MY_P="util-linux-${MY_PV}"
11 LOOPAES_PV="${PV}-20150310"
12 S="${WORKDIR}/${MY_P}"
14 DESCRIPTION="Various useful Linux utilities"
15 HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/"
16 SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz
17 http://loop-aes.sourceforge.net/updates/util-linux-${LOOPAES_PV}.diff.bz2"
18 KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
20 LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
22 IUSE="nls selinux static"
24 RDEPEND="selinux? ( sys-libs/libselinux )"
26 nls? ( sys-devel/gettext )
30 epatch "${WORKDIR}"/util-linux-*.diff
34 lfs_fallocate_test() {
35 # Make sure we can use fallocate with LFS #300307
36 cat <<-EOF > "${T}"/fallocate.${ABI}.c
39 main() { return fallocate(0, 0, 0, 0); }
42 $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
43 || export ac_cv_func_fallocate=no
44 rm -f "${T}"/fallocate.${ABI}.c
49 # The scanf test in a run-time test which fails while cross-compiling.
50 # Blindly assume a POSIX setup since we require libmount, and libmount
51 # itself fails when the scanf test fails. #531856
52 tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
53 # We manually set --libdir to the default since on prefix, econf will set it to
54 # a value which the configure script does not recognize. This makes it set the
55 # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
58 --libdir='${prefix}/'"$(get_libdir)" \
59 --disable-all-programs \
60 --enable-libsmartcols \
66 $(tc-has-tls || echo --disable-tls) \
67 $(use static && echo --enable-static-programs=losetup)
71 emake install DESTDIR="${T}/root"
72 newsbin "${T}/root/sbin/losetup" loop-aes-losetup
73 use static && newsbin "${T}/root/bin/losetup.static" loop-aes-losetup.static