*/*: Discontinue Gentoo SuperH port
[gentoo.git] / sys-devel / automake / automake-1.8.5-r5.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}"/${PN}-1.8.2-infopage-namechange.patch
27         epatch "${FILESDIR}"/${P}-test-fixes.patch #159557
28         epatch "${FILESDIR}"/${PN}-1.9.6-aclocal7-test-sleep.patch #197366
29         epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
30         epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
31         epatch "${FILESDIR}"/${P}-CVE-2009-4029.patch #295357
32         epatch "${FILESDIR}"/${PN}-1.8-perl-5.11.patch
33 }
34
35 # slot the info pages.  do this w/out munging the source so we don't have
36 # to depend on texinfo to regen things.  #464146 (among others)
37 slot_info_pages() {
38         pushd "${ED}"/usr/share/info >/dev/null
39         rm -f dir
40
41         # Rewrite all the references to other pages.
42         # before: * aclocal-invocation: (automake)aclocal Invocation.   Generating aclocal.m4.
43         # after:  * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation.   Generating aclocal.m4.
44         local p pages=( *.info ) args=()
45         for p in "${pages[@]/%.info}" ; do
46                 args+=(
47                         -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
48                         -e "s:(${p}):(${p}-${SLOT}):g"
49                 )
50         done
51         sed -i "${args[@]}" * || die
52
53         # Rewrite all the file references, and rename them in the process.
54         local f d
55         for f in * ; do
56                 d=${f/.info/-${SLOT}.info}
57                 mv "${f}" "${d}" || die
58                 sed -i -e "s:${f}:${d}:g" * || die
59         done
60
61         popd >/dev/null
62 }
63
64 src_install() {
65         default
66         slot_info_pages
67         rm -f "${ED}"/usr/bin/{aclocal,automake}
68
69         # remove all config.guess and config.sub files replacing them
70         # w/a symlink to a specific gnuconfig version
71         local x
72         for x in guess sub ; do
73                 dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
74         done
75 }