RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ devtool.conf devtool.shtool

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Fri 20 Jul 2007 - 14:13:54 CEST
Message-Id: <20070720121354.264E93484F4@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm                              Date:   20-Jul-2007 14:13:54
  Branch: HEAD                             Handle: 2007072013135300

  Added files:
    rpm                     devtool.shtool
  Modified files:
    rpm                     devtool.conf

  Log:
    Ok, in order to allow us to build RPM on Unix systems where the AutoXXX
    development tool chain doesn't exist (or only in ancient and no longer
    usable versions), provide local copies. Also further reduce the
    bootstrapping requirements by providing a local minimal devtool.shtool
    providing the "shtool platform" and "shtool subst" commands.
    Additionally, explicitly check for all bootstrapping tools now.

  Summary:
    Revision    Changes     Path
    2.51        +272 -66    rpm/devtool.conf
    2.1         +1155 -0    rpm/devtool.shtool
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  ============================================================================
  $ cvs diff -u -r2.50 -r2.51 devtool.conf
  --- rpm/devtool.conf	19 Jul 2007 18:13:11 -0000	2.50
  +++ rpm/devtool.conf	20 Jul 2007 12:13:53 -0000	2.51
  @@ -11,7 +11,7 @@
   
   %checkout
       for name in $MODULE_NAMES "$@"; do
  -        release=MODULE_TAG_`echo ${name} | tr [a-z] [A-Z]`
  +        release=MODULE_TAG_`echo ${name} | tr '[a-z]' '[A-Z]'`
           release=`eval echo \\$${release}`
           if [ ".${release}" = . ]; then
               if [ -d ${DEVTOOL_SRCDIR}/${name}/CVS ]; then
  @@ -162,17 +162,14 @@
       ##  o 2007-07-17: amd64-solaris10-gcc4.1.2
       ##
   
  -    #   prerequisite check
  -    if [ ".`(which shtool) 2>/dev/null | grep -v '^no'`" = . ]; then
  -        echo "devtool:ERROR: sorry, GNU Shtool (\"shtool\") required in \$PATH" 1>&2
  -        exit 1
  -    fi
  -    if [ ".`(which curl) 2>/dev/null | grep -v '^no'`" = . ]; then
  -        echo "devtool:ERROR: sorry, cURL (\"curl\") required in \$PATH" 1>&2
  -        exit 1
  -    fi
  +    #   third-party development tools distribution versions
  +    v_m4="1.4.9"
  +    v_autoconf="2.61"
  +    v_automake="1.10"
  +    v_libtool="1.5.24"
  +    v_gettext="0.16.1"
   
  -    #   third-party distribution versions
  +    #   third-party library distribution versions
       v_zlib="1.2.3"
       v_bzip2="1.0.4"
       v_openssl="0.9.8e"
  @@ -187,6 +184,11 @@
   
       #   third-party distribution files
       dist=""
  +    dist="${dist} ftp://ftp.gnu.org/gnu/m4/m4-${v_m4}.tar.gz"
  +    dist="${dist} ftp://ftp.gnu.org/gnu/autoconf/autoconf-${v_autoconf}.tar.gz"
  +    dist="${dist} ftp://sources.redhat.com/pub/automake/automake-${v_automake}.tar.gz"
  +    dist="${dist} ftp://ftp.gnu.org/gnu/libtool/libtool-${v_libtool}.tar.gz"
  +    dist="${dist} ftp://ftp.gnu.org/gnu/gettext/gettext-${v_gettext}.tar.gz"
       dist="${dist} http://www.zlib.net/zlib-${v_zlib}.tar.gz"
       dist="${dist} http://www.bzip.org/${v_bzip2}/bzip2-${v_bzip2}.tar.gz"
       dist="${dist} ftp://ftp.openssl.org/source/openssl-${v_openssl}.tar.gz"
  @@ -200,6 +202,8 @@
       dist="${dist} http://rpm5.org/files/popt/popt-${v_popt}.tar.gz"
   
       #   third-party distribution patches (for portability and bugfix reasons only)
  +    dist="${dist} http://cvs.openpkg.org/openpkg-src/automake/automake.patch"
  +    dist="${dist} http://cvs.openpkg.org/openpkg-src/gettext/gettext.patch"
       dist="${dist} http://cvs.openpkg.org/openpkg-src/openssl/openssl.patch"
       dist="${dist} http://cvs.openpkg.org/openpkg-src/beecrypt/beecrypt.patch"
       dist="${dist} http://www.oracle.com/technology/products/berkeley-db/db/update/${v_db}/patch.${v_db}.1"
  @@ -210,31 +214,81 @@
       dist="${dist} http://cvs.openpkg.org/openpkg-src/file/file.patch"
       dist="${dist} http://cvs.openpkg.org/openpkg-src/popt/popt.patch"
   
  -    #   third-party base directory, installation default prefix and platform
  -    base3rd="${DEVTOOL_SRCDIR}/../3rd"
  -    prefix="/tmp/rpm"
  -    platform=`shtool platform -n -L -S "" -C "+" -F '%<ap>-%<sp>'`
  +    #   prerequisite check
  +    for tool in gzip tar patch perl; do
  +        variable=`echo "$tool" | tr '[a-z]' '[A-Z]'`
  +        eval "val=\"\${$variable+set}\""
  +        if [ ".$val" = .set ]; then
  +            eval "$tool=\"\${$variable}\""
  +        else
  +            if [ ".`(which $tool) 2>/dev/null | grep -v '^no'`" != . ]; then
  +                eval "$tool=\"$tool\""
  +            else
  +                echo "devtool:ERROR: sorry, \"$tool\" required in \$PATH (or set \$$variable)" 1>&2
  +                exit 1
  +            fi
  +        fi
  +        eval "export $tool"
  +    done
   
       #   determine compiler (to make sure the whole library and application
       #   chain is built with the same one in order to avoid incompatibilities)
  -    export CC
       if [ ".$CC" != . ]; then
  -        :
  +        cc="$CC"
       elif [ ".`(which gcc) 2>/dev/null | grep -v '^no'`" != . ]; then
  -        CC="gcc"
  +        cc="gcc"
       elif [ ".`(which icc) 2>/dev/null | grep -v '^no'`" != . ]; then
  -        CC="icc"
  +        cc="icc"
  +    elif [ ".`(which cc) 2>/dev/null | grep -v '^no'`" != . ]; then
  +        cc="cc"
       else
  -        CC="cc"
  +        echo "devtool:ERROR: sorry, C compiler (\"cc\") required in \$PATH (or set \$CC)" 1>&2
  +        exit 1
       fi
       if [ ".`(which ccache) 2>/dev/null | grep -v '^no'`" != . ]; then
  -        CC="ccache $CC"
  +        cc="ccache $cc"
       fi
   
  +    #    determine some local tools
  +    SHTOOL="`cd ${DEVTOOL_SRCDIR} && pwd`/devtool.shtool"
  +    
  +    #   helper function for downloading a file from an URL
  +    download () {
  +        file="$1"
  +        name=`echo "$file" | sed -e 's;^.*/\([^/]*\)$;\1;'`
  +        for url in `echo "$2" | sed -e 's/,/ /g'`; do
  +            echo "-- downloading $url"
  +            if [ ".`(which curl) 2>/dev/null | grep -v '^no'`" != . ]; then
  +                curl -s -o "$file" "$url"
  +            elif [ ".`(which wget) 2>/dev/null | grep -v '^no'`" != . ]; then
  +                wget -q -O "$file" "$url"
  +            elif [ ".`(which fetch) 2>/dev/null | grep -v '^no'`" != . ]; then
  +                fetch -o "$file" "$url"
  +            elif [ ".`(which lwp-download) 2>/dev/null | grep -v '^no'`" != . ]; then
  +                lwp-download "$url" "$file"
  +            else
  +                echo "devtool:ERROR: sorry, no download tool found in \$PATH (\"curl\", \"wget\", \"fetch\", \"lwp-download\")" 1>&2
  +                exit 1
  +            fi
  +            if [ -f "$file" ]; then
  +                break
  +            fi
  +        done
  +        if [ ! -f "$file" ]; then
  +            echo "devtool:ERROR: failed to download \"$name\"" 1>&2
  +            exit 1
  +        fi
  +    }
  +
  +    #   third-party base directory, installation default prefix and platform
  +    base3rd="${DEVTOOL_SRCDIR}/../3rd"
  +    prefix="/tmp/rpm"
  +    platform=`$SHTOOL platform -n -L -S "" -C "+" -F '%<ap>-%<sp>'`
  +
       #   prepare build environment
       prepare () {
           echo "++ establishing third-party area under ($base3rd)"
  -        for dir in "" src bin bin/$platform; do
  +        for dir in "" src bin bin/$platform run run/$platform; do
               if [ ! -d "$base3rd/$dir" ]; then
                   mkdir $base3rd/$dir || exit $?
               fi
  @@ -244,63 +298,208 @@
           for url in $dist; do
               file=`echo "$url" | sed -e 's;^.*/;;'`
               if [ ! -f "$base3rd/src/$file" ]; then
  -                echo "-- downloading $file"
  -                curl "-#" -o "$base3rd/src/$file" "$url" || exit $?
  +                download "$base3rd/src/$file" "$url" || exit $?
               fi
           done
   
  -        #   ZLib
  +        #   extend environment
  +        prefix_tools="`cd $base3rd/run/$platform && pwd`"
  +        PATH="$prefix_tools/bin:$prefix_tools/sbin:$PATH"
  +        PATH="$PATH:/bin:/usr/bin:/sbin:/usr/sbin"
  +        export PATH
  +
  +        #   GNU m4 (installed development tool)
  +        if [ ! -d "$base3rd/bin/$platform/m4-${v_m4}" ]; then
  +            echo "++ building third-party development tool m4-${v_m4}"
  +            (   cd $base3rd/bin/$platform
  +                rm -rf m4-${v_m4}
  +                $gzip -d -c ../../src/m4-${v_m4}.tar.gz | $tar xf -
  +                (   cd m4-${v_m4}
  +                    CC="$cc" \
  +                    GREP="grep" \
  +                    ./configure \
  +                        --prefix="$prefix_tools" \
  +                        --disable-nls
  +                    make
  +                    make install
  +                ) || exit $?
  +            ) || exit $?
  +        fi
  +
  +        #   GNU autoconf (installed development tool)
  +        if [ ! -d "$base3rd/bin/$platform/autoconf-${v_autoconf}" ]; then
  +            echo "++ building third-party development tool autoconf-${v_autoconf}"
  +            (   cd $base3rd/bin/$platform
  +                rm -rf autoconf-${v_autoconf}
  +                $gzip -d -c ../../src/autoconf-${v_autoconf}.tar.gz | $tar xf -
  +                (   cd autoconf-${v_autoconf}
  +                    CC="$cc" \
  +                    ACLOCAL=true \
  +                    AUTOMAKE=true \
  +                    AUTOCONF=true \
  +                    AUTOHEADER=true \
  +                    MAKEINFO=true \
  +                    GREP=grep \
  +                    ./configure \
  +                        --prefix="$prefix_tools"
  +                    make
  +                    make install
  +                ) || exit $?
  +            ) || exit $?
  +        fi
  +
  +        #   GNU automake (installed development tool)
  +        if [ ! -d "$base3rd/bin/$platform/automake-${v_automake}" ]; then
  +            echo "++ building third-party development tool automake-${v_automake}"
  +            (   cd $base3rd/bin/$platform
  +                rm -rf automake-${v_automake}
  +                $gzip -d -c ../../src/automake-${v_automake}.tar.gz | $tar xf -
  +                (   cd automake-${v_automake}
  +                    $patch -p0 <../../../src/automake.patch
  +                    $SHTOOL subst \
  +                        -e "s;^\(.SUFFIXES: .*\) \.info \(.*\);\1 \2;" \
  +                        doc/Makefile.in
  +                    CC="$cc" \
  +                    ACLOCAL=true \
  +                    AUTOMAKE=true \
  +                    AUTOCONF=true \
  +                    AUTOHEADER=true \
  +                    MAKEINFO=true \
  +                    GREP=grep \
  +                    ./configure \
  +                        --prefix="$prefix_tools"
  +                    make
  +                    make install
  +                ) || exit $?
  +            ) || exit $?
  +        fi
  +
  +        #   GNU libtool (installed development tool)
  +        if [ ! -d "$base3rd/bin/$platform/libtool-${v_libtool}" ]; then
  +            echo "++ building third-party development tool libtool-${v_libtool}"
  +            (   cd $base3rd/bin/$platform
  +                rm -rf libtool-${v_libtool}
  +                $gzip -d -c ../../src/libtool-${v_libtool}.tar.gz | $tar xf -
  +                (   cd libtool-${v_libtool}
  +                    $SHTOOL subst \
  +                        -e 's;grep ggrep;grep ggrep egrep;g' \
  +                        -e 's;-e .-(cannot match)-.;;g' \
  +                        `find . -name configure -print`
  +                    CC="$cc" \
  +                    GREP=grep \
  +                    ./configure \
  +                        --prefix="$prefix_tools" \
  +                        --enable-static \
  +                        --enable-shared
  +                    make
  +                    make install
  +                ) || exit $?
  +            ) || exit $?
  +        fi
  +
  +        #   GNU gettext (installed development tool)
  +        if [ ! -d "$base3rd/bin/$platform/gettext-${v_gettext}" ]; then
  +            echo "++ building third-party development tool gettext-${v_gettext}"
  +            (   cd $base3rd/bin/$platform
  +                rm -rf gettext-${v_gettext}
  +                $gzip -d -c ../../src/gettext-${v_gettext}.tar.gz | $tar xf -
  +                (   cd gettext-${v_gettext}
  +                    $patch -p0 <../../../src/gettext.patch
  +                    $SHTOOL subst \
  +                        -e '/localcharset.\$lo/d' \
  +                        gettext-runtime/intl/Makefile.in
  +                    $SHTOOL subst \
  +                        -e 's;\(SUBDIRS.*=.*\)intl-java ;\1;' \
  +                        -e 's;\(SUBDIRS.*=.*\)intl-csharp ;\1;' \
  +                         gettext-runtime/Makefile.in
  +                    $SHTOOL subst \
  +                        -e 's;^.*intl-java/Makefile.*$;;' \
  +                        -e 's;^.*intl-csharp/Makefile.*$;;' \
  +                        gettext-runtime/configure
  +                    $SHTOOL subst \
  +                        -e 's;@BUILDJAVA@;no;g' \
  +                        -e 's;@BUILDJAVAEXE@;no;g' \
  +                        -e 's;@BUILDCSHARP@;no;g' \
  +                        gettext-tools/src/Makefile.in
  +                    $SHTOOL subst \
  +                        -e 's;^\(SUBDIRS =.*\)tests examples;\1;' \
  +                        gettext-tools/Makefile.in
  +                    $SHTOOL subst \
  +                        -e 's;\#if USEJEXE;#ifdef USEJEXE;' \
  +                        gettext-tools/src/read-java.c \
  +                        gettext-tools/src/urlget.c
  +                    CC="$cc" \
  +                    GREP="grep" \
  +                    ./configure \
  +                        --prefix="$prefix_tools" \
  +                        --without-libiconv-prefix \
  +                        --with-included-gettext \
  +                        --without-libexpat-prefix \
  +                        --disable-libasprintf \
  +                        --disable-csharp \
  +                        --disable-java \
  +                        --disable-nls \
  +                        --disable-shared
  +                    make
  +                    make install
  +                ) || exit $?
  +            ) || exit $?
  +        fi
  +
  +        #   ZLib (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/zlib-${v_zlib}" ]; then
               echo "++ building third-party library zlib-${v_zlib}"
               (   cd $base3rd/bin/$platform
                   rm -rf zlib-${v_zlib}
  -                gunzip <../../src/zlib-${v_zlib}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/zlib-${v_zlib}.tar.gz | $tar xf -
                   (   cd zlib-${v_zlib}
  +                    CC="$cc" \
                       ./configure
                       make libz.a
                   ) || exit $?
               ) || exit $?
           fi
   
  -        #   BZip2
  +        #   BZip2 (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/bzip2-${v_bzip2}" ]; then
               echo "++ building third-party library bzip2-${v_bzip2}"
               (   cd $base3rd/bin/$platform
                   rm -rf bzip2-${v_bzip2}
  -                gunzip <../../src/bzip2-${v_bzip2}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/bzip2-${v_bzip2}.tar.gz | $tar xf -
                   (   cd bzip2-${v_bzip2}
  -                    make libbz2.a bzip2
  +                    make CC="$cc" libbz2.a bzip2
                   ) || exit $?
               ) || exit $?
           fi
   
  -        #   OpenSSL
  +        #   OpenSSL (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/openssl-${v_openssl}" ]; then
               echo "++ building third-party library openssl-${v_openssl}"
               (   cd $base3rd/bin/$platform
                   rm -rf openssl-${v_openssl}
  -                gunzip <../../src/openssl-${v_openssl}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/openssl-${v_openssl}.tar.gz | $tar xf -
                   (   cd openssl-${v_openssl}
  -                    patch -p0 <../../../src/openssl.patch
  -                    shtool subst \
  +                    $patch -p0 <../../../src/openssl.patch
  +                    $SHTOOL subst \
                           -e 's;-m486;-march=i486;g' \
                           -e 's;BN_LLONG *;;' \
                           Configure
  -                    shtool subst \
  +                    $SHTOOL subst \
                           -e 's;test "$OSTYPE" = msdosdjgpp;true;' \
                           util/point.sh
  -                    shtool subst \
  -                        -e "1s;^.*\$;#!/usr/opkg/bin/perl;" \
  +                    $SHTOOL subst \
  +                        -e "1s;^.*\$;#!$PERL;" \
                           Configure `find . -name "*.pl" -print`
                       opts=""
  -                    case `shtool platform -n -L -S "" -C "+" -F "%<ap>-%<sp>"` in
  +                    case `$SHTOOL platform -n -L -S "" -C "+" -F "%<ap>-%<sp>"` in
                           *-solaris*      ) opts="-lnsl -lsocket" ;;
                       esac
  -                    case `shtool platform -n -L -S "" -C "+" -F "%<ap>-%<sp>"` in
  +                    case `$SHTOOL platform -n -L -S "" -C "+" -F "%<ap>-%<sp>"` in
                           amd64-*          ) opts="$opts -fPIC" ;;
                           ia64-*           ) opts="$opts -fPIC" ;;
                           sparc64-freebsd* ) opts="$opts -fPIC" ;;
                       esac
  +                    CC="$cc" \
                       ./config \
                           --prefix=%{l_prefix} \
                           no-asm no-shared no-dso \
  @@ -312,13 +511,14 @@
               ) || exit $?
           fi
   
  -        #   Expat
  +        #   Expat (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/expat-${v_expat}" ]; then
               echo "++ building third-party library expat-${v_expat}"
               (   cd $base3rd/bin/$platform
                   rm -rf expat-${v_expat}
  -                gunzip <../../src/expat-${v_expat}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/expat-${v_expat}.tar.gz | $tar xf -
                   (   cd expat-${v_expat}
  +                    CC="$cc" \
                       ./configure \
                           --disable-shared
                       make libexpat.la
  @@ -326,15 +526,16 @@
               ) || exit $?
           fi
   
  -        #   Neon
  +        #   Neon (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/neon-${v_neon}" ]; then
               echo "++ building third-party library neon-${v_neon}"
               (   cd $base3rd/bin/$platform
                   rm -rf neon-${v_neon}
  -                gunzip <../../src/neon-${v_neon}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/neon-${v_neon}.tar.gz | $tar xf -
                   (   cd neon-${v_neon}
                       ( echo "ac_cv_path_KRB5_CONFIG="
                       ) >config.cache
  +                    CC="$cc" \
                       CPPFLAGS="-I`pwd`/../openssl-${v_openssl}/include -I`pwd`/../zlib-${v_zlib} -I`pwd`/../expat-${v_expat_date}/lib" \
                       LDFLAGS="-L`pwd`/../openssl-${v_openssl}/lib -L`pwd`/../zlib-${v_zlib} -L`pwd`/../expat-${v_expat_date}/lib -L`pwd`/../expat-${v_expat_date}/.libs" \
                       ./configure \
  @@ -353,24 +554,24 @@
               ) || exit $?
           fi
   
  -        #   BeeCrypt
  +        #   BeeCrypt (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/beecrypt-${v_beecrypt}" ]; then
               echo "++ building third-party library beecrypt-${v_beecrypt}"
               (   cd $base3rd/bin/$platform
                   rm -rf beecrypt-${v_beecrypt}
  -                gunzip <../../src/beecrypt-${v_beecrypt}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/beecrypt-${v_beecrypt}.tar.gz | $tar xf -
                   (   cd beecrypt-${v_beecrypt}
  -                    patch -p0 <../../../src/beecrypt.patch
  -                    shtool subst \
  +                    $patch -p0 <../../../src/beecrypt.patch
  +                    $SHTOOL subst \
                           -e 's;^[ 	][ 	]*#;#;' \
                           aes.c base64.c blowfish.c entropy.c fips186.c fips186.h md5.c \
                           md5.h mp.c mtprng.c mtprng.h sha1.c sha1.h sha256.c sha256.h timestamp.c
  -                    shtool subst \
  +                    $SHTOOL subst \
                          -e 's;cppglue\.lo;;g' \
                          -e 's;cppglue\.cxx;;g' \
                          -e '/^CXX = /s;@CXX@;@CC@;g' \
                          Makefile.in
  -                    shtool subst \
  +                    $SHTOOL subst \
                           -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
                           configure
                       ( echo 'ac_cv_have_dev_dsp=no'
  @@ -378,6 +579,7 @@
                         echo 'ac_cv_func_gettimeofday=yes'
                         echo 'bc_cv_as_noexecstack=no'
                       ) >config.cache
  +                    CC="$cc" \
                       ./configure \
                           --without-cplusplus \
                           --without-java \
  @@ -391,16 +593,16 @@
               ) || exit $?
           fi
   
  -        #   Berkeley-DB
  +        #   Berkeley-DB (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/db-${v_db}" ]; then
               echo "++ building third-party library db-${v_db}"
               (   cd $base3rd/bin/$platform
                   rm -rf db-${v_db}
  -                gunzip <../../src/db-${v_db}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/db-${v_db}.tar.gz | $tar xf -
                   (   cd db-${v_db}
  -                    patch -p0 <../../../src/patch.${v_db}.1
  -                    patch -p0 <../../../src/patch.${v_db}.2
  -                    patch -p0 <../../../src/db.patch
  +                    $patch -p0 <../../../src/patch.${v_db}.1
  +                    $patch -p0 <../../../src/patch.${v_db}.2
  +                    $patch -p0 <../../../src/db.patch
                       mutex="no"
                       case "$platform" in
                           ix86-*   ) mutex="x86/gcc-assembly"   ;;
  @@ -411,6 +613,7 @@
                           *        ) mutex="UNIX/fcntl"         ;;
                       esac
                       cd build_unix
  +                    CC="$cc" \
                       ../dist/configure \
                           --disable-compat185 \
                           --disable-cxx \
  @@ -422,14 +625,15 @@
               ) || exit $?
           fi
   
  -        #   SQLite
  +        #   SQLite (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/sqlite-${v_sqlite}" ]; then
               echo "++ building third-party library sqlite-${v_sqlite}"
               (   cd $base3rd/bin/$platform
                   rm -rf sqlite-${v_sqlite}
  -                gunzip <../../src/sqlite-${v_sqlite}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/sqlite-${v_sqlite}.tar.gz | $tar xf -
                   (   cd sqlite-${v_sqlite}
  -                    patch -p0 <../../../src/sqlite.patch
  +                    $patch -p0 <../../../src/sqlite.patch
  +                    CC="$cc" \
                       CFLAGS="-DNDEBUG=1" \
                       LIBS="-lm" \
                       ./configure \
  @@ -442,35 +646,36 @@
               ) || exit $?
           fi
   
  -        #   Lua
  +        #   Lua (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/lua-${v_lua}" ]; then
               echo "++ building third-party library lua-${v_lua}"
               (   cd $base3rd/bin/$platform
                   rm -rf lua-${v_lua}
  -                gunzip <../../src/lua-${v_lua}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/lua-${v_lua}.tar.gz | $tar xf -
                   (   cd lua-${v_lua}
  -                    patch -p0 <../../../src/lua.patch
  +                    $patch -p0 <../../../src/lua.patch
                       platform="posix"
                       case "$platform" in
                           *-linux*   ) platform="linux"   ;;
                           *-freebsd* ) platform="bsd"     ;;
                           *-sunos*   ) platform="solaris" ;;
                       esac
  -                    make $platform
  +                    make CC="$cc" $platform
                   ) || exit $?
               ) || exit $?
           fi
   
  -        #   File
  +        #   File (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/file-${v_file}" ]; then
               echo "++ building third-party library file-${v_file}"
               (   cd $base3rd/bin/$platform
                   rm -rf file-${v_file}
  -                gunzip <../../src/file-${v_file}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/file-${v_file}.tar.gz | $tar xf -
                   (   cd file-${v_file}
  -                    patch -p0 <../../../src/file.patch
  +                    $patch -p0 <../../../src/file.patch
                       ( echo "ac_cv_lib_z_gzopen=no"
                       ) >config.cache
  +                    CC="$cc" \
                       ./configure \
                           --cache-file=./config.cache \
                           --disable-shared \
  @@ -480,14 +685,15 @@
               ) || exit $?
           fi
   
  -        #   POPT
  +        #   POPT (uninstalled third-party library)
           if [ ! -d "$base3rd/bin/$platform/popt-${v_popt}" ]; then
               echo "++ building third-party library popt-${v_popt}"
               (   cd $base3rd/bin/$platform
                   rm -rf popt-${v_popt}
  -                gunzip <../../src/popt-${v_popt}.tar.gz | tar xf -
  +                $gzip -d -c ../../src/popt-${v_popt}.tar.gz | $tar xf -
                   (   cd popt-${v_popt}
  -                    patch -p0 <../../../src/popt.patch
  +                    $patch -p0 <../../../src/popt.patch
  +                    CC="$cc" \
                       CPPFLAGS="-DOPENPKG" \
                       ./configure \
                           --disable-shared \
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/devtool.shtool
  ============================================================================
  $ cvs diff -u -r0 -r2.1 devtool.shtool
  --- /dev/null	2007-07-20 14:11:00 +0200
  +++ devtool.shtool	2007-07-20 14:13:54 +0200
  @@ -0,0 +1,1155 @@
  +#!/bin/sh
  +##
  +##  GNU shtool -- The GNU Portable Shell Tool
  +##  Copyright (c) 1994-2007 Ralf S. Engelschall <rse@engelschall.com>
  +##
  +##  See http://www.gnu.org/software/shtool/ for more information.
  +##  See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
  +##
  +##  Version:  2.0.7 (19-May-2007)
  +##  Contents: 2/19 available modules
  +##
  +
  +##
  +##  This program is free software; you can redistribute it and/or modify
  +##  it under the terms of the GNU General Public License as published by
  +##  the Free Software Foundation; either version 2 of the License, or
  +##  (at your option) any later version.
  +##
  +##  This program is distributed in the hope that it will be useful,
  +##  but WITHOUT ANY WARRANTY; without even the implied warranty of
  +##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  +##  General Public License for more details.
  +##
  +##  You should have received a copy of the GNU General Public License
  +##  along with this program; if not, write to the Free Software
  +##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  +##  USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
  +##
  +##  NOTICE: Given that you include this file verbatim into your own
  +##  source tree, you are justified in saying that it remains separate
  +##  from your package, and that this way you are simply just using GNU
  +##  shtool. So, in this situation, there is no requirement that your
  +##  package itself is licensed under the GNU General Public License in
  +##  order to take advantage of GNU shtool.
  +##
  +
  +##
  +##  Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]
  +##
  +##  Available commands:
  +##    subst      Apply sed(1) substitution operations
  +##    platform   Platform Identification Utility
  +##
  +##  Not available commands (because module was not built-in):
  +##    echo       Print string with optional construct expansion
  +##    mdate      Pretty-print modification time of a file or dir
  +##    table      Pretty-print a field-separated list as a table
  +##    prop       Display progress with a running propeller
  +##    move       Move files with simultaneous substitution
  +##    install    Install a program, script or datafile
  +##    mkdir      Make one or more directories
  +##    mkln       Make link with calculation of relative paths
  +##    mkshadow   Make a shadow tree through symbolic links
  +##    fixperm    Fix file permissions inside a source tree
  +##    rotate     Logfile rotation
  +##    tarball    Roll distribution tarballs
  +##    arx        Extended archive command
  +##    slo        Separate linker options by library class
  +##    scpp       Sharing C Pre-Processor
  +##    version    Maintain a version information file
  +##    path       Deal with program paths
  +##
  +
  +#   maximum Bourne-Shell compatibility
  +if [ ".$ZSH_VERSION" != . ] && (emulate sh) >/dev/null 2>&1; then
  +    #   reconfigure zsh(1)
  +    emulate sh
  +    NULLCMD=:
  +    alias -g '${1+"$@"}'='"$@"'
  +elif [ ".$BASH_VERSION" != . ] && (set -o posix) >/dev/null 2>&1; then
  +    #   reconfigure bash(1)
  +    set -o posix
  +fi
  +
  +#   maximum independence of NLS nuisances
  +for var in \
  +    LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  +    LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  +    LC_TELEPHONE LC_TIME
  +do
  +    if (set +x; test -z "`(eval $var=C; export $var) 2>&1`"); then
  +        eval $var=C; export $var
  +    else
  +        unset $var
  +    fi
  +done
  +
  +#   initial command line handling
  +if [ $# -eq 0 ]; then
  +    echo "$0:Error: invalid command line" 1>&2
  +    echo "$0:Hint:  run \`$0 -h' for usage" 1>&2
  +    exit 1
  +fi
  +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
  +    echo "This is GNU shtool, version 2.0.7 (19-May-2007)"
  +    echo 'Copyright (c) 1994-2007 Ralf S. Engelschall <rse@engelschall.com>'
  +    echo 'Report bugs to <bug-shtool@gnu.org>'
  +    echo ''
  +    echo 'Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]'
  +    echo ''
  +    echo 'Available global <options>:'
  +    echo '  -v, --version   display shtool version information'
  +    echo '  -h, --help      display shtool usage help page (this one)'
  +    echo '  -d, --debug     display shell trace information'
  +    echo '  -r, --recreate  recreate this shtool script via shtoolize'
  +    echo ''
  +    echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
  +    echo '  subst    [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]'
  +    echo '           [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup'
  +    echo '           <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>]'
  +    echo '           [...]'
  +    echo '  platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
  +    echo '           <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
  +    echo '           [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
  +    echo '           [-V|--version] [-h|--help]'
  +    echo ''
  +    echo 'Not available <cmd-name> (because module was not built-in):'
  +    echo '  echo     [-n|--newline] [-e|--expand] [<string> ...]'
  +    echo '  mdate    [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]'
  +    echo '           [-f|--field-sep <str>] [-o|--order <spec>] <path>'
  +    echo '  table    [-F|--field-sep <sep>] [-w|--width <width>] [-c|--columns'
  +    echo '           <cols>] [-s|--strip <strip>] <str><sep><str>...'
  +    echo '  prop     [-p|--prefix <str>]'
  +    echo '  move     [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]'
  +    echo '           <src-file> <dst-file>'
  +    echo '  install  [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]'
  +    echo '           [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>]'
  +    echo '           [-o|--owner <owner>] [-g|--group <group>] [-e|--exec'
  +    echo '           <sed-cmd>] <file> [<file> ...] <path>'
  +    echo '  mkdir    [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode'
  +    echo '           <mode>] [-o|--owner <owner>] [-g|--group <group>] <dir>'
  +    echo '           [<dir> ...]'
  +    echo '  mkln     [-t|--trace] [-f|--force] [-s|--symbolic] <src-path>'
  +    echo '           [<src-path> ...] <dst-path>'
  +    echo '  mkshadow [-v|--verbose] [-t|--trace] [-a|--all] <src-dir> <dst-dir>'
  +    echo '  fixperm  [-v|--verbose] [-t|--trace] <path> [<path> ...]'
  +    echo '  rotate   [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files'
  +    echo '           <count>] [-s|--size <size>] [-c|--copy] [-r|--remove]'
  +    echo '           [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>]'
  +    echo '           [-b|--background] [-d|--delay] [-p|--pad <len>] [-m|--mode'
  +    echo '           <mode>] [-o|--owner <owner>] [-g|--group <group>] [-M|--migrate'
  +    echo '           <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]'
  +    echo '  tarball  [-t|--trace] [-v|--verbose] [-o|--output <tarball>]'
  +    echo '           [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user'
  +    echo '           <user>] [-g|--group <group>] [-e|--exclude <pattern>]'
  +    echo '           <path> [<path> ...]'
  +    echo '  arx      [-t|--trace] [-C|--command <cmd>] <op> <archive> [<file>'
  +    echo '           ...]'
  +    echo '  slo      [-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib>'
  +    echo '           ...]'
  +    echo '  scpp     [-v|--verbose] [-p|--preserve] [-f|--filter <filter>]'
  +    echo '           [-o|--output <ofile>] [-t|--template <tfile>] [-M|--mark'
  +    echo '           <mark>] [-D|--define <dname>] [-C|--class <cname>]'
  +    echo '           <file> [<file> ...]'
  +    echo '  version  [-l|--language <lang>] [-n|--name <name>] [-p|--prefix'
  +    echo '           <prefix>] [-s|--set <version>] [-e|--edit] [-i|--increase'
  +    echo '           <knob>] [-d|--display <type>] <file>'
  +    echo '  path     [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]'
  +    echo '           [-m|--magic] [-p|--path <path>] <str> [<str> ...]'
  +    echo ''
  +    exit 0
  +fi
  +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
  +    echo "GNU shtool 2.0.7 (19-May-2007)"
  +    exit 0
  +fi
  +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
  +    shtoolize -odevtool.shtool subst platform
  +    exit 0
  +fi
  +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then
  +    shift
  +    set -x
  +fi
  +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
  +case "$name" in
  +    subst|platform )
  +        #   implicit tool command selection
  +        tool="$name"
  +        ;;
  +    * )
  +        #   explicit tool command selection
  +        tool="$1"
  +        shift
  +        ;;
  +esac
  +arg_spec=""
  +opt_spec=""
  +gen_tmpfile=no
  +
  +##
  +##  DISPATCH INTO SCRIPT PROLOG
  +##
  +
  +case $tool in
  +    subst )
  +        str_tool="subst"
  +        str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>] [...]"
  +        gen_tmpfile=yes
  +        arg_spec="0+"
  +        opt_spec="v.t.n.w.q.s.i.b:e+f:"
  +        opt_alias="v:verbose,t:trace,n:nop,w:warning,q:quiet,s:stealth,i:interactive,b:backup,e:exec,f:file"
  +        opt_v=no
  +        opt_t=no
  +        opt_n=no
  +        opt_w=no
  +        opt_q=no
  +        opt_s=no
  +        opt_i=no
  +        opt_b=""
  +        opt_e=""
  +        opt_f=""
  +        ;;
  +    platform )
  +        str_tool="platform"
  +        str_usage="[-F|--format <format>] [-S|--sep <string>] [-C|--conc <string>] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type <type>] [-V|--version] [-h|--help]"
  +        arg_spec="0="
  +        opt_spec="F:S:C:L.U.v.c.n.t:d.V.h."
  +        opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help"
  +        opt_F="%{sp} (%{ap})"
  +        opt_S=" "
  +        opt_C="/"
  +        opt_L=no
  +        opt_U=no
  +        opt_t=""
  +        opt_v=no
  +        opt_c=no
  +        opt_n=no
  +        opt_V=no
  +        opt_h=no
  +        ;;
  +    -* )
  +        echo "$0:Error: unknown option \`$tool'" 2>&1
  +        echo "$0:Hint:  run \`$0 -h' for usage" 2>&1
  +        exit 1
  +        ;;
  +    * )
  +        echo "$0:Error: unknown command \`$tool'" 2>&1
  +        echo "$0:Hint:  run \`$0 -h' for usage" 2>&1
  +        exit 1
  +        ;;
  +esac
  +
  +##
  +##  COMMON UTILITY CODE
  +##
  +
  +#   commonly used ASCII values
  +ASC_TAB="	"
  +ASC_NL="
  +"
  +
  +#   determine name of tool
  +if [ ".$tool" != . ]; then
  +    #   used inside shtool script
  +    toolcmd="$0 $tool"
  +    toolcmdhelp="shtool $tool"
  +    msgprefix="shtool:$tool"
  +else
  +    #   used as standalone script
  +    toolcmd="$0"
  +    toolcmdhelp="sh $0"
  +    msgprefix="$str_tool"
  +fi
  +
  +#   parse argument specification string
  +eval `echo $arg_spec |\
  +      sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
  +
  +#   parse option specification string
  +eval `echo h.$opt_spec |\
  +      sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
  +
  +#   parse option alias string
  +eval `echo h:help,$opt_alias |\
  +      sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
  +
  +#   interate over argument line
  +opt_PREV=''
  +while [ $# -gt 0 ]; do
  +    #   special option stops processing
  +    if [ ".$1" = ".--" ]; then
  +        shift
  +        break
  +    fi
  +
  +    #   determine option and argument
  +    opt_ARG_OK=no
  +    if [ ".$opt_PREV" != . ]; then
  +        #   merge previous seen option with argument
  +        opt_OPT="$opt_PREV"
  +        opt_ARG="$1"
  +        opt_ARG_OK=yes
  +        opt_PREV=''
  +    else
  +        #   split argument into option and argument
  +        case "$1" in
  +            --[a-zA-Z0-9]*=*)
  +                eval `echo "x$1" |\
  +                      sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'`
  +                opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
  +                eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
  +                ;;
  +            --[a-zA-Z0-9]*)
  +                opt_OPT=`echo "x$1" | cut -c4-`
  +                opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
  +                eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
  +                opt_ARG=''
  +                ;;
  +            -[a-zA-Z0-9]*)
  +                eval `echo "x$1" |\
  +                      sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \
  +                          -e 's/";\(.*\)$/"; opt_ARG="\1"/'`
  +                ;;
  +            -[a-zA-Z0-9])
  +                opt_OPT=`echo "x$1" | cut -c3-`
  +                opt_ARG=''
  +                ;;
  +            *)
  +                break
  +                ;;
  +        esac
  +    fi
  +
  +    #   eat up option
  +    shift
  +
  +    #   determine whether option needs an argument
  +    eval "opt_MODE=\$opt_MODE_${opt_OPT}"
  +    if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then
  +        if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then
  +            opt_PREV="$opt_OPT"
  +            continue
  +        fi
  +    fi
  +
  +    #   process option
  +    case $opt_MODE in
  +        '.' )
  +            #   boolean option
  +            eval "opt_${opt_OPT}=yes"
  +            ;;
  +        ':' )
  +            #   option with argument (multiple occurances override)
  +            eval "opt_${opt_OPT}=\"\$opt_ARG\""
  +            ;;
  +        '+' )
  +            #   option with argument (multiple occurances append)
  +            eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
  +            ;;
  +        * )
  +            echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2
  +            echo "$msgprefix:Hint:  run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
  +            exit 1
  +            ;;
  +    esac
  +done
  +if [ ".$opt_PREV" != . ]; then
  +    echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2
  +    echo "$msgprefix:Hint:  run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
  +    exit 1
  +fi
  +
  +#   process help option
  +if [ ".$opt_h" = .yes ]; then
  +    echo "Usage: $toolcmdhelp $str_usage"
  +    exit 0
  +fi
  +
  +#   complain about incorrect number of arguments
  +case $arg_MODE in
  +    '=' )
  +        if [ $# -ne $arg_NUMS ]; then
  +            echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
  +            echo "$msgprefix:Hint:  run \`$toolcmd -h' or \`man shtool' for details" 1>&2
  +            exit 1
  +        fi
  +        ;;
  +    '+' )
  +        if [ $# -lt $arg_NUMS ]; then
  +            echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
  +            echo "$msgprefix:Hint:  run \`$toolcmd -h' or \`man shtool' for details" 1>&2
  +            exit 1
  +        fi
  +        ;;
  +esac
  +
  +#   establish a temporary file on request
  +if [ ".$gen_tmpfile" = .yes ]; then
  +    #   create (explicitly) secure temporary directory
  +    if [ ".$TMPDIR" != . ]; then
  +        tmpdir="$TMPDIR"
  +    elif [ ".$TEMPDIR" != . ]; then
  +        tmpdir="$TEMPDIR"
  +    else
  +        tmpdir="/tmp"
  +    fi
  +    tmpdir="$tmpdir/.shtool.$$"
  +    ( umask 077
  +      rm -rf "$tmpdir" >/dev/null 2>&1 || true
  +      mkdir  "$tmpdir" >/dev/null 2>&1
  +      if [ $? -ne 0 ]; then
  +          echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2
  +          exit 1
  +      fi
  +    )
  +
  +    #   create (implicitly) secure temporary file
  +    tmpfile="$tmpdir/shtool.tmp"
  +    touch "$tmpfile"
  +fi
  +
  +#   utility function: map string to lower case
  +util_lower () {
  +    echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
  +}
  +
  +#   utility function: map string to upper case
  +util_upper () {
  +    echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  +}
  +
  +#   cleanup procedure
  +shtool_exit () {
  +    rc="$1"
  +    if [ ".$gen_tmpfile" = .yes ]; then
  +        rm -rf "$tmpdir" >/dev/null 2>&1 || true
  +    fi
  +    exit $rc
  +}
  +
  +##
  +##  DISPATCH INTO SCRIPT BODY
  +##
  +
  +case $tool in
  +
  +subst )
  +    ##
  +    ##  subst -- Apply sed(1) substitution operations
  +    ##  Copyright (c) 2001-2007 Ralf S. Engelschall <rse@engelschall.com>
  +    ##
  +
  +    #   remember optional list of file(s)
  +    files="$*"
  +    files_num="$#"
  +
  +    #   parameter consistency check
  +    if [ $# -eq 0 ] && [ ".$opt_b" != . ]; then
  +        echo "$msgprefix:Error: option -b cannot be applied to stdin" 1>&2
  +        shtool_exit 1
  +    fi
  +    if [ $# -eq 0 ] && [ ".$opt_s" = .yes ]; then
  +        echo "$msgprefix:Error: option -s cannot be applied to stdin" 1>&2
  +        shtool_exit 1
  +    fi
  +
  +    #   build underlying sed(1) command
  +    sedcmd='sed'
  +    if [ ".$opt_e" != . ]; then
  +        OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS"
  +        for e
  +        do
  +            sedcmd="$sedcmd -e '$e'"
  +        done
  +    elif [ ".$opt_f" != . ]; then
  +        if [ ! -f $opt_f ]; then
  +            echo "$msgprefix:Error: command file \`$opt_f' not found or not a regular file" 1>&2
  +            shtool_exit 1
  +        fi
  +        sedcmd="$sedcmd -f '$opt_f'"
  +    else
  +        echo "$msgprefix:Error: either -e option(s) or -f option required" 1>&2
  +        shtool_exit 1
  +    fi
  +
  +    #   determine extension for original file
  +    orig=".orig"
  +    if [ ".$opt_b" != . ]; then
  +        orig="$opt_b"
  +    fi
  +
  +    #   apply sed(1) operation(s)
  +    if [ ".$files" != . ]; then
  +        #   apply operation(s) to files
  +        substdone=no
  +        for file in $files; do
  +            test ".$file" = . && continue
  +            if [ ! -f $file ]; then
  +                echo "$msgprefix:Warning: file \`$file' not found or not a regular file" 1>&2
  +                continue
  +            fi
  +
  +            #   handle interactive mode
  +            if [ ".$opt_i" = .yes ]; then
  +                eval "$sedcmd <$file >$file.new"
  +                skip=no
  +                if cmp $file $file.new >/dev/null 2>&1; then
  +                    rm -f $file.new
  +                    skip=yes
  +                else
  +                    (diff -U1 $file $file.new >$tmpfile) 2>/dev/null
  +                    if [ ".`cat $tmpfile`" = . ]; then
  +                        (diff -C1 $file $file.new >$tmpfile) 2>/dev/null
  +                        if [ ".`cat $tmpfile`" = . ]; then
  +                            echo "$msgprefix:Warning: unable to show difference for file \`$file'" 1>&2
  +                            cp /dev/null $tmpfile
  +                        fi
  +                    fi
  +                    rm -f $file.new
  +                    cat $tmpfile
  +                    echo dummy | awk '{ printf("%s", TEXT); }' TEXT=">>> Apply [Y/n]: "
  +                    read input
  +                    if [ ".$input" != .Y ] &&\
  +                       [ ".$input" != .y ] &&\
  +                       [ ".$input" != . ]; then
  +                       skip=yes
  +                    fi
  +                fi
  +                if [ ".$skip" = .yes ]; then
  +                    if [ ".$opt_v" = .yes ]; then
  +                        echo "file \`$file' -- skipped" 1>&2
  +                    fi
  +                    continue
  +                fi
  +            fi
  +
  +            #   apply sed(1) operation(s)
  +            if [ ".$opt_v" = .yes ]; then
  +                echo "patching \`$file'" 1>&2
  +            fi
  +            if [ ".$opt_t" = .yes ]; then
  +                echo "\$ cp -p $file $file$orig"
  +                echo "\$ chmod u+w $file"
  +                echo "\$ $sedcmd <$file$orig >$file"
  +            fi
  +            if [ ".$opt_n" = .no ]; then
  +                cp -p $file $file$orig
  +                chmod u+w $file >/dev/null 2>&1 || true
  +                eval "$sedcmd <$file$orig >$file"
  +            fi
  +
  +            #   optionally fix timestamp
  +            if [ ".$opt_s" = .yes ]; then
  +                if [ ".$opt_t" = .yes ]; then
  +                    echo "\$ touch -r $file$orig $file"
  +                fi
  +                if [ ".$opt_n" = .no ]; then
  +                    touch -r $file$orig $file
  +                fi
  +            fi
  +
  +            #   optionally check whether any content change actually occurred 
  +            if [ ".$opt_q" = .no ]; then
  +                if cmp $file$orig $file >/dev/null 2>&1; then
  +                    if [ ".$opt_w" = .yes ]; then
  +                        echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
  +                    fi
  +                else
  +                    substdone=yes
  +                fi
  +            fi
  +
  +            #   optionally remove preserved original file
  +            if [ ".$opt_b" = . ]; then
  +                if [ ".$opt_t" = .yes ]; then
  +                    echo "\$ rm -f $file$orig"
  +                fi
  +                if [ ".$opt_n" = .no ]; then
  +                    rm -f $file$orig
  +                fi
  +            fi
  +        done
  +        if [ ".$opt_q" = .no ] && [ ".$opt_w" = .no ]; then
  +            if [ ".$substdone" = .no ]; then
  +                if [ ".$files_num" = .1 ]; then
  +                    echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
  +                else
  +                    echo "$msgprefix:Warning: substitution resulted in no content change on any file" 1>&2
  +                fi
  +            fi
  +        fi
  +    else
  +        #   apply operation(s) to stdin/stdout
  +        if [ ".$opt_v" = .yes ]; then
  +            echo "patching <stdin>" 1>&2
  +        fi
  +        if [ ".$opt_t" = .yes ]; then
  +            echo "\$ $sedcmd"
  +        fi
  +        if [ ".$opt_n" = .no ]; then
  +            eval "$sedcmd"
  +        fi
  +    fi
  +
  +    shtool_exit 0
  +    ;;
  +
  +platform )
  +    ##
  +    ##  platform -- Platform Identification Utility
  +    ##  Copyright (c) 2003-2007 Ralf S. Engelschall <rse@engelschall.com>
  +    ##
  +
  +    #   option post-processing
  +    if [ ".$opt_t" != . ]; then
  +        case "$opt_t" in
  +            binary )
  +                #   binary package id (OpenPKG RPM)
  +                opt_F="%<ap>-%<sp>"
  +                opt_L=yes
  +                opt_S=""
  +                opt_C="+"
  +                ;;
  +            build )
  +                #   build time checking (OpenPKG RPM)
  +                opt_F="%<at>-%<st>"
  +                opt_L=yes
  +                opt_S=""
  +                opt_C="+"
  +                ;;
  +            gnu )
  +                #   GNU config.guess style <arch>-<vendor>-<os><osversion>
  +                opt_F="%<at>-unknown-%<st>"
  +                opt_L=yes
  +                opt_S=""
  +                opt_C="+"
  +                ;;
  +            web )
  +                #   non-whitespace HTTP Server-header id
  +                opt_F="%<sp>-%<ap>"
  +                opt_S="/"
  +                opt_C="+"
  +                ;;
  +            summary)
  +                #   human readable verbose summary information
  +                opt_F="Class:      %[sc] (%[ac])\\nProduct:    %[sp] (%[ap])\\nTechnology: %[st] (%[at])"
  +                opt_S=" "
  +                opt_C="/"
  +                ;;
  +            all-in-one )
  +                #   full-table all-in-one information
  +                opt_F=""
  +                opt_F="${opt_F}concise architecture class:      %<ac>\\n"
  +                opt_F="${opt_F}regular architecture class:      %{ac}\\n"
  +                opt_F="${opt_F}verbose architecture class:      %[ac]\\n"
  +                opt_F="${opt_F}concise architecture product:    %<ap>\\n"
  +                opt_F="${opt_F}regular architecture product:    %{ap}\\n"
  +                opt_F="${opt_F}verbose architecture product:    %[ap]\\n"
  +                opt_F="${opt_F}concise architecture technology: %<at>\\n"
  +                opt_F="${opt_F}regular architecture technology: %{at}\\n"
  +                opt_F="${opt_F}verbose architecture technology: %[at]\\n"
  +                opt_F="${opt_F}concise system class:            %<sc>\\n"
  +                opt_F="${opt_F}regular system class:            %{sc}\\n"
  +                opt_F="${opt_F}verbose system class:            %[sc]\\n"
  +                opt_F="${opt_F}concise system product:          %<sp>\\n"
  +                opt_F="${opt_F}regular system product:          %{sp}\\n"
  +                opt_F="${opt_F}verbose system product:          %[sp]\\n"
  +                opt_F="${opt_F}concise system technology:       %<st>\\n"
  +                opt_F="${opt_F}regular system technology:       %{st}\\n"
  +                opt_F="${opt_F}verbose system technology:       %[st]"
  +                ;;
  +            * )
  +                echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2
  +                exit 1
  +                ;;
  +        esac
  +    fi
  +
  +    #   assemble initial platform information
  +    UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\
  +    UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\
  +    UNAME_MACHINE='unknown'
  +    UNAME_SYSTEM=`(uname -s) 2>/dev/null`  ||\
  +    UNAME_SYSTEM='unknown'
  +    UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\
  +    UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\
  +    UNAME_RELEASE='unknown'
  +
  +    UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}"
  +
  +    AC=""; AP=""; AT=""
  +    SC=""; SP=""; ST=""
  +
  +    #    dispatch into platform specific sections
  +    case "${UNAME}" in
  +
  +        #   FreeBSD
  +        *:FreeBSD:* )
  +            #   determine architecture
  +            AC="${UNAME_MACHINE}"
  +            case "${AC}" in
  +                i386 ) AC="iX86" ;;
  +            esac
  +            AP="${AC}"
  +            AT="${AP}"
  +            if [ ".${AT}" = ".iX86" ]; then
  +                case "`(/sbin/sysctl -n hw.model) 2>&1`" in
  +                    *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;;
  +                    *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;;
  +                    *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;;
  +                esac
  +            fi
  +            #   determine system
  +            r=`echo "${UNAME_RELEASE}" |\
  +               sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'`
  +            ST="FreeBSD ${r}"
  +            SP="${ST}"
  +            case "${r}" in
  +                1.* ) SC="4.3BSD" ;;
  +                *   ) SC="4.4BSD" ;;
  +            esac
  +            ;;
  +
  +        #   NetBSD
  +        *:NetBSD:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            AP="${AT}"
  +            case "${AP}" in
  +                i[3-6]86 ) AP="iX86" ;;
  +            esac
  +            AC="${AP}"
  +            #   determine system
  +            r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
  +            ST="NetBSD ${r}"
  +            SP="${ST}"
  +            case "${r}" in
  +                0.* ) SC="4.3BSD" ;;
  +                *   ) SC="4.4BSD" ;;
  +            esac
  +            ;;
  +
  +        #   OpenBSD
  +        *:OpenBSD:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            AP="${AT}"
  +            case "${AP}" in
  +                i[3-6]86 ) AP="iX86" ;;
  +            esac
  +            AC="${AP}"
  +            #   determine system
  +            r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
  +            ST="OpenBSD ${r}"
  +            SP="${ST}"
  +            SC="4.4BSD"
  +            ;;
  +
  +        #   GNU/Linux
  +        *:Linux:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            case "${AT}" in
  +               ia64     ) AT="IA64"   ;;
  +               x86_64   ) AT='AMD64'  ;;
  +               parisc   ) AT="HPPA32" ;;
  +               parisc64 ) AT="HPPA64" ;;
  +            esac
  +            AP="${AT}"
  +            case "${AP}" in
  +               i[3-6]86 ) AP='iX86' ;;
  +            esac
  +            AC="${AP}"
  +            #   determine system
  +            v_kern=`echo "${UNAME_RELEASE}" |\
  +                sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
  +            v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\
  +                env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null`
  +            ST="GNU/<Linux >${v_libc}/<${v_kern}>"
  +            if [ -f /etc/lsb-release ]; then
  +                eval `( . /etc/lsb-release
  +                    echo "SC=\"LSB${LSB_VERSION}\""
  +                    if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then
  +                        echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\""
  +                    fi
  +                ) 2>/dev/null`
  +            fi
  +            if [ ".$SP" = . ]; then
  +                for tagfile in x \
  +                    `cd /etc && \
  +                    /bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \
  +                    sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \
  +                    echo redhat-release lsb-release`
  +                do
  +                    [ ".${tagfile}" = .x ] && continue
  +                    [ ! -f "/etc/${tagfile}" ] && continue
  +                    n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
  +                    v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\
  +                       sed -e 's/^/#/' \
  +                           -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
  +                           -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
  +                           -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
  +                           -e 's/^#.*$//'`
  +                    case "`util_lower ${n}`" in
  +                        redhat )
  +                            if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then
  +                                n="<R>ed <H>at <E>nterprise <L>inux"
  +                            else
  +                                n="<R>ed <H>at <L>inux"
  +                            fi
  +                            ;;
  +                        debian             ) n="Debian[ GNU/Linux]"        ;;
  +                        ubuntu             ) n="Ubuntu[ GNU/Linux]"        ;;
  +                        fedora             ) n="<Fedora> Core[ GNU/Linux]" ;;
  +                        suse               ) n="SuSE[ Linux]"              ;;
  +                        mandrake*|mandriva ) n="Mandriva[ Linux]"          ;;
  +                        gentoo             ) n="Gentoo[ GNU/Linux]"        ;;
  +                        slackware          ) n="Slackware[ Linux]"         ;;
  +                        turbolinux         ) n="TurboLinux"                ;;
  +                        unitedlinux        ) n="UnitedLinux"               ;;
  +                        *                  ) n="${n}[ GNU/Linux]"          ;;
  +                    esac
  +                    case "$n" in
  +                        *"<"*">"* ) SP="$n <$v>" ;;
  +                        *         ) SP="$n $v"   ;;
  +                    esac
  +                    break
  +                done
  +            fi
  +            [ ".$SP" = . ] && SP="${ST}"
  +            [ ".$SC" = . ] && SC="LSB"
  +            ;;
  +
  +        #   Sun Solaris
  +        *:SunOS:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            case "${AT}" in
  +                i86pc )
  +                    AT="iX86"
  +                    case "`(/bin/isainfo -k) 2>&1`" in
  +                        amd64 ) AT="AMD64" ;;
  +                    esac
  +                    ;;
  +            esac
  +            AP="${AT}"
  +            case "${AP}" in
  +                sun4[cdm] ) AP="SPARC32" ;;
  +                sun4[uv]  ) AP="SPARC64" ;;
  +                sun4*     ) AP="SPARC"   ;;
  +            esac
  +            AC="${AP}"
  +            case "${AC}" in
  +                SPARC* ) AC="SPARC" ;;
  +            esac
  +            #   determine system
  +            ST="[Sun ]SunOS ${UNAME_RELEASE}"
  +            v=`echo "${UNAME_RELEASE}" |\
  +               sed -e 's;^4\.;1.;' \
  +                   -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \
  +                   -e 's;^5\.\([0-9][0-9]*\).*;\1;'`
  +            SP="[Sun ]Solaris $v"
  +            case "${UNAME_RELEASE}" in
  +                4.* ) SC="4.3BSD" ;;
  +                5.* ) SC="SVR4"   ;;
  +            esac
  +            ;;
  +
  +        #   SCO UnixWare
  +        *:UnixWare:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            case "${AT}" in
  +                i[3-6]86 | ix86at ) AT="iX86" ;;
  +            esac
  +            AP="${AT}"
  +            #   determine system
  +            v=`/sbin/uname -v`
  +            ST="[SCO ]UnixWare ${v}"
  +            SP="${ST}"
  +            SC="SVR${UNAME_RELEASE}"
  +            ;;
  +
  +        #   QNX
  +        *:QNX:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            case "${AT}" in
  +                x86pc ) AT="iX86" ;;
  +            esac
  +            AP="${AT}"
  +            #   determine system
  +            v="${UNAME_RELEASE}"
  +            ST="QNX[ Neutrino RTOS] ${v}"
  +            v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'`
  +            SP="QNX[ Neutrino RTOS] ${v}"
  +            SC="QNX"
  +            ;;
  +
  +        #   SGI IRIX
  +        *:IRIX*:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            AP="${AT}"
  +            case "${AP}:${UNAME_SYSTEM}" in
  +                IP*:IRIX64 ) AP="MIPS64" ;;
  +                IP*:*      ) AP="MIPS"   ;;
  +            esac
  +            AC="${AP}"
  +            #   determine system
  +            v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'`
  +            ST="[SGI ]IRIX ${v}"
  +            v="${UNAME_RELEASE}"
  +            SP="[SGI ]IRIX ${v}"
  +            SC="4.2BSD/SVR3"
  +            ;;
  +
  +        #   HP HP-UX
  +        *:HP-UX:* )
  +            #   determine architecture
  +            AT="${UNAME_MACHINE}"
  +            case "${AT}" in
  +                ia64 ) AT="IA64" ;;
  +                9000/[34]?? ) AT=M68K ;;
  +                9000/[678][0-9][0-9])
  +                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  +                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  +                    case "${sc_cpu_version}" in
  +                        523 ) AT="HPPA1.0" ;;
  +                        528 ) AT="HPPA1.1" ;;
  +                        532 ) AT="HPPA2.0"
  +                            case "${sc_kernel_bits}" in
  +                                32 ) AT="${AT}n" ;;
  +                                64 ) AT="${AT}w" ;;
  +                            esac
  +                            ;;
  +                    esac
  +                    ;;
  +            esac
  +            AP="${AT}"
  +            case "${AP}" in
  +                HPPA* ) AP="HPPA" ;;
  +            esac
  +            AC="${AP}"
  +            #   determine system
  +            v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'`
  +            ST="[HP ]<HP>-<UX ${v}>"
  +            SP="${ST}"
  +            case "${v}" in
  +                10.*   ) SC="SVR4.2" ;;
  +                [7-9]* ) SC="SVR4"   ;;
  +            esac
  +            ;;
  +
  +        #   HP Tru64 (OSF1)
  +        *:OSF1:* )
  +            #   determine architecture
  +            AP="${UNAME_MACHINE}"
  +            case "${AP}" in
  +                alpha ) AP="Alpha" ;;
  +            esac
  +            alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\
  +                sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'`
  +            AT="${AP}${alpha_type}"
  +            AC="${AP}"
  +            #   determine system
  +            v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'`
  +            ST="[HP ]Tru64 ${v}"
  +            SP="${ST}"
  +            SC="OSF1"
  +            ;;
  +
  +        #   IBM AIX
  +        *:AIX:* )
  +            cpu_arch=rs6000
  +            if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
  +                cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  +                if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then
  +                    cpu_arch=powerpc
  +                fi
  +            elif [ -d /QOpenSys ]; then
  +                #   IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment)
  +                cpu_arch=powerpc
  +            fi
  +            if [ -x /usr/bin/oslevel ]; then
  +                os_level=`/usr/bin/oslevel`
  +            else
  +                os_level="`uname -v`.`uname -r`"
  +            fi
  +            os_level=`echo "${os_level}" |\
  +                      sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \
  +                          -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'`
  +            AT="${cpu_arch}"
  +            AP="${AT}"
  +            AC="${AP}"
  +            ST="[IBM ]<AIX >${os_level}"
  +            SP="${ST}"
  +            case "${os_level}" in
  +                [12]* ) SC="SVR2" ;;
  +                *     ) SC="SVR4" ;;
  +            esac
  +            ;;
  +
  +        #   Apple MacOS X Darwin
  +        *:Darwin:* )
  +            AT=`uname -p`
  +            case "${AT}" in
  +                powerpc ) AT="PPC" ;;
  +            esac
  +            AP="${AT}"
  +            AC="${AP}"
  +            case "${AC}" in
  +                i?86 ) AC="iX86" ;;
  +            esac
  +            ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}"
  +            SP="${ST}"
  +            SC="4.4BSD/Mach3"
  +            ;;
  +
  +        #   TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
  +        # *:XXX:* )
  +        #   ...
  +        #   ;;
  +
  +        #   ...A STILL UNKNOWN PLATFORM...
  +        * )
  +            AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"`
  +            AP="${AT}"
  +            AC="${AP}"
  +            v=`echo "${UNAME_RELEASE}" |\
  +               sed -e 's/^/#/' \
  +                   -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
  +                   -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
  +                   -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
  +                   -e 's/^#.*$/?/'`
  +            ST="${UNAME_SYSTEM} ${v}"
  +            SP="${ST}"
  +            SC="${SP}"
  +            ;;
  +
  +    esac
  +
  +    #   provide fallback values
  +    [ ".$AT" = . ] && AT="${AP:-${AC}}"
  +    [ ".$AP" = . ] && AP="${AT:-${AC}}"
  +    [ ".$AC" = . ] && AC="${AP:-${AT}}"
  +    [ ".$ST" = . ] && ST="${SP:-${SC}}"
  +    [ ".$SP" = . ] && SP="${ST:-${SC}}"
  +    [ ".$SC" = . ] && SC="${SP:-${ST}}"
  +
  +    #   support explicit enforced verbose/concise output
  +    if [ ".$opt_v" = .yes ]; then
  +        opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'`
  +    elif [ ".$opt_c" = .yes ]; then
  +        opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'`
  +    fi
  +
  +    #   provide verbose and concise variants
  +    AC_V=""; AC_N=""; AC_C=""
  +    AP_V=""; AP_N=""; AP_C=""
  +    AT_V=""; AT_N=""; AT_C=""
  +    SC_V=""; SC_N=""; SC_C=""
  +    SP_V=""; SP_N=""; SP_C=""
  +    ST_V=""; ST_N=""; ST_C=""
  +    for var_lc in at ap ac st sp sc; do
  +        case "$opt_F" in
  +            *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* )
  +            var_uc=`util_upper "$var_lc"`
  +            eval "val=\"\$${var_uc}\""
  +            val_V=""; val_N=""; val_C=""
  +            case "$opt_F" in
  +                *"%[${var_lc}]"* )
  +                    val_V=`echo ":$val" | \
  +                           sed -e 's/^://' \
  +                               -e 's;\[\([^]]*\)\];\1;g' \
  +                               -e 's;<\([^>]*\)>;\1;g' \
  +                               -e "s; ;;g" \
  +                               -e "s;/;%%;g" \
  +                               -e "s;;${opt_S};g" \
  +                               -e "s;%%;${opt_C};g"`
  +                    eval "${var_uc}_V=\"\${val_V}\""
  +                    ;;
  +            esac
  +            case "$opt_F" in
  +                *"%{${var_lc}}"* | *"%${var_lc}"* )
  +                    val_N=`echo ":$val" | \
  +                           sed -e 's/^://' \
  +                               -e 's;\[\([^]]*\)\];;g' \
  +                               -e 's;<\([^>]*\)>;\1;g' \
  +                               -e "s; ;;g" \
  +                               -e "s;/;%%;g" \
  +                               -e "s;;${opt_S};g" \
  +                               -e "s;%%;${opt_C};g"`
  +                    eval "${var_uc}_N=\"\${val_N}\""
  +                    ;;
  +            esac
  +            case "$opt_F" in
  +                *"%<${var_lc}>"* )
  +                    val_C=`echo ":$val" | \
  +                           sed -e 's/^://' \
  +                               -e 's;\[\([^]]*\)\];;g' \
  +                               -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \
  +                               -e "s; ;;g" \
  +                               -e "s;/;%%;g" \
  +                               -e "s;;${opt_S};g" \
  +                               -e "s;%%;${opt_C};g"`
  +                    eval "${var_uc}_C=\"\${val_C}\""
  +                    ;;
  +            esac
  +            ;;
  +        esac
  +    done
  +
  +    #   create output string
  +    output=`echo ":$opt_F" |\
  +            sed -e "s/^://" \
  +                -e "s;%\\[ac\\];${AC_V};g" \
  +                -e "s;%{ac};${AC_N};g" \
  +                -e "s;%ac;${AC_N};g" \
  +                -e "s;%<ac>;${AC_C};g" \
  +                -e "s;%\\[ap\\];${AP_V};g" \
  +                -e "s;%{ap};${AP_N};g" \
  +                -e "s;%ap;${AP_N};g" \
  +                -e "s;%<ap>;${AP_C};g" \
  +                -e "s;%\\[at\\];${AT_V};g" \
  +                -e "s;%{at};${AT_N};g" \
  +                -e "s;%at;${AT_N};g" \
  +                -e "s;%<at>;${AT_C};g" \
  +                -e "s;%\\[sc\\];${SC_V};g" \
  +                -e "s;%{sc};${SC_N};g" \
  +                -e "s;%sc;${SC_N};g" \
  +                -e "s;%<sc>;${SC_C};g" \
  +                -e "s;%\\[sp\\];${SP_V};g" \
  +                -e "s;%{sp};${SP_N};g" \
  +                -e "s;%sp;${SP_N};g" \
  +                -e "s;%<sp>;${SP_C};g" \
  +                -e "s;%\\[st\\];${ST_V};g" \
  +                -e "s;%{st};${ST_N};g" \
  +                -e "s;%st;${ST_N};g" \
  +                -e "s;%<st>;${ST_C};g" \
  +                -e 's/\\\\n/^/g' |\
  +             tr '^' '\012'`
  +
  +    #   support lower/upper-case mapping
  +    if [ ".$opt_L" = .yes ]; then
  +        output=`util_lower "$output"`
  +    elif [ ".$opt_U" = .yes ]; then
  +        output=`util_upper "$output"`
  +    fi
  +
  +    #   display output string
  +    if [ ".$opt_n" = .yes ]; then
  +        echo . | awk '{ printf("%s", output); }' output="$output"
  +    else
  +        echo "$output"
  +    fi
  +
  +    shtool_exit 0
  +    ;;
  +
  +esac
  +
  +shtool_exit 0
  +
  @@ .
Received on Fri Jul 20 14:13:54 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.