summaryrefslogtreecommitdiff
path: root/sys-devel/automake-wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/automake-wrapper')
-rw-r--r--sys-devel/automake-wrapper/Manifest2
-rw-r--r--sys-devel/automake-wrapper/automake-wrapper-11.ebuild36
-rw-r--r--sys-devel/automake-wrapper/files/am-wrapper-11.sh186
3 files changed, 224 insertions, 0 deletions
diff --git a/sys-devel/automake-wrapper/Manifest b/sys-devel/automake-wrapper/Manifest
index 9e2f0b97f1a9..0cf62dd1ae04 100644
--- a/sys-devel/automake-wrapper/Manifest
+++ b/sys-devel/automake-wrapper/Manifest
@@ -1,3 +1,5 @@
AUX am-wrapper-10.sh 4626 BLAKE2B f7261f39e06afa88eb0b52c5ccdcbb2b4fabe3bda4fdb50ef2c974d4a03101439decb76edee3d0534a621fd4ca4e5d574a3af2701e382f7c07f838a5235ae6ef SHA512 6f1611000ac2dd901a24efd133522274aa8feea02610645f3b1332a3f294de687f65e995b398a487b1d030c74dd278f65fcd224007ebe7e950af03660cc38f60
+AUX am-wrapper-11.sh 4626 BLAKE2B 2a96abc5b93db360a3ce074d84b21d7f875ff42d54f99030d8589b84efc94b411d8fb1a707716a060dc4a66c59f2a84d1e50a70f681faa62358fc7ae7a5a7d77 SHA512 452c0c52ef65b1ad5ad8d8f5c9c12cb9ff18eb03faaf7217c52a7dcf2a9832c7d4a59dbd8cc6325a0035a6650cc913f9b842615d053bd0f0c5c5177e660dbfca
EBUILD automake-wrapper-10.ebuild 928 BLAKE2B 2f7e20be41a1ad2b46b49e6879d796d16e7993cd7b1c5e7e759bc6382628479b10228ee3dafb0907baa9e581ece9b430f259e12cf3b83adf508c90805765d00e SHA512 93becb2a61c0099453cc085a5da5114b55fa5e67a322cc801d3887be66ba29a4fb690d3f1c582314c38bae8ec404452de6ffa3e7254d9b8ce7c68f830133154e
+EBUILD automake-wrapper-11.ebuild 953 BLAKE2B 24b51709eb3de9a6d8d6053281d577a1cc82a3a53a144e0bdb96bfee6414af659329e1e0ea4a213ab9bb06db9d43a967203fd5fb1bfa437a775b776796d117c3 SHA512 1155862edab5a74364572f0c52fd480a44370a55b02fca0b019fd5d1f8c650db0cd8abb7f76bc8a2b80477734c5c5be5e09790f4e3b55e251c1b1e46000544a0
MISC metadata.xml 253 BLAKE2B 295e9d6d93aaa12af413972e1590c67087801cc09c9aa6b59d4606c0f4106d1dacf2baa9858559083b4c6d91beeef218d0729e8593a33788958da6d2897e8ce2 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555
diff --git a/sys-devel/automake-wrapper/automake-wrapper-11.ebuild b/sys-devel/automake-wrapper/automake-wrapper-11.ebuild
new file mode 100644
index 000000000000..71a6ff489ca4
--- /dev/null
+++ b/sys-devel/automake-wrapper/automake-wrapper-11.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="wrapper for automake to manage multiple automake versions"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/am-wrapper-${PV}.sh "${S}"/ || die
+}
+
+src_prepare() {
+ default
+
+ # usr/bin/aclocal: bad substitution -> /bin/sh != POSIX shell
+ if use prefix ; then
+ sed -i -e '1c\#!'"${EPREFIX}"'/bin/sh' \
+ "${S}"/am-wrapper-${PV}.sh || die
+ fi
+}
+
+src_install() {
+ newbin "${S}"/am-wrapper-${PV}.sh automake
+ dosym automake /usr/bin/aclocal
+
+ keepdir /usr/share/aclocal
+}
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-11.sh b/sys-devel/automake-wrapper/files/am-wrapper-11.sh
new file mode 100644
index 000000000000..290762680d22
--- /dev/null
+++ b/sys-devel/automake-wrapper/files/am-wrapper-11.sh
@@ -0,0 +1,186 @@
+#!/bin/sh
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Executes the correct automake version.
+#
+# If WANT_AUTOMAKE is set (can be a whitespace delimited list of versions):
+# - attempt to find an installed version using those
+# - if magic keyword 'latest' is found, pick the latest version that exists
+# - if nothing found, warn, and proceed as if WANT_AUTOMAKE was not set (below)
+# If WANT_AUTOMAKE is not set:
+# - Try to detect the version of automake used to generate things (look at
+# Makefile.in and aclocal.m4 and any other useful file)
+# - If detected version is not found, warn and proceed as if blank slate
+# - Try to locate the latest version of automake that exists and run it
+
+(set -o posix) 2>/dev/null && set -o posix
+
+_stderr() { printf 'am-wrapper: %s: %b\n' "${argv0}" "$*" 1>&2; }
+warn() { _stderr "warning: $*"; }
+err() { _stderr "error: $*"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case $0 in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOMAKE;
+# Start with last known versions to speed up lookup process.
+#
+LAST_KNOWN_AUTOMAKE_VER="16"
+vers=$(printf '1.%s ' `seq ${LAST_KNOWN_AUTOMAKE_VER} -1 4`)
+
+#
+# Helper to scan for a usable program based on version.
+#
+binary=
+all_vers=
+find_binary() {
+ local v
+ all_vers="${all_vers} $*" # For error messages.
+ for v ; do
+ if [ -x "${full_argv0}-${v}" ] ; then
+ binary="${full_argv0}-${v}"
+ binary_ver=${v}
+ return 0
+ fi
+ done
+ return 1
+}
+
+#
+# Try and find a usable automake version. First check the WANT_AUTOMAKE
+# setting (whitespace delimited list), then fallback to the latest.
+#
+find_latest() {
+ if ! find_binary ${vers} ; then
+ # Brute force it.
+ find_binary $(printf '1.%s ' `seq 99 -1 ${LAST_KNOWN_AUTOMAKE_VER}`)
+ fi
+}
+for wx in ${WANT_AUTOMAKE:-latest} ; do
+ if [ "${wx}" = "latest" ] ; then
+ find_latest && break
+ else
+ find_binary ${wx} && break
+ fi
+done
+
+if [ -z "${binary}" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "could not locate installed version for WANT_AUTOMAKE='${WANT_AUTOMAKE}'; ignoring"
+ unset WANT_AUTOMAKE
+ find_latest
+fi
+
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of automake.\n" \
+ "\tI tried these versions:${all_vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+ local file=$1 ; shift
+ local v=$(awk -v regex="$*" '{
+ if (ret = match($0, regex)) {
+ s = substr($0, ret, RLENGTH)
+ ret = match(s, "[0-9]\\.[0-9]+")
+ print substr(s, ret, RLENGTH)
+ exit
+ }
+ }' "${file}")
+ case " ${auto_vers} " in
+ *" ${v} "*) ;;
+ *) auto_vers="${auto_vers:+${auto_vers} }${v}" ;;
+ esac
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+ auto_vers=
+ if [ -r "Makefile.in" ] ; then
+ do_awk Makefile.in '^# Makefile.in generated (automatically )?by automake [0-9]\\.[0-9]+'
+ fi
+ if [ -r "aclocal.m4" ] ; then
+ do_awk aclocal.m4 'generated automatically by aclocal [0-9]\\.[0-9]+'
+ do_awk aclocal.m4 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?[0-9]\\.[0-9]+[^)]*\\]?\\)'
+ fi
+ # We don't need to set $binary here as it has already been setup for us
+ # earlier to the latest available version.
+ if [ -n "${auto_vers}" ] ; then
+ if ! find_binary ${auto_vers} ; then
+ warn "auto-detected versions not found (${auto_vers}); falling back to latest available"
+ fi
+ fi
+fi
+
+if [ -n "${WANT_AMWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+export WANT_AUTOMAKE="${binary_ver}"
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try installing the correct version of automake."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.