Blame missing

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