Changeset 553 in MondoRescue for branches/stable/tools/svn2build


Ignore:
Timestamp:
May 18, 2006, 12:40:32 AM (18 years ago)
Author:
bcornec
Message:

Build process in 3 steps:

svn2build creates tar files from SVN (works mostly)
build2pkg creates packages from tar files (works mostly)
build2qemu (has to be created from mkqemu) will create packages for all supported virtuel machines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/tools/svn2build

    r551 r553  
    1919. ./svn-env
    2020
    21 mkdir -p ${TOPDIR}/SOURCES
     21DEST=${TOPDIR}/${VER}-$TAG
     22mkdir -p $DEST
    2223
    2324if [ "$1" = "" ]; then
     
    3132fi
    3233
    33 
     34# Make it safe for SVN commands
    3435cd ${BASE}/svn
    3536
     
    3738    v=`cat ${SVNBRANCH}/$p/VERSION`
    3839    echo "Management of $p $v-$REVISION"
    39     rm -fr $p-$v
    40     svn export ${SVNBRANCH}/$p $p-$v
    41     echo "$REVISION" > $p-$v/REVISION
     40    dest="$p-$v-$TAG"
     41    rm -fr $dest
     42    svn export ${SVNBRANCH}/$p $dest
     43    echo "$REVISION" > $dest/REVISION
    4244    echo "Generating SVN log file ..."
    43     svn log -v ${SVNBRANCH}/$p > $p-$v/svn.log
     45    svn log -v ${SVNBRANCH}/$p > $dest/svn.log
    4446
    4547    for d in `cat ${TOOLHOME}/DISTROS`; do
    46         ddir=`echo $d | cut -d_ -f1`
    47         dver=`echo $d | cut -d_ -f2`
     48        export ddir=`echo $d | cut -d_ -f1`
     49        export dver=`echo $d | cut -d_ -f2`
    4850        echo "Generating build files for $ddir ($dver)"
    49         if [ $ddir = "debian" ]; then
    50             dfam="debian"
    51             dtype="deb"
    52             suf=".${dfam}${dver}"
    53             BUILDDIR=${TOPDIR}/debian
    54         elif [ $ddir = "gentoo" ]; then
    55             dfam="gentoo"
    56             dtype="ebuild"
    57             suf=".${ddir}${dver}"
    58             BUILDDIR=${TOPDIR}/ebuild
    59         elif [ $ddir = "slackware" ]; then
    60             dfam="slack"
    61             dtype="tgz"
    62             suf=".${dfam}${dver}"
    63             BUILDDIR=${TOPDIR}/slack
    64         elif [ $ddir = "sles" -o $ddir = "suse" ]; then
    65             dfam="suse"
    66             dtype="rpm"
    67             suf=".${ddir}${dver}"
    68             BUILDDIR=${TOPDIR}/SPECS
    69         elif [ $ddir = "fedora" -o $ddir = "redhat" -o $ddir = "rhel" ]; then
    70             dfam="redhat"
    71             dtype="rpm"
    72             dver=`echo ${dver} | sed "s/\.//"`
    73             if [ $ddir = "fedora" ]; then
    74                 suf=".fc${dver}"
    75             elif [ $ddir = "redhat" ]; then
    76                 suf=".rh${dver}"
    77             else
    78                 suf=".rhel${dver}"
    79             fi
    80             BUILDDIR=${TOPDIR}/SPECS
    81         elif [ $ddir = "mandrake" -o $ddir = "mandriva" ]; then
    82             dfam="mandriva"
    83             dtype="rpm"
    84             suf=".`echo $dver | sed 's/\.//'`mdk"
    85             BUILDDIR=${TOPDIR}/SPECS
    86         else
    87             dfam="unknown"
    88             dtype="unknown"
    89             BUILDDIR=${TOPDIR}/SPECS
    90             suf="unknown"
    91         fi
     51        . $TOOLHOME/distro-env
    9252
    9353        # Create conf file dir
     
    10161EOF
    10262
    103         mkdir -p $p-$v/distributions/$ddir
    104         if [ $dtype = "rpm" ]; then
    105             if [ -f $p-$v/distributions/$ddir/spec.m4 ]; then
    106                 inc=$p-$v/distributions/$ddir/spec.m4
    107             elif [ -f $p-$v/distributions/$dfam/spec.m4 ]; then
    108                 inc=$p-$v/distributions/$dfam/spec.m4
     63        mkdir -p $dest/distributions/$ddir
     64        if [ "$dtype" = "rpm" ]; then
     65            if [ -f $dest/distributions/$ddir/spec.m4 ]; then
     66                inc=$dest/distributions/$ddir/spec.m4
     67            elif [ -f $dest/distributions/$dfam/spec.m4 ]; then
     68                inc=$dest/distributions/$dfam/spec.m4
    10969            else
    11070                echo "Unable to build the RPM specfile for this distro. Please report to authors"
     
    11272            fi
    11373            echo "Using $inc customization to build SPEC file"
    114             m4 /tmp/mondorescue.mc $inc $p-$v/distributions/rpm/$p.spec > $p-$v/distributions/$ddir/$p.spec
     74            m4 /tmp/mondorescue.mc $inc $dest/distributions/rpm/$p.spec > $dest/distributions/$ddir/$p.spec
    11575
    116             if [ -f $p-$v/distributions/$ddir/changelog ]; then
    117                 log=$p-$v/distributions/$ddir/changelog
    118             elif [ -f $p-$v/distributions/$dfam/changelog ]; then
    119                 log=$p-$v/distributions/$dfam/changelog
     76            if [ -f $dest/distributions/$ddir/changelog ]; then
     77                log=$dest/distributions/$ddir/changelog
     78            elif [ -f $dest/distributions/$dfam/changelog ]; then
     79                log=$dest/distributions/$dfam/changelog
    12080            else
    12181                echo "Unable to build RPM changelog for this distro. Please report to authors"
     
    12585            echo "Using $log customization to build changelog file"
    12686            ddate=`LANG=C ; date "+%a %b %d %Y"`
    127             cat > $p-$v/distributions/$ddir/$p.changelog.new << EOF
     87            cat > $dest/distributions/$ddir/$p.changelog.new << EOF
    12888* $ddate Bruno Cornec <bruno@mondorescue.org> VVV-RRR
    12989- Updated to VVV-r${REVISION}
    13090
    13191EOF
    132             cat $log >> $p-$v/distributions/$ddir/$p.changelog.new
    133             m4 /tmp/mondorescue.mc $p-$v/distributions/$ddir/$p.changelog.new > $p-$v/distributions/$ddir/$p.changelog
    134             rm -f $p-$v/distributions/$ddir/$p.changelog.new
     92            cat $log >> $dest/distributions/$ddir/$p.changelog.new
     93            m4 /tmp/mondorescue.mc $dest/distributions/$ddir/$p.changelog.new > $dest/distributions/$ddir/$p.changelog
     94            rm -f $dest/distributions/$ddir/$p.changelog.new
    13595
    136         elif [ $dtype = "ebuild" ]; then
     96        elif [ "$dtype" = "ebuild" ]; then
    13797            echo "Gentoo Build"
    13898        else
     
    142102
    143103    if [ _"`echo $p | grep mondo-doc`" != _"" ]; then
    144         cd ${p}-${v}
     104        cd $dest
    145105        for f in mondorescue-howto.sgml *8; do
    146106            m4 /tmp/mondorescue.mc $f > ${f}.new
     
    164124            exit -1
    165125        fi
    166         (cd mondo-doc-$v1 ; make -f Makefile.man install-$p INSTALLDIR=../$p-$v)
    167         rm -f $p-$v/rootfs/sbin/parted2fdisk-ia64
     126        (cd mondo-doc-$v1 ; make -f Makefile.man install-$p INSTALLDIR=../$dest)
     127        rm -f $dest/rootfs/sbin/parted2fdisk-ia64
    168128    fi
    169129    if [ "`echo $p | grep -v doc | grep  mondo`" != "" ]; then
     
    173133            exit -1
    174134        fi
    175         (cd mondo-doc-$v1 ; make -f Makefile.howto install INSTALLDIR=../$p-$v/docs/en ; make -f Makefile.man install-$p INSTALLDIR=../$p-$v/docs/man)
    176         (cd $p-$v ; echo "Bootstraping mondo ... " ; ./bootstrap)
     135        (cd mondo-doc-$v1 ; make -f Makefile.howto install INSTALLDIR=../$dest/docs/en ; make -f Makefile.man install-$p INSTALLDIR=../$dest/docs/man)
     136        (cd $dest ; echo "Bootstraping mondo ... " ; ./bootstrap)
    177137    fi
    178138
    179139    # Finally creates the tar files
    180140    echo "Creating $p tar files"
    181     tar cfhz ${TOPDIR}/SOURCES/$p-$v-$TAG.tar.gz $p-$v
    182     gzip -cd ${TOPDIR}/SOURCES/$p-$v-$TAG.tar.gz | bzip2 -c3 > ${TOPDIR}/SOURCES/$p-$v-$TAG.tar.bz2
    183     #tar cfhj ${TOPDIR}/SOURCES/$p-$v-$TAG.tar.bz2 $p-$v
     141    tar cfhz ${DEST}/$p-$v-$TAG.tar.gz $dest
     142    #gzip -cd ${DEST}/$p-$v-$TAG.tar.gz | bzip2 -c3 > ${DEST}/$p-$v-$TAG.tar.bz2
     143    #tar cfhj ${DEST}/$p-$v-$TAG.tar.bz2 $dest
    184144done
    185145
    186146rm -f /tmp/mondorescue.mc
     147
     148echo "Version delivered :"
     149echo "-------------------"
     150echo "${VER}-$TAG"
     151echo "-------------------"
     152echo "${VER}-$TAG" > ${TOPDIR}/LAST
     153exit 0
Note: See TracChangeset for help on using the changeset viewer.