# ChangeLog for sys-devel/automake-wrapper
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/ChangeLog,v 1.16 2006/11/04 21:23:06 kugelfang Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/ChangeLog,v 1.17 2006/11/05 08:11:18 vapier Exp $
+
+*automake-wrapper-3 (05 Nov 2006)
+
+ 05 Nov 2006; Mike Frysinger <vapier@gentoo.org> +files/am-wrapper-3.sh,
+ +automake-wrapper-3.ebuild:
+ Make default automake selection more flexible and allow WANT_AUTOMAKE to
+ contain a list of versions.
04 Nov 2006; Danny van Dyk <kugelfang@gentoo.org>
automake-wrapper-2.ebuild:
MD5 421009f3057f211f8d6f817b4544bebc files/am-wrapper-2.sh 3619
RMD160 3061b207b1295e29272ccd5408692bb009c135d8 files/am-wrapper-2.sh 3619
SHA256 78775190704bee7b67c2b4f28cb84ed999e3f43f23c5054e8a48a90e7d80d8b8 files/am-wrapper-2.sh 3619
+AUX am-wrapper-3.sh 4202 RMD160 935fa9a80ef5a9b85655e60834358ead7cd2f0cd SHA1 36360445000887f7db62f9c44a99f148c1b7dffd SHA256 282698f71d74b61a532e7f90dff3f421b5fc8c1985086941fd84a5b3fdb72596
+MD5 b728019e36000ba4956b3f972340d362 files/am-wrapper-3.sh 4202
+RMD160 935fa9a80ef5a9b85655e60834358ead7cd2f0cd files/am-wrapper-3.sh 4202
+SHA256 282698f71d74b61a532e7f90dff3f421b5fc8c1985086941fd84a5b3fdb72596 files/am-wrapper-3.sh 4202
EBUILD automake-wrapper-1-r1.ebuild 774 RMD160 e87bc49669ff7f3d5a3554f45e3ad1921a8778e2 SHA1 087d0d44cc2fbf0522112737a8a881eb87402aa4 SHA256 5ce6aff80a660d47752de9e74e43ba40853a94b21f19ac57769a8e14ad546242
MD5 b31042b0af883c9bf0a9ba4f100b6a23 automake-wrapper-1-r1.ebuild 774
RMD160 e87bc49669ff7f3d5a3554f45e3ad1921a8778e2 automake-wrapper-1-r1.ebuild 774
MD5 d8bf076e2cc360fde4e598b6fd77cb28 automake-wrapper-2.ebuild 791
RMD160 cf0e86023d7fcdd6c315c035b02c577b05784518 automake-wrapper-2.ebuild 791
SHA256 b8ee0aa4616ca7fb3ea4bc6eeb7bbfbb6cb801f8ac35770bce0a390f76ef9a17 automake-wrapper-2.ebuild 791
-MISC ChangeLog 1351 RMD160 adad332615169930476564fa04c99d1729b25f25 SHA1 0fe51a81c1e5bd4530898dee51389a512397d09a SHA256 34b304db1c21295a78337c122227318e92b480fdaf703a543a0ec1edebf2eba3
-MD5 0fd90d63db74598ef0c59baead57f88b ChangeLog 1351
-RMD160 adad332615169930476564fa04c99d1729b25f25 ChangeLog 1351
-SHA256 34b304db1c21295a78337c122227318e92b480fdaf703a543a0ec1edebf2eba3 ChangeLog 1351
+EBUILD automake-wrapper-3.ebuild 795 RMD160 2c6a0c9e58126df7956f52fbe8b5af3c4b22965b SHA1 d78e25c7d03958e5233211f202164d0cd1b16f21 SHA256 fa2d78801ea751d91415a72bc05de21d999ee302f1aaeac5587c56370429dc60
+MD5 85191346982423d1106fd67a949b9800 automake-wrapper-3.ebuild 795
+RMD160 2c6a0c9e58126df7956f52fbe8b5af3c4b22965b automake-wrapper-3.ebuild 795
+SHA256 fa2d78801ea751d91415a72bc05de21d999ee302f1aaeac5587c56370429dc60 automake-wrapper-3.ebuild 795
+MISC ChangeLog 1593 RMD160 9727990cb83a8550144a586e8999e66bf6098b3b SHA1 a8d8b8523482f24568b252d9a6c145a9bc4d7ef0 SHA256 3e391178b07bc891b0e31bdb19c27322e73bb0c0b4949edb9afe7a2a434346ec
+MD5 6f4c276eb0bf3519c97b588c6ef2c86d ChangeLog 1593
+RMD160 9727990cb83a8550144a586e8999e66bf6098b3b ChangeLog 1593
+SHA256 3e391178b07bc891b0e31bdb19c27322e73bb0c0b4949edb9afe7a2a434346ec ChangeLog 1593
MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92
MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 metadata.xml 164
SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 metadata.xml 164
-MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-automake-wrapper-1-r1 1
-RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-automake-wrapper-1-r1 1
-SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-automake-wrapper-1-r1 1
-MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-automake-wrapper-2 1
-RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-automake-wrapper-2 1
-SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-automake-wrapper-2 1
+MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-automake-wrapper-1-r1 0
+RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-automake-wrapper-1-r1 0
+SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-automake-wrapper-1-r1 0
+MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-automake-wrapper-2 0
+RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-automake-wrapper-2 0
+SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-automake-wrapper-2 0
+MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-automake-wrapper-3 0
+RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-automake-wrapper-3 0
+SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-automake-wrapper-3 0
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.4 (GNU/Linux)
+Version: GnuPG v1.4.5 (GNU/Linux)
-iD8DBQFFTQTz5mJXAu5GbtIRApE8AJ4j9CUtvNC8O8uC1z2DN59pGHD0DQCeIkNb
-AFTo8MhM8PZGJnITEcxHGx8=
-=dhBW
+iD8DBQFFTZzFamhnQswr0vIRAu+LAKCpwhZnbzQ/c3W6avAVe/d07jzFSACfYrMG
+AS28lPFAlP7no7Uarvnq36A=
+=bzA5
-----END PGP SIGNATURE-----
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/automake-wrapper-3.ebuild,v 1.1 2006/11/05 08:11:18 vapier Exp $
+
+inherit multilib
+
+DESCRIPTION="wrapper for automake to manage multiple automake versions"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE=""
+
+S=${WORKDIR}
+
+src_install() {
+ exeinto /usr/$(get_libdir)/misc
+ newexe "${FILESDIR}"/am-wrapper-${PV}.sh am-wrapper.sh || die
+
+ keepdir /usr/share/aclocal
+
+ dodir /usr/bin
+ local x=
+ for x in aclocal automake ; do
+ dosym ../$(get_libdir)/misc/am-wrapper.sh /usr/bin/${x}
+ done
+}
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/files/am-wrapper-3.sh,v 1.1 2006/11/05 08:11:18 vapier Exp $
+
+# Based on the am-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct automake version.
+#
+# - defaults to newest version available (hopefully automake-1.10)
+# - runs automake-1.9 if:
+# - envvar WANT_AUTOMAKE is set to `1.9'
+# -or-
+# - `Makefile.in' was generated by automake-1.9
+# -or-
+# - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.9
+# - runs automake-1.8 if:
+# - envvar WANT_AUTOMAKE is set to `1.8'
+# -or-
+# - `Makefile.in' was generated by automake-1.8
+# -or-
+# - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.8
+# - runs automake-1.7 if:
+# - envvar WANT_AUTOMAKE is set to `1.7'
+# -or-
+# - `Makefile.in' was generated by automake-1.7
+# -or-
+# - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.7
+# - runs automake-1.6 if:
+# - envvar WANT_AUTOMAKE is set to `1.6'
+# -or-
+# - `Makefile.in'
+# -or-
+# - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.6
+# - runs automake-1.5 if:
+# - envvar WANT_AUTOMAKE is set to `1.5'
+# -or-
+# - `Makefile.in' was generated by automake-1.5
+# -or-
+# - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.5
+# - runs automake-1.4 if:
+# - envvar WANT_AUTOMAKE is set to `1.4'
+# -or-
+# - `Makefile.in' was generated by automake-1.4
+# -or-
+# - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.4
+
+if [ "${0##*/}" = "am-wrapper.sh" ] ; then
+ echo "Don't call this script directly." >&2
+ exit 1
+fi
+
+vers="1.10 1.9 1.8 1.7 1.6 1.5 1.4"
+
+#
+# Export the proper variable/versions and try to locate a usuable
+# default (newer versions are preferred)
+#
+binary=""
+for v in ${vers} ; do
+ eval binary_${v/./_}="${0}-${v}"
+
+ if [ -z "${binary}" ] && [ -x "${0}-${v}" ] ; then
+ binary="${0}-${v}"
+ fi
+done
+if [ -z "${binary}" ] ; then
+ echo "am-wrapper: Unable to locate any usuable version of automake." >&2
+ echo " I tried these versions: ${vers}" >&2
+ echo " With a base name of '${0}'." >&2
+ exit 1
+fi
+
+#
+# Check the WANT_AUTOMAKE setting. We accept a whitespace delimited
+# list of automake versions.
+#
+if [ -n "${WANT_AUTOMAKE}" ] ; then
+ for v in ${vers} x ; do
+ if [ "${v}" = "x" ] ; then
+ unset WANT_AUTOMAKE
+ break
+ fi
+
+ for wx in ${WANT_AUTOMAKE} ; do
+ if [ "${wx}" = "${v}" ] ; then
+ binary="binary_${v/./_}"
+ binary="${!binary}"
+ break
+ fi
+ done
+ done
+fi
+
+do_awk() {
+ local file=$1 ; shift
+ local arg=$1 ; shift
+ echo $(gawk "{ if (match(\$0, \"$*\", res)) { print res[${arg}]; exit } }" ${file})
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+ if [ -r "Makefile.in" ] ; then
+ confversion_mf=$(do_awk Makefile.in 2 "^# Makefile.in generated (automatically )?by automake ([0-9].[0-9]+)")
+ fi
+ if [ -r "aclocal.m4" ] ; then
+ confversion_ac=$(do_awk aclocal.m4 1 'generated automatically by aclocal ([0-9].[0-9]+)')
+ confversion_am=$(do_awk aclocal.m4 1 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?([0-9].[0-9]+)[^)]*\\]?\\)')
+ fi
+
+ for v in ${vers} ; do
+ if [ "${confversion_mf}" = "${v}" ] \
+ || [ "${confversion_ac}" = "${v}" ] \
+ || [ "${confversion_am}" = "${v}" ] ; then
+ binary="binary_${v/./_}"
+ binary="${!binary}"
+ break
+ fi
+ done
+fi
+
+if [ "${WANT_AMWRAPPER_DEBUG}" ] ; then
+ if [ "${WANT_AUTOMAKE}" ] ; then
+ echo "am-wrapper: DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}" >&2
+ fi
+ echo "am-wrapper: DEBUG: will execute <$binary>" >&2
+fi
+
+#
+# for further consistency
+#
+for v in ${vers} ; do
+ mybin="binary_${v/./_}"
+ if [ "${binary}" = "${!mybin}" ] ; then
+ export WANT_AUTOMAKE="${v}"
+ fi
+done
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ echo "am-wrapper: $binary is missing or not executable." >&2
+ echo " Please try emerging the correct version of automake." >&2
+ exit 1
+fi
+
+exec "$binary" "$@"
+
+echo "am-wrapper: was unable to exec $binary !?" >&2
+exit 1