1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
7 inherit python-any-r1 versionator
9 if [[ ${PV/_beta} == ${PV} ]]; then
11 SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
12 https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
14 MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
17 # Alpha/beta releases are not distributed on the usual mirrors.
18 SRC_URI="https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
21 DESCRIPTION="Used to generate Makefile.in from Makefile.am"
22 HOMEPAGE="https://www.gnu.org/software/automake/"
25 # Use Gentoo versioning for slotting.
27 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
29 RESTRICT="!test? ( test )"
31 RDEPEND="dev-lang/perl
32 >=sys-devel/automake-wrapper-10
33 >=sys-devel/autoconf-2.69:*
37 test? ( ${PYTHON_DEPS} )"
40 "${FILESDIR}"/${PN}-1.14-gzip-fix.patch
41 "${FILESDIR}"/${PN}-1.14-install-sh-avoid-low-risk-race-in-tmp.patch
42 "${FILESDIR}"/${PN}-1.15-perl-escape-curly-bracket.patch
45 S="${WORKDIR}/${MY_P}"
48 use test && python-any-r1_pkg_setup
53 export WANT_AUTOCONF=2.5
54 sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
57 if ! has_version sys-apps/texinfo ; then
58 touch doc/{stamp-vti,version.texi,automake.info} || die
62 # slot the info pages. do this w/out munging the source so we don't have
63 # to depend on texinfo to regen things. #464146 (among others)
65 pushd "${ED%/}"/usr/share/info >/dev/null || die
68 # Rewrite all the references to other pages.
69 # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
70 # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
71 local p pages=( *.info ) args=()
72 for p in "${pages[@]/%.info}" ; do
74 -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
75 -e "s:(${p}):(${p}-${SLOT}):g"
78 sed -i "${args[@]}" * || die
80 # Rewrite all the file references, and rename them in the process.
83 d=${f/.info/-${SLOT}.info}
84 mv "${f}" "${d}" || die
85 sed -i -e "s:${f}:${d}:g" * || die
88 popd >/dev/null || die
95 rm "${ED%/}"/usr/share/aclocal/README || die
96 rmdir "${ED%/}"/usr/share/aclocal || die
98 "${ED%/}"/usr/bin/{aclocal,automake} \
99 "${ED%/}"/usr/share/man/man1/{aclocal,automake}.1 || die
101 # remove all config.guess and config.sub files replacing them
102 # w/a symlink to a specific gnuconfig version
104 for x in guess sub ; do
105 dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}