| 1 |
vapier |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
vapier |
1.3 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.21.2.ebuild,v 1.2 2012/06/02 18:55:37 vapier Exp $ |
| 4 |
vapier |
1.1 |
|
| 5 |
|
|
EAPI="3" |
| 6 |
|
|
|
| 7 |
|
|
EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git" |
| 8 |
|
|
AUTOTOOLS_AUTO_DEPEND="no" |
| 9 |
|
|
inherit eutils toolchain-funcs libtool flag-o-matic autotools |
| 10 |
|
|
if [[ ${PV} == "9999" ]] ; then |
| 11 |
|
|
inherit git-2 autotools |
| 12 |
|
|
#KEYWORDS="" |
| 13 |
|
|
else |
| 14 |
|
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" |
| 15 |
|
|
fi |
| 16 |
|
|
|
| 17 |
|
|
MY_PV=${PV/_/-} |
| 18 |
|
|
MY_P=${PN}-${MY_PV} |
| 19 |
|
|
S=${WORKDIR}/${MY_P} |
| 20 |
|
|
|
| 21 |
|
|
DESCRIPTION="Various useful Linux utilities" |
| 22 |
|
|
HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/" |
| 23 |
|
|
if [[ ${PV} == "9999" ]] ; then |
| 24 |
|
|
SRC_URI="" |
| 25 |
|
|
else |
| 26 |
|
|
SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz |
| 27 |
|
|
loop-aes? ( http://loop-aes.sourceforge.net/updates/util-linux-2.20-20110905.diff.bz2 )" |
| 28 |
|
|
fi |
| 29 |
|
|
|
| 30 |
|
|
LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain" |
| 31 |
|
|
SLOT="0" |
| 32 |
vapier |
1.2 |
IUSE="+cramfs crypt ddate loop-aes ncurses nls old-linux perl selinux slang static-libs uclibc udev unicode" |
| 33 |
vapier |
1.1 |
|
| 34 |
|
|
RDEPEND="!sys-process/schedutils |
| 35 |
|
|
!sys-apps/setarch |
| 36 |
|
|
!<sys-apps/sysvinit-2.88-r3 |
| 37 |
|
|
!<sys-libs/e2fsprogs-libs-1.41.8 |
| 38 |
|
|
!<sys-fs/e2fsprogs-1.41.8 |
| 39 |
|
|
cramfs? ( sys-libs/zlib ) |
| 40 |
|
|
ncurses? ( >=sys-libs/ncurses-5.2-r2 ) |
| 41 |
|
|
perl? ( dev-lang/perl ) |
| 42 |
|
|
selinux? ( sys-libs/libselinux ) |
| 43 |
vapier |
1.2 |
slang? ( sys-libs/slang ) |
| 44 |
|
|
udev? ( sys-fs/udev )" |
| 45 |
vapier |
1.1 |
DEPEND="${RDEPEND} |
| 46 |
|
|
nls? ( sys-devel/gettext ) |
| 47 |
|
|
virtual/os-headers |
| 48 |
|
|
uclibc? ( ${AUTOTOOLS_DEPEND} )" |
| 49 |
|
|
|
| 50 |
|
|
src_prepare() { |
| 51 |
|
|
if [[ ${PV} == "9999" ]] ; then |
| 52 |
|
|
po/update-potfiles |
| 53 |
|
|
eautoreconf |
| 54 |
|
|
else |
| 55 |
|
|
use loop-aes && epatch "${WORKDIR}"/util-linux-*.diff |
| 56 |
|
|
fi |
| 57 |
|
|
if use uclibc ; then |
| 58 |
vapier |
1.3 |
epatch "${FILESDIR}"/${PN}-2.21.1-no-printf-alloc.patch #406303 |
| 59 |
vapier |
1.1 |
eautoreconf |
| 60 |
|
|
fi |
| 61 |
|
|
elibtoolize |
| 62 |
|
|
} |
| 63 |
|
|
|
| 64 |
|
|
lfs_fallocate_test() { |
| 65 |
|
|
# Make sure we can use fallocate with LFS #300307 |
| 66 |
|
|
cat <<-EOF > "${T}"/fallocate.c |
| 67 |
|
|
#define _GNU_SOURCE |
| 68 |
|
|
#include <fcntl.h> |
| 69 |
|
|
main() { return fallocate(0, 0, 0, 0); } |
| 70 |
|
|
EOF |
| 71 |
|
|
append-lfs-flags |
| 72 |
|
|
$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.c -o /dev/null >/dev/null 2>&1 \ |
| 73 |
|
|
|| export ac_cv_func_fallocate=no |
| 74 |
|
|
rm -f "${T}"/fallocate.c |
| 75 |
|
|
} |
| 76 |
|
|
|
| 77 |
|
|
src_configure() { |
| 78 |
|
|
lfs_fallocate_test |
| 79 |
|
|
econf \ |
| 80 |
|
|
--enable-fs-paths-extra=/usr/sbin \ |
| 81 |
|
|
$(use_enable nls) \ |
| 82 |
|
|
--enable-agetty \ |
| 83 |
|
|
$(use_enable cramfs) \ |
| 84 |
|
|
$(use_enable ddate) \ |
| 85 |
|
|
$(use_enable old-linux elvtune) \ |
| 86 |
|
|
--with-ncurses=$(usex ncurses $(usex unicode auto yes) no) \ |
| 87 |
|
|
--disable-kill \ |
| 88 |
|
|
--disable-last \ |
| 89 |
|
|
--disable-mesg \ |
| 90 |
|
|
--enable-partx \ |
| 91 |
|
|
--enable-raw \ |
| 92 |
|
|
--enable-rename \ |
| 93 |
|
|
--disable-reset \ |
| 94 |
|
|
--disable-login-utils \ |
| 95 |
|
|
--enable-schedutils \ |
| 96 |
|
|
--disable-wall \ |
| 97 |
|
|
--enable-write \ |
| 98 |
|
|
$(use_with selinux) \ |
| 99 |
|
|
$(use_with slang) \ |
| 100 |
|
|
$(use_enable static-libs static) \ |
| 101 |
vapier |
1.2 |
$(use_with udev) \ |
| 102 |
vapier |
1.1 |
$(tc-has-tls || echo --disable-tls) |
| 103 |
|
|
} |
| 104 |
|
|
|
| 105 |
|
|
src_install() { |
| 106 |
|
|
emake install DESTDIR="${D}" || die |
| 107 |
|
|
dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt} |
| 108 |
|
|
|
| 109 |
|
|
if ! use perl ; then #284093 |
| 110 |
|
|
rm "${ED}"/usr/bin/chkdupexe || die |
| 111 |
|
|
rm "${ED}"/usr/share/man/man1/chkdupexe.1 || die |
| 112 |
|
|
fi |
| 113 |
|
|
|
| 114 |
|
|
# need the libs in / |
| 115 |
|
|
gen_usr_ldscript -a blkid mount uuid |
| 116 |
|
|
# e2fsprogs-libs didnt install .la files, and .pc work fine |
| 117 |
|
|
find "${ED}" -name '*.la' -delete |
| 118 |
|
|
|
| 119 |
|
|
if use crypt ; then |
| 120 |
|
|
newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die |
| 121 |
|
|
newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die |
| 122 |
|
|
fi |
| 123 |
|
|
} |
| 124 |
|
|
|
| 125 |
|
|
pkg_postinst() { |
| 126 |
|
|
elog "The agetty util now clears the terminal by default. You" |
| 127 |
|
|
elog "might want to add --noclear to your /etc/inittab lines." |
| 128 |
|
|
} |