diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-devel/automake-wrapper |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-devel/automake-wrapper')
-rw-r--r-- | sys-devel/automake-wrapper/Manifest | 5 | ||||
-rw-r--r-- | sys-devel/automake-wrapper/automake-wrapper-10.ebuild | 34 | ||||
-rw-r--r-- | sys-devel/automake-wrapper/files/am-wrapper-10.sh | 186 | ||||
-rw-r--r-- | sys-devel/automake-wrapper/metadata.xml | 8 |
4 files changed, 233 insertions, 0 deletions
diff --git a/sys-devel/automake-wrapper/Manifest b/sys-devel/automake-wrapper/Manifest new file mode 100644 index 000000000000..6a0c5bd775a0 --- /dev/null +++ b/sys-devel/automake-wrapper/Manifest @@ -0,0 +1,5 @@ +AUX am-wrapper-10.sh 4626 SHA256 9a3ba62f144c7dcf9d58ef92d71a259ff879cd346cad9d973664b7a92e305bbf SHA512 6f1611000ac2dd901a24efd133522274aa8feea02610645f3b1332a3f294de687f65e995b398a487b1d030c74dd278f65fcd224007ebe7e950af03660cc38f60 WHIRLPOOL 9d51c0fd4a3ae44a9b3e3a873a60eaf4309e00a45b55ab3e5615c967d76c1c989978a79e76bfce9bae9ac8f14d81a9f2036d7638b0d5e3f7400ccda0954e30c0 +EBUILD automake-wrapper-10.ebuild 940 SHA256 f3cbe9e75fb11cf972436581aa0c293928644a8d05ab54efd823785264550bcb SHA512 8768c7681d53e6c058a9395df162d74ab38af27a04deab822272ae744f32f3f574bd0dff1c6b6effc93dc0e9bb011fdeaddcaa97c4d585b11578e20ff9d1509c WHIRLPOOL cc2396b49793a02ac284bfb45ab2fc4b8ff606ee81b736bb3f3176dd3b15263ba1cc4706334231e3718aa295514b8a169a901e3048e4aca73672f05e79b179ed +MISC ChangeLog 3367 SHA256 c28723e96cf2b5d34d182b003f93ffc199af06fab0662eddc87946f42362f08e SHA512 6fa6417d15980f6ba7c0db3f8ec3f0165b8cae12d010bc86325a7e530f1b93c14ade8dfba849d5731c1542cfde15c68c0702d1b7b1641ae7e5e607738cf5a8bb WHIRLPOOL 5c6b7b24f187550457ac88fbdec40dc9e4af2fdbae4e72342db57074cc446d7f6a7422c2096779f4a0e49c443095e498453014d3bdce529303334d1d8eeb5a3d +MISC ChangeLog-2015 10371 SHA256 d179264a702dd8a7c0cf83c177674efe4793959b3ba4541c8daab193d976a3e4 SHA512 98eac805eacf0c981cc9488df65a3237c843937e9f0183f49396393fa66ef56763db4efbb490515e27c4f3500360bef3d5e4e1447829c94a9a19b88e810d928f WHIRLPOOL 7177fd9f8ac88149ecf4653abb0b77f5a444cae210237fe7a21bfba11c8246dc1694ff73adf7e1a49349a6155ebc38b862ceeace8eea88242e69d0bfc5605658 +MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8 diff --git a/sys-devel/automake-wrapper/automake-wrapper-10.ebuild b/sys-devel/automake-wrapper/automake-wrapper-10.ebuild new file mode 100644 index 000000000000..bf2ec3f5301e --- /dev/null +++ b/sys-devel/automake-wrapper/automake-wrapper-10.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +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 ~sparc-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() { + # 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-10.sh b/sys-devel/automake-wrapper/files/am-wrapper-10.sh new file mode 100644 index 000000000000..235474fbf3d9 --- /dev/null +++ b/sys-devel/automake-wrapper/files/am-wrapper-10.sh @@ -0,0 +1,186 @@ +#!/bin/sh +# Copyright 1999-2015 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="15" +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. diff --git a/sys-devel/automake-wrapper/metadata.xml b/sys-devel/automake-wrapper/metadata.xml new file mode 100644 index 000000000000..56c124413057 --- /dev/null +++ b/sys-devel/automake-wrapper/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> +</maintainer> +</pkgmetadata> |