dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / app-crypt / loop-aes-losetup / loop-aes-losetup-2.28.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5
6 inherit autotools toolchain-funcs flag-o-matic
7
8 MY_PV="${PV/_/-}"
9 MY_P="util-linux-${MY_PV}"
10 LOOPAES_P="loop-AES-v3.7j"
11 S="${WORKDIR}/${MY_P}"
12
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"
18
19 LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
20 SLOT="0"
21 IUSE="nls selinux static"
22
23 RDEPEND="selinux? ( sys-libs/libselinux )"
24 DEPEND="${RDEPEND}
25         nls? ( sys-devel/gettext )
26         virtual/os-headers"
27
28 PATCHES=(
29         "${WORKDIR}/${LOOPAES_P}/util-linux-${PV}.diff"
30 )
31
32 src_prepare() {
33         default
34         eautoreconf
35 }
36
37 lfs_fallocate_test() {
38         # Make sure we can use fallocate with LFS #300307
39         cat <<-EOF > "${T}"/fallocate.${ABI}.c
40                 #define _GNU_SOURCE
41                 #include <fcntl.h>
42                 main() { return fallocate(0, 0, 0, 0); }
43         EOF
44         append-lfs-flags
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
48 }
49
50 src_configure() {
51         lfs_fallocate_test
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
59         ECONF_SOURCE=${S} \
60         econf \
61                 --libdir='${prefix}/'"$(get_libdir)" \
62                 --disable-all-programs \
63                 --disable-pylibmount \
64                 --enable-libsmartcols \
65                 --enable-losetup \
66                 --without-ncurses \
67                 --without-udev \
68                 $(use_enable nls) \
69                 $(use_with selinux) \
70                 $(tc-has-tls || echo --disable-tls) \
71                 $(use static && echo --enable-static-programs=losetup)
72 }
73
74 src_install() {
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
79 }