716e2cee066bf89b03eaf1b74869b8c6297917cf
[gentoo.git] / sys-devel / automake / automake-1.6.3-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="4"
5
6 inherit eutils
7
8 DESCRIPTION="Used to generate Makefile.in from Makefile.am"
9 HOMEPAGE="https://www.gnu.org/software/automake/"
10 SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 # Use Gentoo versioning for slotting.
14 SLOT="${PV:0:3}"
15 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86"
16 IUSE=""
17
18 RDEPEND="dev-lang/perl
19         >=sys-devel/automake-wrapper-10
20         >=sys-devel/autoconf-2.69
21         sys-devel/gnuconfig"
22 DEPEND="${RDEPEND}"
23
24 src_prepare() {
25         export WANT_AUTOCONF=2.5
26         epatch "${FILESDIR}"/${P}-test-fixes.patch #159557
27         epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
28         epatch "${FILESDIR}"/${PN}-1.5-CVE-2009-4029.patch #295357
29         epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
30 }
31
32 # slot the info pages.  do this w/out munging the source so we don't have
33 # to depend on texinfo to regen things.  #464146 (among others)
34 slot_info_pages() {
35         pushd "${ED}"/usr/share/info >/dev/null
36         rm -f dir
37
38         # Rewrite all the references to other pages.
39         # before: * aclocal-invocation: (automake)aclocal Invocation.   Generating aclocal.m4.
40         # after:  * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation.   Generating aclocal.m4.
41         local p pages=( *.info ) args=()
42         for p in "${pages[@]/%.info}" ; do
43                 args+=(
44                         -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
45                         -e "s:(${p}):(${p}-${SLOT}):g"
46                 )
47         done
48         sed -i "${args[@]}" * || die
49
50         # Rewrite all the file references, and rename them in the process.
51         local f d
52         for f in * ; do
53                 d=${f/.info/-${SLOT}.info}
54                 mv "${f}" "${d}" || die
55                 sed -i -e "s:${f}:${d}:g" * || die
56         done
57
58         popd >/dev/null
59 }
60
61 src_install() {
62         default
63         slot_info_pages
64         rm -f "${ED}"/usr/bin/{aclocal,automake}
65
66         # remove all config.guess and config.sub files replacing them
67         # w/a symlink to a specific gnuconfig version
68         local x
69         for x in guess sub ; do
70                 dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
71         done
72 }