| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-fs/e2fsprogs/e2fsprogs-1.41.7-r1.ebuild,v 1.3 2009/12/01 04:47:34 vapier Exp $
|
| 4 |
|
| 5 |
inherit eutils flag-o-matic toolchain-funcs multilib
|
| 6 |
|
| 7 |
DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
|
| 8 |
HOMEPAGE="http://e2fsprogs.sourceforge.net/"
|
| 9 |
SRC_URI="mirror://sourceforge/e2fsprogs/${P}.tar.gz"
|
| 10 |
|
| 11 |
LICENSE="GPL-2 BSD"
|
| 12 |
SLOT="0"
|
| 13 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
|
| 14 |
IUSE="nls elibc_FreeBSD"
|
| 15 |
|
| 16 |
RDEPEND="~sys-libs/${PN}-libs-${PV}
|
| 17 |
nls? ( virtual/libintl )"
|
| 18 |
DEPEND="${RDEPEND}
|
| 19 |
nls? ( sys-devel/gettext )
|
| 20 |
virtual/pkgconfig
|
| 21 |
sys-apps/texinfo"
|
| 22 |
|
| 23 |
pkg_setup() {
|
| 24 |
if [[ ! -e ${ROOT}/etc/mtab ]] ; then
|
| 25 |
# add some crap to deal with missing /etc/mtab #217719
|
| 26 |
ewarn "No /etc/mtab file, creating one temporarily"
|
| 27 |
echo "${PN} crap for src_test" > "${ROOT}"/etc/mtab
|
| 28 |
fi
|
| 29 |
}
|
| 30 |
|
| 31 |
src_unpack() {
|
| 32 |
unpack ${A}
|
| 33 |
cd "${S}"
|
| 34 |
epatch "${FILESDIR}"/${PN}-1.38-tests-locale.patch #99766
|
| 35 |
epatch "${FILESDIR}"/${PN}-1.41.5-makefile.patch
|
| 36 |
epatch "${FILESDIR}"/${PN}-1.40-fbsd.patch
|
| 37 |
epatch "${FILESDIR}"/0001-resize2fs-Fix-error-message-so-the-mountpoint-is-pri.patch #276352
|
| 38 |
# blargh ... trick e2fsprogs into using e2fsprogs-libs
|
| 39 |
rm -rf doc
|
| 40 |
sed -i -r \
|
| 41 |
-e 's:@LIBINTL@:@LTLIBINTL@:' \
|
| 42 |
-e '/^LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@LIB_EXT@:-l\1:' \
|
| 43 |
-e '/^DEPLIB(COM_ERR|SS)/s:=.*:=:' \
|
| 44 |
MCONFIG.in || die "muck libs" #122368
|
| 45 |
sed -i -r \
|
| 46 |
-e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
|
| 47 |
Makefile.in || die "remove subdirs"
|
| 48 |
# stupid configure script clobbers CC for us
|
| 49 |
sed -i \
|
| 50 |
-e '/if test -z "$CC" ; then CC=cc; fi/d' \
|
| 51 |
configure || die "touching configure"
|
| 52 |
|
| 53 |
# we want to build the blkid/findfs binaries, but not the libs
|
| 54 |
sed -i \
|
| 55 |
-e '/BLKID_CMT=/s:BLKID_CMT:LIBBLKID_CMT:g' \
|
| 56 |
configure || die "touching configure for blkid"
|
| 57 |
sed -i \
|
| 58 |
-e '/BLKID_LIB_SUBDIR/s:@BLKID_CMT@:@LIBBLKID_CMT@:g' \
|
| 59 |
Makefile.in || die "remove blkid subdir better"
|
| 60 |
append-cppflags -DCONFIG_BUILD_FINDFS #275923
|
| 61 |
|
| 62 |
# Avoid rebuild
|
| 63 |
touch lib/ss/ss_err.h
|
| 64 |
}
|
| 65 |
|
| 66 |
src_compile() {
|
| 67 |
# Keep the package from doing silly things #261411
|
| 68 |
export VARTEXFONTS=${T}/fonts
|
| 69 |
|
| 70 |
# We want to use the "bsd" libraries while building on Darwin, but while
|
| 71 |
# building on other Gentoo/*BSD we prefer elf-naming scheme.
|
| 72 |
local libtype
|
| 73 |
case ${CHOST} in
|
| 74 |
*-darwin*) libtype=bsd;;
|
| 75 |
*) libtype=elf;;
|
| 76 |
esac
|
| 77 |
|
| 78 |
ac_cv_path_LDCONFIG=: \
|
| 79 |
econf \
|
| 80 |
--with-root-prefix=/ \
|
| 81 |
--enable-${libtype}-shlibs \
|
| 82 |
--with-ldopts="${LDFLAGS}" \
|
| 83 |
$(tc-has-tls || echo --disable-tls) \
|
| 84 |
--without-included-gettext \
|
| 85 |
$(use_enable nls) \
|
| 86 |
$(use_enable userland_GNU fsck) \
|
| 87 |
--disable-libblkid \
|
| 88 |
--disable-libuuid \
|
| 89 |
|| die
|
| 90 |
if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
|
| 91 |
eerror "INTL sanity check failed, aborting build."
|
| 92 |
eerror "Please post your ${S}/config.log file as an"
|
| 93 |
eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096"
|
| 94 |
die "Preventing included intl cruft from building"
|
| 95 |
fi
|
| 96 |
emake COMPILE_ET=compile_et MK_CMDS=mk_cmds || die
|
| 97 |
|
| 98 |
# Build the FreeBSD helper
|
| 99 |
if use elibc_FreeBSD ; then
|
| 100 |
cp "${FILESDIR}"/fsck_ext2fs.c .
|
| 101 |
emake fsck_ext2fs || die
|
| 102 |
fi
|
| 103 |
}
|
| 104 |
|
| 105 |
pkg_preinst() {
|
| 106 |
if [[ -r ${ROOT}/etc/mtab ]] ; then
|
| 107 |
if [[ $(<"${ROOT}"/etc/mtab) == "${PN} crap for src_test" ]] ; then
|
| 108 |
rm -f "${ROOT}"/etc/mtab
|
| 109 |
fi
|
| 110 |
fi
|
| 111 |
}
|
| 112 |
|
| 113 |
src_install() {
|
| 114 |
# need to set root_libdir= manually as any --libdir options in the
|
| 115 |
# econf above (i.e. multilib) will screw up the default #276465
|
| 116 |
emake \
|
| 117 |
STRIP=: \
|
| 118 |
root_libdir="/$(get_libdir)" \
|
| 119 |
DESTDIR="${D}" \
|
| 120 |
install install-libs || die
|
| 121 |
dodoc README RELEASE-NOTES
|
| 122 |
|
| 123 |
if use elibc_FreeBSD ; then
|
| 124 |
# Install helpers for us
|
| 125 |
into /
|
| 126 |
dosbin "${S}"/fsck_ext2fs || die
|
| 127 |
doman "${FILESDIR}"/fsck_ext2fs.8
|
| 128 |
|
| 129 |
# these manpages are already provided by FreeBSD libc
|
| 130 |
# and filefrag is linux only
|
| 131 |
rm -f \
|
| 132 |
"${D}"/usr/sbin/filefrag \
|
| 133 |
"${D}"/usr/share/man/man8/filefrag.8 \
|
| 134 |
"${D}"/usr/bin/uuidgen \
|
| 135 |
"${D}"/usr/share/man/man3/{uuid,uuid_compare}.3 \
|
| 136 |
"${D}"/usr/share/man/man1/uuidgen.1 || die
|
| 137 |
fi
|
| 138 |
}
|