Merge remote-tracking branch 'github/pr/367'.
[gentoo.git] / sys-devel / m4 / m4-1.4.16.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="3"
6
7 inherit eutils
8
9 DESCRIPTION="GNU macro processor"
10 HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
11 SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="examples"
17
18 # remember: cannot dep on autoconf since it needs us
19 DEPEND="app-arch/xz-utils"
20 RDEPEND=""
21
22 src_prepare() {
23         epatch "${FILESDIR}"/${P}-fix-test-readlink.patch #376639
24         epatch "${FILESDIR}"/${P}-no-gets.patch #424978
25
26         # Disable gnulib build test that has no impact on the source.
27         echo 'exit 0' > tests/test-update-copyright.sh || die
28 }
29
30 src_configure() {
31         # Disable automagic dependency over libsigsegv; see bug #278026
32         export ac_cv_libsigsegv=no
33
34         local myconf=""
35         [[ ${USERLAND} != "GNU" ]] && myconf="--program-prefix=g"
36         econf --enable-changeword ${myconf}
37 }
38
39 src_test() {
40         [[ -d /none ]] && die "m4 tests will fail with /none/" #244396
41         emake check || die
42 }
43
44 src_install() {
45         emake install DESTDIR="${D}" || die
46         # autoconf-2.60 for instance, first checks gm4, then m4.  If we don't have
47         # gm4, it might find gm4 from outside the prefix on for instance Darwin
48         use prefix && dosym /usr/bin/m4 /usr/bin/gm4
49         dodoc BACKLOG ChangeLog NEWS README* THANKS TODO
50         if use examples ; then
51                 docinto examples
52                 dodoc examples/*
53                 rm -f "${ED}"/usr/share/doc/${PF}/examples/Makefile*
54         fi
55 }