sys-fs/e2fsprogs: Bump to version 1.43.7
[gentoo.git] / sys-fs / e2fsprogs / e2fsprogs-1.43.7.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 case ${PV} in
7 *_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
8 *)      UP_PV=${PV} ;;
9 esac
10
11 inherit eutils flag-o-matic multilib toolchain-funcs
12
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 )"
18
19 LICENSE="GPL-2 BSD"
20 SLOT="0"
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"
23
24 RDEPEND="~sys-libs/${PN}-libs-${PV}
25         >=sys-apps/util-linux-2.16
26         fuse? ( sys-fs/fuse )
27         nls? ( virtual/libintl )"
28 DEPEND="${RDEPEND}
29         nls? ( sys-devel/gettext )
30         virtual/pkgconfig
31         sys-apps/texinfo"
32
33 S="${WORKDIR}/${P%_pre*}"
34
35 PATCHES=(
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
39
40         # Upstream patches (can usually removed with next version bump)
41 )
42
43 src_prepare() {
44         if [[ ${CHOST} == *-mint* ]] ; then
45                 PATCHES+=( "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch )
46         fi
47
48         default
49
50         # blargh ... trick e2fsprogs into using e2fsprogs-libs
51         rm -rf doc
52         sed -i -r \
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
57         sed -i -r \
58                 -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
59                 Makefile.in || die "remove subdirs"
60         ln -s $(which mk_cmds) lib/ss/ || die
61
62         # Avoid rebuild
63         echo '#include_next <ss/ss_err.h>' > lib/ss/ss_err.h
64 }
65
66 src_configure() {
67         # Keep the package from doing silly things #261411
68         export VARTEXFONTS="${T}/fonts"
69
70         # needs open64() prototypes and friends
71         append-cppflags -D_GNU_SOURCE
72
73         local myeconfargs=(
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)
80                 $(use_enable nls)
81                 --disable-libblkid
82                 --disable-libuuid
83                 --disable-fsck
84                 --disable-uuidd
85         )
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"
92         fi
93 }
94
95 src_compile() {
96         emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds
97
98         # Build the FreeBSD helper
99         if use elibc_FreeBSD ; then
100                 cp "${FILESDIR}"/fsck_ext2fs.c .
101                 emake V=1 fsck_ext2fs
102         fi
103 }
104
105 src_install() {
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
108         emake \
109                 STRIP=: \
110                 root_libdir="${EPREFIX}/usr/$(get_libdir)" \
111                 DESTDIR="${D}" \
112                 install install-libs
113         dodoc README RELEASE-NOTES
114
115         insinto /etc
116         doins "${FILESDIR}"/e2fsck.conf
117
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         use static-libs || find "${D}" -name '*.a' -delete
123
124         if use elibc_FreeBSD ; then
125                 # Install helpers for us
126                 into /
127                 dosbin "${S}"/fsck_ext2fs
128                 doman "${FILESDIR}"/fsck_ext2fs.8
129
130                 # filefrag is linux only
131                 rm \
132                         "${ED%/}"/usr/sbin/filefrag \
133                         "${ED%/}"/usr/share/man/man8/filefrag.8 || die
134         fi
135 }