1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic systemd toolchain-funcs udev
8 DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
9 HOMEPAGE="http://e2fsprogs.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/e2fsprogs/${P}.tar.xz
11 mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz
12 elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 -x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint"
17 IUSE="fuse nls static-libs elibc_FreeBSD"
19 RDEPEND="~sys-libs/${PN}-libs-${PV}
20 >=sys-apps/util-linux-2.16
21 fuse? ( sys-fs/fuse:0 )
22 nls? ( virtual/libintl )"
24 nls? ( sys-devel/gettext )
29 "${FILESDIR}"/${PN}-1.44.6-parallel_install.patch
30 "${FILESDIR}"/${PN}-1.40-fbsd.patch
31 "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
33 # Upstream patches (can usually removed with next version bump)
37 if [[ ${CHOST} == *-mint* ]] ; then
38 PATCHES+=( "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch )
43 cp doc/RelNotes/v${PV}.txt ChangeLog || die "Failed to copy Release Notes"
45 # Get rid of doc -- we don't use them. This also prevents a sandbox
46 # violation due to mktexfmt invocation
47 rm -r doc || die "Failed to remove doc dir"
49 # blargh ... trick e2fsprogs into using e2fsprogs-libs
51 -e 's:@LIBINTL@:@LTLIBINTL@:' \
52 -e '/^(STATIC_)?LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@(STATIC_)?LIB_EXT@:-l\1:' \
53 -e '/^DEP(STATIC_)?LIB(COM_ERR|SS)/s:=.*:=:' \
54 MCONFIG.in || die "muck libs" #122368
56 -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
57 Makefile.in || die "remove subdirs"
58 ln -s $(which mk_cmds) lib/ss/ || die
61 echo '#include_next <ss/ss_err.h>' > lib/ss/ss_err.h
65 # Keep the package from doing silly things #261411
66 export VARTEXFONTS="${T}/fonts"
68 # needs open64() prototypes and friends
69 append-cppflags -D_GNU_SOURCE
72 --with-root-prefix="${EPREFIX%/}/"
73 --with-crond-dir="${EPREFIX}/etc/cron.d"
74 --with-systemd-unit-dir="$(systemd_get_systemunitdir)"
75 --with-udev-rules-dir="$(get_udevdir)/rules.d"
76 --enable-symlink-install
78 $(tc-has-tls || echo --disable-tls)
79 --without-included-gettext
80 $(use_enable fuse fuse2fs)
87 ac_cv_path_LDCONFIG=: econf "${myeconfargs[@]}"
89 if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
90 eerror "INTL sanity check failed, aborting build."
91 eerror "Please post your ${S}/config.log file as an"
92 eerror "attachment to https://bugs.gentoo.org/show_bug.cgi?id=81096"
93 die "Preventing included intl cruft from building"
98 emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds
100 # Build the FreeBSD helper
101 if use elibc_FreeBSD ; then
102 cp "${FILESDIR}"/fsck_ext2fs.c .
103 emake V=1 fsck_ext2fs
108 # need to set root_libdir= manually as any --libdir options in the
109 # econf above (i.e. multilib) will screw up the default #276465
112 root_libdir="${EPREFIX%/}/usr/$(get_libdir)" \
119 doins "${FILESDIR}"/e2fsck.conf
121 # Move shared libraries to /lib/, install static libraries to
122 # /usr/lib/, and install linker scripts to /usr/lib/.
123 gen_usr_ldscript -a e2p ext2fs
125 # configure doesn't have an option to disable static libs :/
126 if ! use static-libs ; then
127 find "${ED}" -name '*.a' -delete || die
130 if use elibc_FreeBSD ; then
131 # Install helpers for us
133 dosbin "${S}"/fsck_ext2fs
134 doman "${FILESDIR}"/fsck_ext2fs.8
136 # filefrag is linux only
138 "${ED%/}"/usr/sbin/filefrag \
139 "${ED%/}"/usr/share/man/man8/filefrag.8 || die