OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   12-May-2006 11:58:01
  Branch: HEAD                             Handle: 2006051210580000

  Added files:
    openpkg-src/openpkg     build.sh
  Modified files:
    openpkg-src/openpkg     HISTORY openpkg.spec

  Log:
    add a bootstrap wrapper for "openpkg build" command similar to
    "openpkg install"

  Summary:
    Revision    Changes     Path
    1.326       +1  -0      openpkg-src/openpkg/HISTORY
    1.1         +121 -0     openpkg-src/openpkg/build.sh
    1.478       +5  -0      openpkg-src/openpkg/openpkg.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/HISTORY
  ============================================================================
  $ cvs diff -u -r1.325 -r1.326 HISTORY
  --- openpkg-src/openpkg/HISTORY       12 May 2006 09:22:23 -0000      1.325
  +++ openpkg-src/openpkg/HISTORY       12 May 2006 09:58:00 -0000      1.326
  @@ -2,6 +2,7 @@
   2006
   ====
   
  +20060512 add a bootstrap wrapper for "openpkg build" command similar to 
"openpkg install"
   20060512 fix "openpkg install" command under OpenPKG Registry world order by 
using RDF index files
   20060512 include a copy of the OpenPKG Registry client ("openpkg register")
   20060419 upgrade to GNU shtool 2.0.6
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/build.sh
  ============================================================================
  $ cvs diff -u -r0 -r1.1 build.sh
  --- /dev/null 2006-05-12 11:57:22 +0200
  +++ build.sh  2006-05-12 11:58:01 +0200
  @@ -0,0 +1,121 @@
  [EMAIL PROTECTED]@/lib/openpkg/bash
  +##
  +##  build -- OpenPKG Tool Chain "build" command (BOOSTRAP VERSION ONLY)
  +##  Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  +##  Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  +##
  +##  Permission to use, copy, modify, and distribute this software for
  +##  any purpose with or without fee is hereby granted, provided that
  +##  the above copyright notice and this permission notice appear in all
  +##  copies.
  +##
  +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  +##  SUCH DAMAGE.
  +##
  +
  +##
  +##  This command emulates the "openpkg build openpkg-tools" command
  +##  in order to bootstrap the installation of the OpenPKG Tool Chain.
  +##
  +
  +#   determine OpenPKG release and download URLs
  +release=`$OPENPKG_PREFIX/bin/openpkg rpm --eval '%{l_openpkg_release -F 
"%s"}'`
  +case "$release" in
  +    CURRENT )
  +        url_src="ftp://ftp.openpkg.org/current/SRC";
  +        url_upd=""
  +        ;;
  +    [0-9].[0-9] )
  +        url_src="ftp://ftp.openpkg.org/release/$release/SRC";
  +        url_upd="ftp://ftp.openpkg.org/release/$release/UPD";
  +        ;;
  +    * )
  +        echo "openpkg:ERROR: invalid OpenPKG release \"$release\"" 1>&2
  +        exit 1
  +        ;;
  +esac
  +
  +#   mimimum command line option parsing
  +while [ $# -gt 0 ]; do
  +    case "$1" in
  +        -r  ) shift; url_src="$1"; url_upd=""; shift ;;
  +        -r* ) url_src="${1/-r/}"; url_upd="" shift ;;
  +        *   ) break ;;
  +    esac
  +done
  +case "$url_src" in
  +    /* ) url_src="file://$url_src" ;;
  +esac
  +
  +#   sanity check usage
  +if [ $# -eq 1 -a ".$1" = ".openpkg-tools" ]; then
  +    :
  +else
  +    echo "openpkg:ERROR: still not available functionality \"build $*\""     
                   1>&2
  +    echo "openpkg:INFO: This functionality is provided by the 
\"openpkg-tools\" package only!"    1>&2
  +    echo "openpkg:INFO: Run the command \"$OPENPKG_PREFIX/bin/openpkg build 
openpkg-tools | sh\" to" 1>&2
  +    echo "openpkg:INFO: bootstrap the \"openpkg-tools\" package for 
additional functionality."    1>&2
  +    echo "openpkg:INFO: This bootstrap version only supports this particular 
build command."    1>&2
  +    exit 1
  +fi
  +
  +#   determine path to binary RPMs
  +rpmdir=`$OPENPKG_PREFIX/bin/openpkg rpm --eval '%{_rpmdir}'`
  +rpmtag=`$OPENPKG_PREFIX/bin/openpkg rpm --eval '%{l_platform -p}-%{l_tag}'`
  +
  +#   iterate through package installation in dependency order
  +for pkg in openpkg make binutils gcc perl openpkg-tools; do
  +    #   determine latest package version and URL
  +    pkg_srpm=""
  +    pkg_name=""
  +    for url in $url_upd $url_src; do
  +        if [ ".$url" = . ]; then
  +            continue
  +        fi
  +        pkg_name=`$OPENPKG_PREFIX/lib/openpkg/curl -s "$url/00INDEX.rdf.bz2" 
|\
  +            $OPENPKG_PREFIX/lib/openpkg/bzip2 -q -d |\
  +            egrep "rdf:Description about=\"${pkg}-[0-9]" |\
  +            sed -e 's;^.*rdf:Description about="\([^"]*\)".*$;\1;' |\
  +            sed -e "s;^;X;" \
  +                -e "s;^X${pkg}-\\([0-9][^-]*\\)-\\([^-][^-]*\\);\\2:\\1;" \
  +                -e "s;^X.*;;" |\
  +            sort -r | sed -e 'q' |\
  +            sed -e "s;^\\([^:]*\\):\\(.*\\);${pkg}-\\2-\\1;"`
  +        if [ ".$pkg_name" != . ]; then
  +            pkg_srpm="$url/$pkg_name.src.rpm"
  +            break
  +        fi
  +    done
  +    if [ ".$pkg_name" = . ]; then
  +        echo "openpkg:ERROR: package \"$pkg\" not found under URLs:" 1>&2
  +        if [ ".$url_upd" != . ]; then
  +            echo "openpkg:ERROR: $url_upd" 1>&2
  +        fi
  +        echo "openpkg:ERROR: $url_src" 1>&2
  +        exit 1
  +    fi
  +
  +    #   check whether package is already installed
  +    if [ ".`$OPENPKG_PREFIX/bin/openpkg rpm -q $pkg_name | grep -v 'is not 
installed'`" != . ]; then
  +        continue
  +    fi
  +
  +    #   output build commands
  +    echo ":::: $pkg_srpm ::::"
  +    if [ ! -f "$rpmdir/$pkg_name.$rpmtag.rpm" ]; then
  +        echo "$OPENPKG_PREFIX/bin/openpkg rpm --rebuild $pkg_srpm || exit 
\$?"
  +    fi
  +    echo "$OPENPKG_PREFIX/bin/openpkg rpm -Uvh $rpmdir/$pkg_name.$rpmtag.rpm 
|| exit \$?"
  +    echo ":::: $pkg_srpm = \$? ::::"
  +done
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/openpkg.spec
  ============================================================================
  $ cvs diff -u -r1.477 -r1.478 openpkg.spec
  --- openpkg-src/openpkg/openpkg.spec  12 May 2006 09:05:28 -0000      1.477
  +++ openpkg-src/openpkg/openpkg.spec  12 May 2006 09:58:00 -0000      1.478
  @@ -133,6 +133,7 @@
   Source61:     uuid.pod
   Source62:     uuid.sh
   Source63:     
ftp://ftp.openpkg.org/sources/CPY/openpkg-registry/openpkg-registry-%{V_registry}.tar.gz
  +Source64:     build.sh
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -1082,6 +1083,9 @@
           <`SOURCE install.sh` 
>$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/install
       chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/install
       sed -e "s;@l_prefix@;%{l_prefix};g" \
  +        <`SOURCE build.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/build
  +    chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/build
  +    sed -e "s;@l_prefix@;%{l_prefix};g" \
           <`SOURCE man.sh` >$RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/man
       chmod a+x $RPM_BUILD_ROOT%{l_prefix}/libexec/openpkg/man
   
  @@ -1303,6 +1307,7 @@
       %{l_prefix}/libexec/openpkg/uuid
       %{l_prefix}/libexec/openpkg/uuid.8
       %{l_prefix}/libexec/openpkg/man
  +    %{l_prefix}/libexec/openpkg/build
       %{l_prefix}/libexec/openpkg/install
       %{l_prefix}/libexec/openpkg/lsync
       %{l_prefix}/libexec/openpkg/lsync.8
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [email protected]

Reply via email to