Blame missing

Packit Service 2781ba
#! /bin/sh
Packit Service 2781ba
# Common stub for a few missing GNU programs while installing.
Packit Service 2781ba
Packit Service 2781ba
scriptversion=2012-01-06.13; # UTC
Packit Service 2781ba
Packit Service 2781ba
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
Packit Service 2781ba
# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Packit Service 2781ba
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
Packit Service 2781ba
Packit Service 2781ba
# This program is free software; you can redistribute it and/or modify
Packit Service 2781ba
# it under the terms of the GNU General Public License as published by
Packit Service 2781ba
# the Free Software Foundation; either version 2, or (at your option)
Packit Service 2781ba
# any later version.
Packit Service 2781ba
Packit Service 2781ba
# This program is distributed in the hope that it will be useful,
Packit Service 2781ba
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 2781ba
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 2781ba
# GNU General Public License for more details.
Packit Service 2781ba
Packit Service 2781ba
# You should have received a copy of the GNU General Public License
Packit Service 2781ba
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 2781ba
Packit Service 2781ba
# As a special exception to the GNU General Public License, if you
Packit Service 2781ba
# distribute this file as part of a program that contains a
Packit Service 2781ba
# configuration script generated by Autoconf, you may include it under
Packit Service 2781ba
# the same distribution terms that you use for the rest of that program.
Packit Service 2781ba
Packit Service 2781ba
if test $# -eq 0; then
Packit Service 2781ba
  echo 1>&2 "Try \`$0 --help' for more information"
Packit Service 2781ba
  exit 1
Packit Service 2781ba
fi
Packit Service 2781ba
Packit Service 2781ba
run=:
Packit Service 2781ba
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
Packit Service 2781ba
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
Packit Service 2781ba
Packit Service 2781ba
# In the cases where this matters, `missing' is being run in the
Packit Service 2781ba
# srcdir already.
Packit Service 2781ba
if test -f configure.ac; then
Packit Service 2781ba
  configure_ac=configure.ac
Packit Service 2781ba
else
Packit Service 2781ba
  configure_ac=configure.in
Packit Service 2781ba
fi
Packit Service 2781ba
Packit Service 2781ba
msg="missing on your system"
Packit Service 2781ba
Packit Service 2781ba
case $1 in
Packit Service 2781ba
--run)
Packit Service 2781ba
  # Try to run requested program, and just exit if it succeeds.
Packit Service 2781ba
  run=
Packit Service 2781ba
  shift
Packit Service 2781ba
  "$@" && exit 0
Packit Service 2781ba
  # Exit code 63 means version mismatch.  This often happens
Packit Service 2781ba
  # when the user try to use an ancient version of a tool on
Packit Service 2781ba
  # a file that requires a minimum version.  In this case we
Packit Service 2781ba
  # we should proceed has if the program had been absent, or
Packit Service 2781ba
  # if --run hadn't been passed.
Packit Service 2781ba
  if test $? = 63; then
Packit Service 2781ba
    run=:
Packit Service 2781ba
    msg="probably too old"
Packit Service 2781ba
  fi
Packit Service 2781ba
  ;;
Packit Service 2781ba
Packit Service 2781ba
  -h|--h|--he|--hel|--help)
Packit Service 2781ba
    echo "\
Packit Service 2781ba
$0 [OPTION]... PROGRAM [ARGUMENT]...
Packit Service 2781ba
Packit Service 2781ba
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
Packit Service 2781ba
error status if there is no known handling for PROGRAM.
Packit Service 2781ba
Packit Service 2781ba
Options:
Packit Service 2781ba
  -h, --help      display this help and exit
Packit Service 2781ba
  -v, --version   output version information and exit
Packit Service 2781ba
  --run           try to run the given command, and emulate it if it fails
Packit Service 2781ba
Packit Service 2781ba
Supported PROGRAM values:
Packit Service 2781ba
  aclocal      touch file \`aclocal.m4'
Packit Service 2781ba
  autoconf     touch file \`configure'
Packit Service 2781ba
  autoheader   touch file \`config.h.in'
Packit Service 2781ba
  autom4te     touch the output file, or create a stub one
Packit Service 2781ba
  automake     touch all \`Makefile.in' files
Packit Service 2781ba
  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
Packit Service 2781ba
  flex         create \`lex.yy.c', if possible, from existing .c
Packit Service 2781ba
  help2man     touch the output file
Packit Service 2781ba
  lex          create \`lex.yy.c', if possible, from existing .c
Packit Service 2781ba
  makeinfo     touch the output file
Packit Service 2781ba
  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
Packit Service 2781ba
Packit Service 2781ba
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
Packit Service 2781ba
\`g' are ignored when checking the name.
Packit Service 2781ba
Packit Service 2781ba
Send bug reports to <bug-automake@gnu.org>."
Packit Service 2781ba
    exit $?
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
Packit Service 2781ba
    echo "missing $scriptversion (GNU Automake)"
Packit Service 2781ba
    exit $?
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  -*)
Packit Service 2781ba
    echo 1>&2 "$0: Unknown \`$1' option"
Packit Service 2781ba
    echo 1>&2 "Try \`$0 --help' for more information"
Packit Service 2781ba
    exit 1
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
esac
Packit Service 2781ba
Packit Service 2781ba
# normalize program name to check for.
Packit Service 2781ba
program=`echo "$1" | sed '
Packit Service 2781ba
  s/^gnu-//; t
Packit Service 2781ba
  s/^gnu//; t
Packit Service 2781ba
  s/^g//; t'`
Packit Service 2781ba
Packit Service 2781ba
# Now exit if we have it, but it failed.  Also exit now if we
Packit Service 2781ba
# don't have it and --version was passed (most likely to detect
Packit Service 2781ba
# the program).  This is about non-GNU programs, so use $1 not
Packit Service 2781ba
# $program.
Packit Service 2781ba
case $1 in
Packit Service 2781ba
  lex*|yacc*)
Packit Service 2781ba
    # Not GNU programs, they don't have --version.
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  *)
Packit Service 2781ba
    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
Packit Service 2781ba
       # We have it, but it failed.
Packit Service 2781ba
       exit 1
Packit Service 2781ba
    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
Packit Service 2781ba
       # Could not run --version or --help.  This is probably someone
Packit Service 2781ba
       # running `$TOOL --version' or `$TOOL --help' to check whether
Packit Service 2781ba
       # $TOOL exists and not knowing $TOOL uses missing.
Packit Service 2781ba
       exit 1
Packit Service 2781ba
    fi
Packit Service 2781ba
    ;;
Packit Service 2781ba
esac
Packit Service 2781ba
Packit Service 2781ba
# If it does not exist, or fails to run (possibly an outdated version),
Packit Service 2781ba
# try to emulate it.
Packit Service 2781ba
case $program in
Packit Service 2781ba
  aclocal*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
Packit Service 2781ba
         to install the \`Automake' and \`Perl' packages.  Grab them from
Packit Service 2781ba
         any GNU archive site."
Packit Service 2781ba
    touch aclocal.m4
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  autoconf*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
         you modified \`${configure_ac}'.  You might want to install the
Packit Service 2781ba
         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
Packit Service 2781ba
         archive site."
Packit Service 2781ba
    touch configure
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  autoheader*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
Packit Service 2781ba
         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
Packit Service 2781ba
         from any GNU archive site."
Packit Service 2781ba
    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
Packit Service 2781ba
    test -z "$files" && files="config.h"
Packit Service 2781ba
    touch_files=
Packit Service 2781ba
    for f in $files; do
Packit Service 2781ba
      case $f in
Packit Service 2781ba
      *:*) touch_files="$touch_files "`echo "$f" |
Packit Service 2781ba
				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
Packit Service 2781ba
      *) touch_files="$touch_files $f.in";;
Packit Service 2781ba
      esac
Packit Service 2781ba
    done
Packit Service 2781ba
    touch $touch_files
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  automake*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
Packit Service 2781ba
         You might want to install the \`Automake' and \`Perl' packages.
Packit Service 2781ba
         Grab them from any GNU archive site."
Packit Service 2781ba
    find . -type f -name Makefile.am -print |
Packit Service 2781ba
	   sed 's/\.am$/.in/' |
Packit Service 2781ba
	   while read f; do touch "$f"; done
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  autom4te*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is needed, but is $msg.
Packit Service 2781ba
         You might have modified some files without having the
Packit Service 2781ba
         proper tools for further handling them.
Packit Service 2781ba
         You can get \`$1' as part of \`Autoconf' from any GNU
Packit Service 2781ba
         archive site."
Packit Service 2781ba
Packit Service 2781ba
    file=`echo "$*" | sed -n "$sed_output"`
Packit Service 2781ba
    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
Packit Service 2781ba
    if test -f "$file"; then
Packit Service 2781ba
	touch $file
Packit Service 2781ba
    else
Packit Service 2781ba
	test -z "$file" || exec >$file
Packit Service 2781ba
	echo "#! /bin/sh"
Packit Service 2781ba
	echo "# Created by GNU Automake missing as a replacement of"
Packit Service 2781ba
	echo "#  $ $@"
Packit Service 2781ba
	echo "exit 0"
Packit Service 2781ba
	chmod +x $file
Packit Service 2781ba
	exit 1
Packit Service 2781ba
    fi
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  bison*|yacc*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' $msg.  You should only need it if
Packit Service 2781ba
         you modified a \`.y' file.  You may need the \`Bison' package
Packit Service 2781ba
         in order for those modifications to take effect.  You can get
Packit Service 2781ba
         \`Bison' from any GNU archive site."
Packit Service 2781ba
    rm -f y.tab.c y.tab.h
Packit Service 2781ba
    if test $# -ne 1; then
Packit Service 2781ba
        eval LASTARG=\${$#}
Packit Service 2781ba
	case $LASTARG in
Packit Service 2781ba
	*.y)
Packit Service 2781ba
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
Packit Service 2781ba
	    if test -f "$SRCFILE"; then
Packit Service 2781ba
	         cp "$SRCFILE" y.tab.c
Packit Service 2781ba
	    fi
Packit Service 2781ba
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
Packit Service 2781ba
	    if test -f "$SRCFILE"; then
Packit Service 2781ba
	         cp "$SRCFILE" y.tab.h
Packit Service 2781ba
	    fi
Packit Service 2781ba
	  ;;
Packit Service 2781ba
	esac
Packit Service 2781ba
    fi
Packit Service 2781ba
    if test ! -f y.tab.h; then
Packit Service 2781ba
	echo >y.tab.h
Packit Service 2781ba
    fi
Packit Service 2781ba
    if test ! -f y.tab.c; then
Packit Service 2781ba
	echo 'main() { return 0; }' >y.tab.c
Packit Service 2781ba
    fi
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  lex*|flex*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
         you modified a \`.l' file.  You may need the \`Flex' package
Packit Service 2781ba
         in order for those modifications to take effect.  You can get
Packit Service 2781ba
         \`Flex' from any GNU archive site."
Packit Service 2781ba
    rm -f lex.yy.c
Packit Service 2781ba
    if test $# -ne 1; then
Packit Service 2781ba
        eval LASTARG=\${$#}
Packit Service 2781ba
	case $LASTARG in
Packit Service 2781ba
	*.l)
Packit Service 2781ba
	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
Packit Service 2781ba
	    if test -f "$SRCFILE"; then
Packit Service 2781ba
	         cp "$SRCFILE" lex.yy.c
Packit Service 2781ba
	    fi
Packit Service 2781ba
	  ;;
Packit Service 2781ba
	esac
Packit Service 2781ba
    fi
Packit Service 2781ba
    if test ! -f lex.yy.c; then
Packit Service 2781ba
	echo 'main() { return 0; }' >lex.yy.c
Packit Service 2781ba
    fi
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  help2man*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
	 you modified a dependency of a manual page.  You may need the
Packit Service 2781ba
	 \`Help2man' package in order for those modifications to take
Packit Service 2781ba
	 effect.  You can get \`Help2man' from any GNU archive site."
Packit Service 2781ba
Packit Service 2781ba
    file=`echo "$*" | sed -n "$sed_output"`
Packit Service 2781ba
    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
Packit Service 2781ba
    if test -f "$file"; then
Packit Service 2781ba
	touch $file
Packit Service 2781ba
    else
Packit Service 2781ba
	test -z "$file" || exec >$file
Packit Service 2781ba
	echo ".ab help2man is required to generate this page"
Packit Service 2781ba
	exit $?
Packit Service 2781ba
    fi
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  makeinfo*)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is $msg.  You should only need it if
Packit Service 2781ba
         you modified a \`.texi' or \`.texinfo' file, or any other file
Packit Service 2781ba
         indirectly affecting the aspect of the manual.  The spurious
Packit Service 2781ba
         call might also be the consequence of using a buggy \`make' (AIX,
Packit Service 2781ba
         DU, IRIX).  You might want to install the \`Texinfo' package or
Packit Service 2781ba
         the \`GNU make' package.  Grab either from any GNU archive site."
Packit Service 2781ba
    # The file to touch is that specified with -o ...
Packit Service 2781ba
    file=`echo "$*" | sed -n "$sed_output"`
Packit Service 2781ba
    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
Packit Service 2781ba
    if test -z "$file"; then
Packit Service 2781ba
      # ... or it is the one specified with @setfilename ...
Packit Service 2781ba
      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
Packit Service 2781ba
      file=`sed -n '
Packit Service 2781ba
	/^@setfilename/{
Packit Service 2781ba
	  s/.* \([^ ]*\) *$/\1/
Packit Service 2781ba
	  p
Packit Service 2781ba
	  q
Packit Service 2781ba
	}' $infile`
Packit Service 2781ba
      # ... or it is derived from the source name (dir/f.texi becomes f.info)
Packit Service 2781ba
      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
Packit Service 2781ba
    fi
Packit Service 2781ba
    # If the file does not exist, the user really needs makeinfo;
Packit Service 2781ba
    # let's fail without touching anything.
Packit Service 2781ba
    test -f $file || exit 1
Packit Service 2781ba
    touch $file
Packit Service 2781ba
    ;;
Packit Service 2781ba
Packit Service 2781ba
  *)
Packit Service 2781ba
    echo 1>&2 "\
Packit Service 2781ba
WARNING: \`$1' is needed, and is $msg.
Packit Service 2781ba
         You might have modified some files without having the
Packit Service 2781ba
         proper tools for further handling them.  Check the \`README' file,
Packit Service 2781ba
         it often tells you about the needed prerequisites for installing
Packit Service 2781ba
         this package.  You may also peek at any GNU archive site, in case
Packit Service 2781ba
         some other package would contain this missing \`$1' program."
Packit Service 2781ba
    exit 1
Packit Service 2781ba
    ;;
Packit Service 2781ba
esac
Packit Service 2781ba
Packit Service 2781ba
exit 0
Packit Service 2781ba
Packit Service 2781ba
# Local variables:
Packit Service 2781ba
# eval: (add-hook 'write-file-hooks 'time-stamp)
Packit Service 2781ba
# time-stamp-start: "scriptversion="
Packit Service 2781ba
# time-stamp-format: "%:y-%02m-%02d.%02H"
Packit Service 2781ba
# time-stamp-time-zone: "UTC"
Packit Service 2781ba
# time-stamp-end: "; # UTC"
Packit Service 2781ba
# End: