1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools toolchain-funcs flag-o-matic
9 MY_P="util-linux-${MY_PV}"
10 LOOPAES_P="loop-AES-v3.7j"
11 S="${WORKDIR}/${MY_P}"
13 DESCRIPTION="Loop-AES losetup utility"
14 HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/"
15 SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz
16 http://loop-aes.sourceforge.net/loop-AES/${LOOPAES_P}.tar.bz2"
17 KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
19 LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
21 IUSE="nls selinux static"
23 RDEPEND="selinux? ( sys-libs/libselinux )"
25 nls? ( sys-devel/gettext )
29 "${WORKDIR}/${LOOPAES_P}/util-linux-${PV}.diff"
37 lfs_fallocate_test() {
38 # Make sure we can use fallocate with LFS #300307
39 cat <<-EOF > "${T}"/fallocate.${ABI}.c
42 main() { return fallocate(0, 0, 0, 0); }
45 $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
46 || export ac_cv_func_fallocate=no
47 rm -f "${T}"/fallocate.${ABI}.c
52 # The scanf test in a run-time test which fails while cross-compiling.
53 # Blindly assume a POSIX setup since we require libmount, and libmount
54 # itself fails when the scanf test fails. #531856
55 tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
56 # We manually set --libdir to the default since on prefix, econf will set it to
57 # a value which the configure script does not recognize. This makes it set the
58 # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
61 --libdir='${prefix}/'"$(get_libdir)" \
62 --disable-all-programs \
63 --disable-pylibmount \
64 --enable-libsmartcols \
70 $(tc-has-tls || echo --disable-tls) \
71 $(use static && echo --enable-static-programs=losetup)
75 emake install DESTDIR="${T}/root"
76 newsbin "${T}/root/sbin/losetup" loop-aes-losetup
77 newman "${T}/root/usr/share/man/man8/losetup.8" loop-aes-losetup.8
78 use static && newsbin "${T}/root/bin/losetup.static" loop-aes-losetup.static