Skip to content

Commit

Permalink
Add sets of packages to implement automake-wrapper package as in gentoo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpux committed Dec 18, 2013
1 parent da79f5d commit 45483ef
Show file tree
Hide file tree
Showing 57 changed files with 2,930 additions and 44 deletions.
35 changes: 35 additions & 0 deletions automake-wrapper/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Maintainer: Alexey Pavlov <[email protected]>

pkgname=automake-wrapper
pkgver=9
pkgrel=2
pkgdesc="Wrapper scripts for automake and aclocal"
arch=('any')
license=('GPL')
url="http://www.gentoo.org"
groups=('base-devel')
depends=('bash' 'gawk'
#'automake1.4'
#'automake1.5'
'automake1.6'
'automake1.7'
'automake1.7'
'automake1.8'
'automake1.9'
'automake1.10'
'automake1.11'
'automake1.12'
'automake1.13'
'automake1.14')
#install=automake.install
source=("am-wrapper-${pkgver}.sh")
md5sums=('0b1f6f9288b3d1a64b858b18c958dce2')
provides=("automake")
conflicts=("automake")

package() {
mkdir -p ${pkgdir}/usr/bin

cp "${srcdir}"/am-wrapper-${pkgver}.sh ${pkgdir}/usr/bin/automake
cp "${srcdir}"/am-wrapper-${pkgver}.sh ${pkgdir}/usr/bin/aclocal
}
187 changes: 187 additions & 0 deletions automake-wrapper/am-wrapper-9.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#!/bin/sh
# Copyright 1999-2013 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-9.sh,v 1.1 2013/06/23 04:50:40 vapier Exp $

# 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="14"
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.
43 changes: 0 additions & 43 deletions automake/PKGBUILD

This file was deleted.

72 changes: 72 additions & 0 deletions automake1.10/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Maintainer: Alexey Pavlov <[email protected]>

pkgname=automake1.10
pkgver=1.10.3
pkgrel=1
pkgdesc="A GNU tool for automatically creating Makefiles"
arch=('any')
license=('GPL')
url="http://www.gnu.org/software/automake"
groups=('base-devel')
depends=('perl' 'bash')
makedepends=('autoconf')
checkdepends=('dejagnu' 'python2')
install=automake.install
source=(ftp://ftp.gnu.org/gnu/automake/automake-${pkgver}.tar.bz2{,.sig}
automake-1.10-msys2.patch
automake1.10-documentation.patch
automake-1.10-makeinfo-fix.patch)
md5sums=('b8e67fb458da396bc35555af7ef2b49f'
'SKIP'
'0cc04bed86ae6d1b5c3bd90ba3593ee6'
'b9537a6237a5bdf8c48a76c277b53ae6'
'79199a6a20eaab3f95f17cfde86e628d')

prepare() {
cd ${srcdir}/automake-${pkgver}

patch -p2 -i ${srcdir}/automake1.10-documentation.patch
patch -p1 -i ${srcdir}/automake-1.10-makeinfo-fix.patch
patch -p1 -i ${srcdir}/automake-1.10-msys2.patch
}

build() {
cd ${srcdir}/automake-${pkgver}
./configure --prefix=/usr
make

(cd doc && makeinfo -I ${srcdir}/automake-${pkgver}/doc -o automake1.10.info automake.texi)
}

check() {
cd ${srcdir}/automake-${pkgver}

# expect 2 failures due to perl-5.18 incompatibility
make -k check || true
}

package() {
cd ${srcdir}/automake-${pkgver}
make DESTDIR=${pkgdir} install

# install the 1.11 versioned info files
for f in `find ${pkgdir}/usr/share/info -name "*.info*"` ; do
rm -f ${f}
done
for f in `find ${srcdir}/automake-${pkgver} -name "*.info*"` ; do
bf=`basename $f`
cp $f ${pkgdir}/usr/share/info/
done

# remove the unversioned executables
rm -f ${pkgdir}/usr/bin/automake ${pkgdir}/usr/bin/aclocal

# remove the unversioned man pages
rm -f ${pkgdir}/usr/share/man/man1/automake.1
rm -f ${pkgdir}/usr/share/man/man1/aclocal.1

# remove the unversioned info files
rm -f ${pkgdir}/usr/share/info/automake.info*

rm -rf ${pkgdir}/usr/share/doc
}
36 changes: 36 additions & 0 deletions automake1.10/automake-1.10-makeinfo-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--- automake-1.10.3/doc/automake.texi.orig 2009-12-08 22:36:30.000000000 +0300
+++ automake-1.10.3/doc/automake.texi 2013-12-18 09:37:58.142800000 +0400
@@ -11635,11 +11635,11 @@
Options: these items on which Automake works have been rewritten as
separate Perl modules, and documented.

-@itemx 2004-01-11 Automake 1.8.1
-@itemx 2004-01-12 Automake 1.8.2
-@itemx 2004-03-07 Automake 1.8.3
-@itemx 2004-04-25 Automake 1.8.4
-@itemx 2004-05-16 Automake 1.8.5
+@item 2004-01-11 Automake 1.8.1
+@item 2004-01-12 Automake 1.8.2
+@item 2004-03-07 Automake 1.8.3
+@item 2004-04-25 Automake 1.8.4
+@item 2004-05-16 Automake 1.8.5

@item 2004-07-28 Automake 1.9

@@ -11652,13 +11652,13 @@

Aside from this it contains mainly minor changes and bug-fixes.

-@itemx 2004-08-11 Automake 1.9.1
-@itemx 2004-09-19 Automake 1.9.2
+@item 2004-08-11 Automake 1.9.1
+@item 2004-09-19 Automake 1.9.2

Automake has ten years. This chapter of the manual was initially
written for this occasion.

-@itemx 2007-10-29 Automake repository moves to @code{savannah.gnu.org} and uses
+@item 2007-10-29 Automake repository moves to @code{savannah.gnu.org} and uses
git as primary repository.

@end table
Loading

0 comments on commit 45483ef

Please sign in to comment.