RPM Community Forums

Mailing List Message of <rpm-cvs>

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

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Thu 30 Aug 2007 - 11:34:09 CEST
Message-Id: <20070830093409.256B034845B@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:   30-Aug-2007 11:34:09
  Branch: HEAD                             Handle: 2007083010340800

  Modified files:
    rpm                     CHANGES devtool devtool.conf

  Log:
    make devtool %standalone fully modular for allowing its modules to be
    reused in other devtool targets.

  Summary:
    Revision    Changes     Path
    1.1609      +1  -0      rpm/CHANGES
    2.8         +4  -2      rpm/devtool
    2.94        +122 -114   rpm/devtool.conf
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1608 -r1.1609 CHANGES
  --- rpm/CHANGES	28 Aug 2007 20:45:48 -0000	1.1608
  +++ rpm/CHANGES	30 Aug 2007 09:34:08 -0000	1.1609
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - rse: make devtool %standalone fully modular for allowing its modules to be reused in other devtool targets
       - jbj: assume that mount(2) et al are linux-peculier for the moment.
       - jbj: add rpmio Mount/Umount/Umount2 stubs.
       - jbj: permit keyutils caching disable, don't re-add if already cached.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/devtool
  ============================================================================
  $ cvs diff -u -r2.7 -r2.8 devtool
  --- rpm/devtool	30 Aug 2007 08:27:40 -0000	2.7
  +++ rpm/devtool	30 Aug 2007 09:34:08 -0000	2.8
  @@ -62,9 +62,11 @@
   }
   
   devtool_source () {
  -    _tmpfile="${TMPDIR-/tmp}/devtool.$$.tmp.source"
  +    _tmpfile="${TMPDIR-/tmp}/devtool.$$.tmp.$2"
       rm -f $_tmpfile
  -    sed <${DEVTOOL_SRCDIR}/devtool.conf -e "1,/^%$2/d" -e '/^%.*/,$d' >$_tmpfile
  +    sed <${DEVTOOL_SRCDIR}/devtool.conf -e "1,/^%$2/d" -e '/^%.*/,$d' |\
  +    sed -e 's;\([ 	]\)@\([a-zA-Z_][a-zA-Z0-9_-]*\);\1devtool_\2;' \
  +        -e 's;\([ 	]\)%\([a-zA-Z_][a-zA-Z0-9_-]*\);\1devtool_execute \2;' >$_tmpfile
       . $_tmpfile
       rm -f $_tmpfile
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  ============================================================================
  $ cvs diff -u -r2.93 -r2.94 devtool.conf
  --- rpm/devtool.conf	30 Aug 2007 08:31:46 -0000	2.93
  +++ rpm/devtool.conf	30 Aug 2007 09:34:08 -0000	2.94
  @@ -130,60 +130,6 @@
   %rse
       %standalone
   
  -%thirdpartydefs
  -    #   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 library distribution versions
  -    v_zlib="1.2.3"
  -    v_bzip2="1.0.4"
  -    v_openssl="0.9.8e"
  -    v_expat="2.0.1"
  -    v_neon="0.27.0"
  -    v_beecrypt="4.1.2"
  -    v_db="4.6.19"
  -    v_sqlite="3.4.2"
  -    v_lua="5.1.2"
  -    v_file="4.21"
  -    v_popt="1.12"
  -    v_config="20070825"
  -
  -    #   third-party distribution files
  -    dist=""
  -    dist="${dist} m4-${v_m4}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/m4/"
  -    dist="${dist} autoconf-${v_autoconf}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/autoconf/"
  -    dist="${dist} automake-${v_automake}.tar.gz,http://rpm5.org/files/3rd/,ftp://sources.redhat.com/pub/automake/"
  -    dist="${dist} libtool-${v_libtool}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/libtool/"
  -    dist="${dist} gettext-${v_gettext}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/gettext/"
  -    dist="${dist} zlib-${v_zlib}.tar.gz,http://rpm5.org/files/3rd/,http://www.zlib.net/"
  -    dist="${dist} bzip2-${v_bzip2}.tar.gz,http://rpm5.org/files/3rd/,http://www.bzip.org/${v_bzip2}/"
  -    dist="${dist} openssl-${v_openssl}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.openssl.org/source/"
  -    dist="${dist} expat-${v_expat}.tar.gz,http://rpm5.org/files/3rd/,http://switch.dl.sourceforge.net/expat/"
  -    dist="${dist} neon-${v_neon}.tar.gz,http://rpm5.org/files/3rd/,http://www.webdav.org/neon/"
  -    dist="${dist} beecrypt-${v_beecrypt}.tar.gz,http://rpm5.org/files/3rd/,http://switch.dl.sourceforge.net/beecrypt/"
  -    dist="${dist} db-${v_db}.tar.gz,http://rpm5.org/files/3rd/,http://download-uk.oracle.com/berkeley-db/"
  -    dist="${dist} sqlite-${v_sqlite}.tar.gz,http://rpm5.org/files/3rd/,http://www.sqlite.org/"
  -    dist="${dist} lua-${v_lua}.tar.gz,http://rpm5.org/files/3rd/,http://www.lua.org/ftp/"
  -    dist="${dist} file-${v_file}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.astron.com/pub/file/"
  -    dist="${dist} popt-${v_popt}.tar.gz,http://rpm5.org/files/3rd/,http://rpm5.org/files/popt/"
  -
  -    #   third-party distribution patches (for portability and bugfix reasons only)
  -    dist="${dist} automake-${v_automake}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} gettext-${v_gettext}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} openssl-${v_openssl}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} beecrypt-${v_beecrypt}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} db-${v_db}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} sqlite-${v_sqlite}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} lua-${v_lua}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} file-${v_file}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} popt-${v_popt}.patch,http://rpm5.org/files/3rd/"
  -    dist="${dist} config.guess-${v_config},http://rpm5.org/files/3rd/"
  -    dist="${dist} config.sub-${v_config},http://rpm5.org/files/3rd/"
  -
   %standalone
       ##
       ##  USE THIS DEVELOPER PROCEDURE IF YOU WANT TO REALLY
  @@ -237,48 +183,121 @@
       ##  o 2007-07-25: ppc-aix5.3-gcc3.3.2
       ##
   
  -    @source %thirdpartydefs
  +    #   source reusable companion modules
  +    @source %standalone-modules
   
  -    #   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 | egrep '^/'`" != . ]; then
  -                eval "$tool=\"$tool\""
  +    #   execute implicit shared modules
  +    standalone_defines
  +    standalone_prerequisite
  +
  +    #   execute explicit requested module
  +    [ $# -eq 0 ] && set -- all
  +    cmd="standalone_$1"; shift
  +    ( eval $cmd ${1+"$@"} ) 2>&1
  +
  +%standalone-modules
  +    standalone_defines () {
  +        #   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 library distribution versions
  +        v_zlib="1.2.3"
  +        v_bzip2="1.0.4"
  +        v_openssl="0.9.8e"
  +        v_expat="2.0.1"
  +        v_neon="0.27.0"
  +        v_beecrypt="4.1.2"
  +        v_db="4.6.19"
  +        v_sqlite="3.4.2"
  +        v_lua="5.1.2"
  +        v_file="4.21"
  +        v_popt="1.12"
  +        v_config="20070825"
  +
  +        #   third-party distribution files
  +        dist=""
  +        dist="${dist} m4-${v_m4}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/m4/"
  +        dist="${dist} autoconf-${v_autoconf}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/autoconf/"
  +        dist="${dist} automake-${v_automake}.tar.gz,http://rpm5.org/files/3rd/,ftp://sources.redhat.com/pub/automake/"
  +        dist="${dist} libtool-${v_libtool}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/libtool/"
  +        dist="${dist} gettext-${v_gettext}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.gnu.org/gnu/gettext/"
  +        dist="${dist} zlib-${v_zlib}.tar.gz,http://rpm5.org/files/3rd/,http://www.zlib.net/"
  +        dist="${dist} bzip2-${v_bzip2}.tar.gz,http://rpm5.org/files/3rd/,http://www.bzip.org/${v_bzip2}/"
  +        dist="${dist} openssl-${v_openssl}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.openssl.org/source/"
  +        dist="${dist} expat-${v_expat}.tar.gz,http://rpm5.org/files/3rd/,http://switch.dl.sourceforge.net/expat/"
  +        dist="${dist} neon-${v_neon}.tar.gz,http://rpm5.org/files/3rd/,http://www.webdav.org/neon/"
  +        dist="${dist} beecrypt-${v_beecrypt}.tar.gz,http://rpm5.org/files/3rd/,http://switch.dl.sourceforge.net/beecrypt/"
  +        dist="${dist} db-${v_db}.tar.gz,http://rpm5.org/files/3rd/,http://download-uk.oracle.com/berkeley-db/"
  +        dist="${dist} sqlite-${v_sqlite}.tar.gz,http://rpm5.org/files/3rd/,http://www.sqlite.org/"
  +        dist="${dist} lua-${v_lua}.tar.gz,http://rpm5.org/files/3rd/,http://www.lua.org/ftp/"
  +        dist="${dist} file-${v_file}.tar.gz,http://rpm5.org/files/3rd/,ftp://ftp.astron.com/pub/file/"
  +        dist="${dist} popt-${v_popt}.tar.gz,http://rpm5.org/files/3rd/,http://rpm5.org/files/popt/"
  +
  +        #   third-party distribution patches (for portability and bugfix reasons only)
  +        dist="${dist} automake-${v_automake}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} gettext-${v_gettext}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} openssl-${v_openssl}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} beecrypt-${v_beecrypt}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} db-${v_db}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} sqlite-${v_sqlite}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} lua-${v_lua}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} file-${v_file}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} popt-${v_popt}.patch,http://rpm5.org/files/3rd/"
  +        dist="${dist} config.guess-${v_config},http://rpm5.org/files/3rd/"
  +        dist="${dist} config.sub-${v_config},http://rpm5.org/files/3rd/"
  +    }
  +
  +    standalone_prerequisite () {
  +        #   tool 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
  -                echo "devtool:ERROR: sorry, \"$tool\" required in \$PATH (or set \$$variable)" 1>&2
  -                exit 1
  +                if [ ".`(which $tool) 2>/dev/null | egrep '^/'`" != . ]; 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)
  +        if [ ".$CC" != . ]; then
  +            cc="$CC"
  +        elif [ ".`(which gcc) 2>/dev/null | egrep '^/'`" != . ]; then
  +            cc="gcc"
  +        elif [ ".`(which icc) 2>/dev/null | egrep '^/'`" != . ]; then
  +            cc="icc"
  +        elif [ ".`(which cc) 2>/dev/null | egrep '^/'`" != . ]; then
  +            cc="cc"
  +        else
  +            echo "devtool:ERROR: sorry, C compiler (\"cc\") required in \$PATH (or set \$CC)" 1>&2
  +            exit 1
  +        fi
  +        if [ ".`(which ccache) 2>/dev/null | egrep '^/'`" != . ]; then
  +            cc="ccache $cc"
           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)
  -    if [ ".$CC" != . ]; then
  -        cc="$CC"
  -    elif [ ".`(which gcc) 2>/dev/null | egrep '^/'`" != . ]; then
  -        cc="gcc"
  -    elif [ ".`(which icc) 2>/dev/null | egrep '^/'`" != . ]; then
  -        cc="icc"
  -    elif [ ".`(which cc) 2>/dev/null | egrep '^/'`" != . ]; then
  -        cc="cc"
  -    else
  -        echo "devtool:ERROR: sorry, C compiler (\"cc\") required in \$PATH (or set \$CC)" 1>&2
  -        exit 1
  -    fi
  -    if [ ".`(which ccache) 2>/dev/null | egrep '^/'`" != . ]; then
  -        cc="ccache $cc"
  -    fi
  +        #    determine some local tools
  +        SHTOOL="`cd ${DEVTOOL_SRCDIR} && pwd`/devtool.shtool"
   
  -    #    determine some local tools
  -    SHTOOL="`cd ${DEVTOOL_SRCDIR} && pwd`/devtool.shtool"
  +        #   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>'`
  +    }
   
  -    #   helper function for downloading a file from an URL
  -    download () {
  +    standalone_download () {
  +        #   helper function for downloading a file from an URL
           file="$1"
           name=`echo "$file" | sed -e 's;^.*/\([^/]*\)$;\1;'`
           for url in `echo "$2" | sed -e 's/,/ /g'`; do
  @@ -305,13 +324,8 @@
           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 () {
  +    standalone_prepare () {
           echo "++ establishing third-party area under ($base3rd)"
           for dir in "" src bin bin/$platform run run/$platform; do
               if [ ! -d "$base3rd/$dir" ]; then
  @@ -324,7 +338,7 @@
               file=`echo "$spec" | sed -e 's;,.*$;;'`
               urls=`echo "$spec" | sed -e 's;^[^,]*;;'`
               if [ ! -f "$base3rd/src/$file" ]; then
  -                download "$base3rd/src/$file" "$urls" || exit $?
  +                standalone_download "$base3rd/src/$file" "$urls" || exit $?
               fi
           done
   
  @@ -738,13 +752,13 @@
       }
   
       #   configure build environment
  -    autogen () {
  +    standalone_autogen () {
           echo "++ generating build environment"
           %autogen
       }
   
       #   configure build environment
  -    configure () {
  +    standalone_configure () {
           echo "++ cleaning up build environment"
           ( cd ${DEVTOOL_SRCDIR}; make distclean || true ) >/dev/null 2>&1
   
  @@ -806,18 +820,18 @@
       }
   
       #   build RPM
  -    build () {
  +    standalone_build () {
           make
       }
   
       #   install RPM
  -    install () {
  +    standalone_install () {
           rm -rf $prefix
           make install
       }
   
       #   test RPM (trivially only)
  -    testdrive () {
  +    standalone_testdrive () {
           $prefix/bin/rpm --initdb
           $prefix/bin/rpm --import ${DEVTOOL_SRCDIR}/pubkeys/JBJ-GPG-KEY
           $prefix/bin/rpm -qa
  @@ -825,21 +839,15 @@
       }
   
       #   do all at once
  -    all () {
  -        prepare
  -        autogen
  -        configure
  -        build
  -        install
  -        testdrive
  +    standalone_all () {
  +        standalone_prepare
  +        standalone_autogen
  +        standalone_configure
  +        standalone_build
  +        standalone_install
  +        standalone_testdrive
       }
   
  -    #   dispatch command
  -    if [ $# -eq 0 ]; then
  -        set -- all
  -    fi
  -    ( eval ${1+"$@"} ) 2>&1
  -
   %tarball
       %checkout
       %autogen
  @@ .
Received on Thu Aug 30 11:34:09 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.