1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 *_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
11 inherit eutils flag-o-matic multilib toolchain-funcs
13 DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
14 HOMEPAGE="http://e2fsprogs.sourceforge.net/"
15 SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz
16 mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${UP_PV}/${PN}-${UP_PV}.tar.gz
17 elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
21 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~m68k-mint"
22 IUSE="fuse nls static-libs elibc_FreeBSD"
24 RDEPEND="~sys-libs/${PN}-libs-${PV}
25 >=sys-apps/util-linux-2.16
26 fuse? ( sys-fs/fuse:0 )
27 nls? ( virtual/libintl )"
29 nls? ( sys-devel/gettext )
33 S="${WORKDIR}/${P%_pre*}"
36 "${FILESDIR}"/${PN}-1.41.8-makefile.patch
37 "${FILESDIR}"/${PN}-1.40-fbsd.patch
38 "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
40 # Upstream patches (can usually removed with next version bump)
44 if [[ ${CHOST} == *-mint* ]] ; then
45 PATCHES+=( "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch )
50 # blargh ... trick e2fsprogs into using e2fsprogs-libs
53 -e 's:@LIBINTL@:@LTLIBINTL@:' \
54 -e '/^(STATIC_)?LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@(STATIC_)?LIB_EXT@:-l\1:' \
55 -e '/^DEP(STATIC_)?LIB(COM_ERR|SS)/s:=.*:=:' \
56 MCONFIG.in || die "muck libs" #122368
58 -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
59 Makefile.in || die "remove subdirs"
60 ln -s $(which mk_cmds) lib/ss/ || die
63 echo '#include_next <ss/ss_err.h>' > lib/ss/ss_err.h
67 # Keep the package from doing silly things #261411
68 export VARTEXFONTS="${T}/fonts"
70 # needs open64() prototypes and friends
71 append-cppflags -D_GNU_SOURCE
74 --with-root-prefix="${EPREFIX}/"
75 --enable-symlink-install
76 $(tc-is-static-only || echo --enable-elf-shlibs)
77 $(tc-has-tls || echo --disable-tls)
78 --without-included-gettext
79 $(use_enable fuse fuse2fs)
86 ac_cv_path_LDCONFIG=: econf "${myeconfargs[@]}"
87 if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
88 eerror "INTL sanity check failed, aborting build."
89 eerror "Please post your ${S}/config.log file as an"
90 eerror "attachment to https://bugs.gentoo.org/show_bug.cgi?id=81096"
91 die "Preventing included intl cruft from building"
96 emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds
98 # Build the FreeBSD helper
99 if use elibc_FreeBSD ; then
100 cp "${FILESDIR}"/fsck_ext2fs.c .
101 emake V=1 fsck_ext2fs
106 # need to set root_libdir= manually as any --libdir options in the
107 # econf above (i.e. multilib) will screw up the default #276465
110 root_libdir="${EPREFIX}/usr/$(get_libdir)" \
113 dodoc README RELEASE-NOTES
116 doins "${FILESDIR}"/e2fsck.conf
118 # Move shared libraries to /lib/, install static libraries to
119 # /usr/lib/, and install linker scripts to /usr/lib/.
120 gen_usr_ldscript -a e2p ext2fs
121 # configure doesn't have an option to disable static libs :/
122 if ! use static-libs ; then
123 find "${D}" -name '*.a' -delete || die
126 if use elibc_FreeBSD ; then
127 # Install helpers for us
129 dosbin "${S}"/fsck_ext2fs
130 doman "${FILESDIR}"/fsck_ext2fs.8
132 # filefrag is linux only
134 "${ED%/}"/usr/sbin/filefrag \
135 "${ED%/}"/usr/share/man/man8/filefrag.8 || die