Changeset 319


Ignore:
Timestamp:
Jan 14, 2006, 11:44:12 AM (13 years ago)
Author:
bcornec
Message:
  • split build architecture to allow for multiple packages generation (rpms, debs, ebuild, ...)
  • only prepared for rpms and debs at the moment

Use tools/mkrpm to generate all the RPMs
Use tools/mkdeb (to be coded correctly) to generate all the debs

Location:
branches/2.06/tools
Files:
4 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/2.06/tools/common-env

    r318 r319  
    11#!/bin/bash
    22#
    3 # Creates RPMs environment from SVN repository
     3# Creates common environment from SVN repository
    44#
    55# $Id$
     
    88# Adapt to your needs
    99export BASE=${HOME}/mondo
    10 export SVNAUTH=bcornec@shell.berlios.de
    11 export DSTDIR=/home/groups/ftp/pub/mondorescue
    12 export FTPSERV="ftp.berlios.de"
    13 export FTPDIR="/incoming"
    1410
    1511# Should not be modified below
    1612dname=`dirname $0`
    1713export VER="branches/`cat $dname/../mondo/VERSION`"
    18 export pkg=""
    19 export opt=""
    20 export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    21 
    2214export TMP=${BASE}/tmp
    2315mkdir -p ${TMP}
    24 if [ -f ${HOME}/.rpmmacros ]; then
    25     export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
    26 else
    27     export TOPDIR=${BASE}/RPMS
    28 fi
    29 mkdir -p ${TOPDIR}
    30 cd ${TOPDIR}
    31 mkdir -p RPMS SRPMS SPECS SOURCES BUILD
    3216
    3317export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
    3418export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
    3519
    36 if [ -e /etc/mandriva-release ]; then
    37     export ddir="mandriva"
    38     export dver=`awk '{print $4}' /etc/mandriva-release`
    39     export suf=".`echo $dver | sed 's/\.//'`mdk"
    40 elif [ -e /etc/mandrake-release ]; then
    41     export ddir="mandrake"
    42     export dver=`awk '{print $3}' /etc/mandrake-release`
    43     export suf=".`echo $dver | sed 's/\.//'`mdk"
    44 elif [ -e /etc/redhat-release ]; then
    45     grep -q Enterprise /etc/redhat-release
    46     if [ $? -eq 0 ]; then
    47         export ddir="rhel"
    48         export dver=`awk '{print $7}' /etc/redhat-release`
    49     elif grep -q Fedora /etc/redhat-release ; then
    50         export ddir="fedora"
    51         export dver=`awk '{print $4}' /etc/redhat-release`
    52         export suf=".fc${dver}"
    53     else
    54         export ddir="redhat"
    55         export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
    56         export suf=".rh${dver}"
    57     fi
    58 elif [ -e /etc/SuSE-release ]; then
    59     grep -q Enterprise /etc/SuSE-release
    60     if [ $? -eq 0 ]; then
    61         export ddir="sles"
    62         export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
    63     else
    64         export ddir="suse"
    65         export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
    66     fi
    67 else
    68     export dver=""
    69     export ddir="generic"
    70 fi
    71 
    72 if [ _"$suf" = _"" ]; then
    73     export suf=".${ddir}${dver}"
    74 fi
     20# To be safe for SVN commands
     21cd $TOOLHOME/..
     22export REVISION=`$TOOLHOME/mksvnversion`
  • branches/2.06/tools/deb-env

    r318 r319  
    11#!/bin/bash
    22#
    3 # Creates RPMs environment from SVN repository
     3# Creates deb environment from SVN repository
    44#
    55# $Id$
    66#
    77
    8 # Adapt to your needs
    9 export BASE=${HOME}/mondo
    10 export SVNAUTH=bcornec@shell.berlios.de
    11 export DSTDIR=/home/groups/ftp/pub/mondorescue
    12 export FTPSERV="ftp.berlios.de"
    13 export FTPDIR="/incoming"
     8dname=`dirname $0`
     9prem=`echo $dname |cut -c1`
     10if [ ${prem} == "/" ]; then
     11        export TOOLHOME=$dname
     12else
     13    export TOOLHOME=${PWD}/$dname
     14fi
     15
     16. $TOOLHOME/common-env
    1417
    1518# Should not be modified below
    1619dname=`dirname $0`
    17 export VER="branches/`cat $dname/../mondo/VERSION`"
    18 export pkg=""
    19 export opt=""
    20 export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    2120
    22 export TMP=${BASE}/tmp
    23 mkdir -p ${TMP}
    24 if [ -f ${HOME}/.rpmmacros ]; then
    25     export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
    26 else
    27     export TOPDIR=${BASE}/RPMS
    28 fi
     21# TBD
     22export TOPDIR=${BASE}/debs
    2923mkdir -p ${TOPDIR}
    30 cd ${TOPDIR}
    31 mkdir -p RPMS SRPMS SPECS SOURCES BUILD
    3224
    33 export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
    34 export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
    35 
    36 if [ -e /etc/mandriva-release ]; then
    37     export ddir="mandriva"
    38     export dver=`awk '{print $4}' /etc/mandriva-release`
     25if [ -e /etc/debian-release ]; then
     26    export ddir="debian"
     27    export dver=`awk '{print $4}' /etc/debian-release`
    3928    export suf=".`echo $dver | sed 's/\.//'`mdk"
    40 elif [ -e /etc/mandrake-release ]; then
    41     export ddir="mandrake"
    42     export dver=`awk '{print $3}' /etc/mandrake-release`
    43     export suf=".`echo $dver | sed 's/\.//'`mdk"
    44 elif [ -e /etc/redhat-release ]; then
    45     grep -q Enterprise /etc/redhat-release
    46     if [ $? -eq 0 ]; then
    47         export ddir="rhel"
    48         export dver=`awk '{print $7}' /etc/redhat-release`
    49     elif grep -q Fedora /etc/redhat-release ; then
    50         export ddir="fedora"
    51         export dver=`awk '{print $4}' /etc/redhat-release`
    52         export suf=".fc${dver}"
    53     else
    54         export ddir="redhat"
    55         export dver=`awk '{print $5}' /etc/redhat-release | sed "s/\.//"`
    56         export suf=".rh${dver}"
    57     fi
    58 elif [ -e /etc/SuSE-release ]; then
    59     grep -q Enterprise /etc/SuSE-release
    60     if [ $? -eq 0 ]; then
    61         export ddir="sles"
    62         export dver=`head -1 /etc/SuSE-release | awk '{print $5}'`
    63     else
    64         export ddir="suse"
    65         export dver=`head -1 /etc/SuSE-release | awk '{print $3}'`
    66     fi
    67 else
    68     export dver=""
    69     export ddir="generic"
    7029fi
    7130
  • branches/2.06/tools/mkcommon

    r318 r319  
    11#!/bin/bash
    22#
    3 # Creates RPMs packages from SVN repository for local tests
     3# Prepare build env common for all packages build process from SVN repository
    44#
    55# $Id$
     
    77
    88umask 022
    9 dname=`dirname $0`
    10 prem=`echo $dname |cut -c1`
    11 if [ ${prem} == "/" ]; then
    12     export TOOLHOME=$dname
    13 else
    14     export TOOLHOME=${PWD}/$dname
    15 fi
    16 
    17 . $TOOLHOME/rpm-env
    18 
    19 # To be safe for SVN commands
    20 cd $TOOLHOME/..
    21 rev=`$TOOLHOME/mksvnversion`
    229
    2310echo "Generating SVN log file ..."
     11cd $TOOLHOME/..
    2412svn log -v > /tmp/mondorescue-svn.log
    2513
     
    3119if [ "`echo $c | grep mindi-kernel`" != "" ]; then
    3220    cd ${BASE}/svn
    33     echo "Management of mindi-kernel ${MINDI_VER}-$rev"
     21    echo "Management of mindi-kernel ${MINDI_VER}-$REVISION"
    3422    rm -fr mindi-kernel-${MINDI_VER}
    3523    cp -a ${VER}/mindi-kernel mindi-kernel-${MINDI_VER}
     
    4230    tar cvfhz ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tgz mindi-kernel-${MINDI_VER}
    4331    tar cvfhj ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tar.bz2 mindi-kernel-${MINDI_VER}
    44     sed "s/^%define mrel..*RRR/%define mrel ${rev}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
    45     rm -f ${TMP}/mindi-kernel*-root
    46     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
    4732fi
    4833if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
    4934    cd ${BASE}/svn
    50     echo "Management of mindi ${MINDI_VER}-$rev"
     35    echo "Management of mindi ${MINDI_VER}-$REVISION"
    5136    rm -fr mindi-${MINDI_VER}
    5237    cp -a ${VER}/mindi mindi-${MINDI_VER}
     
    5540    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    5641    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    57     if [ -f mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec ]; then
    58         specfile=mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec
    59     else
    60         specfile=mindi-${MINDI_VER}/distributions/common/mindi.spec
    61     fi
    62     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
    63     rm -rf mindi-${MINDI_VER}/distributions
    6442    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
    65     mkdir -p ${TOPDIR}/SOURCES
    6643
    6744    echo "Creating mindi tar files"
     
    6946    tar cfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
    7047    rm -f ${TMP}/mindi-*-root
    71     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
    72     # ATTENTION: This could be dangerous for your setup
    73     opt="rm -rf /usr/lib/mindi ;"
    7448fi
    7549if [ "`echo $c | grep  mondo`" != "" ]; then
    7650    cd ${BASE}/svn
    77     echo "Management of mondo ${MONDO_VER}-$rev"
     51    echo "Management of mondo ${MONDO_VER}-$REVISION"
    7852    rm -rf mondo-${MONDO_VER}
    7953    cp -a ${VER}/mondo mondo-${MONDO_VER}
     
    8660    find . -type f -name '*~' | xargs rm -rf
    8761    cd ..
    88     if [ -f mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec ]; then
    89         specfile=mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec
    90     else
    91         specfile=mondo-${MONDO_VER}/distributions/common/mondo.spec
    92     fi
    93     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
    94     rm -rf mondo-${MONDO_VER}/distributions
    9562
    9663    echo "Creating mondo tar files"
     
    9865    tar cfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
    9966    rm -f ${TMP}/mondo-*-root
    100     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
    10167fi
    102 cd ${TOPDIR}/SPECS
    103 status=0
    104 if [ "`echo $c | grep kernel`" != "" ]; then
    105     echo "Generating mindi-kernel RPMS"
    106     log=/tmp/mindi-kernel-rpm.log
    107     rpmbuild -ba mindi-kernel.spec 2> $log 1> $log
    108     if [ $? != 0 ]; then
    109         cat $log
    110         status=-1
    111     fi
    112 fi
    113 if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
    114     echo "Generating mindi RPMS"
    115     log=/tmp/mindi-rpm.log
    116     rpmbuild -ba mindi.spec 2> $log 1> $log
    117     if [ $? != 0 ]; then
    118         cat $log
    119         status=-1
    120     fi
    121 fi
    122 if [ "`echo $c | grep mondo`" != "" ]; then
    123     echo "Generating mondo RPMS"
    124     log=/tmp/mondo-rpm.log
    125     rpmbuild -ba mondo.spec 2> $log 1> $log
    126     if [ $? != 0 ]; then
    127         cat $log
    128         status=-1
    129     fi
    130 fi
    131 if [ $status = 0 ]; then
    132     echo "Installing RPMS as root ($pkg)"
    133     su - -c "$opt rpm -Uvh --force $pkg"
    134 fi
  • branches/2.06/tools/mkdeb

    r318 r319  
    11#!/bin/bash
    22#
    3 # Creates RPMs packages from SVN repository for local tests
     3# Creates debs packages from SVN repository for local tests
    44#
    55# $Id$
     
    1515fi
    1616
    17 . $TOOLHOME/rpm-env
    18 
    19 # To be safe for SVN commands
    20 cd $TOOLHOME/..
    21 rev=`$TOOLHOME/mksvnversion`
    22 
    23 echo "Generating SVN log file ..."
    24 svn log -v > /tmp/mondorescue-svn.log
     17. $TOOLHOME/deb-env
    2518
    2619if [ "$1" = "" ]; then
     
    2922    c=$1
    3023fi
     24
     25$TOOLHOME/mkcommon "$c"
     26
    3127if [ "`echo $c | grep mindi-kernel`" != "" ]; then
    3228    cd ${BASE}/svn
    33     echo "Management of mindi-kernel ${MINDI_VER}-$rev"
    34     rm -fr mindi-kernel-${MINDI_VER}
    35     cp -a ${VER}/mindi-kernel mindi-kernel-${MINDI_VER}
    36     find mindi-kernel-${MINDI_VER} -type d -name .svn | xargs rm -rf
    37     find mindi-kernel-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    38     find mindi-kernel-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    3929    mkdir -p ${TOPDIR}/SOURCES
    40 
    41     echo "Creating mindi-kernel tar files"
    42     tar cvfhz ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tgz mindi-kernel-${MINDI_VER}
    43     tar cvfhj ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tar.bz2 mindi-kernel-${MINDI_VER}
    44     sed "s/^%define mrel..*RRR/%define mrel ${rev}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
    45     rm -f ${TMP}/mindi-kernel*-root
    46     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
     30    sed "s/^%define mrel..*RRR/%define mrel ${REVISION}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
     31    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
    4732fi
    4833if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
    4934    cd ${BASE}/svn
    50     echo "Management of mindi ${MINDI_VER}-$rev"
    51     rm -fr mindi-${MINDI_VER}
    52     cp -a ${VER}/mindi mindi-${MINDI_VER}
    53     cp -a /tmp/mondorescue-svn.log mindi-${MINDI_VER}/svn.log
    54     find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
    55     find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    56     find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    5735    if [ -f mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec ]; then
    5836        specfile=mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec
     
    6038        specfile=mindi-${MINDI_VER}/distributions/common/mindi.spec
    6139    fi
    62     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
     40    sed -e "s/^%define mrel..*RRR/%define mrel  ${REVISION}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
    6341    rm -rf mindi-${MINDI_VER}/distributions
    64     rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
    6542    mkdir -p ${TOPDIR}/SOURCES
    6643
    67     echo "Creating mindi tar files"
    68     tar cfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
    69     tar cfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
    70     rm -f ${TMP}/mindi-*-root
    71     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
     44    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
    7245    # ATTENTION: This could be dangerous for your setup
    7346    opt="rm -rf /usr/lib/mindi ;"
     
    7548if [ "`echo $c | grep  mondo`" != "" ]; then
    7649    cd ${BASE}/svn
    77     echo "Management of mondo ${MONDO_VER}-$rev"
    78     rm -rf mondo-${MONDO_VER}
    79     cp -a ${VER}/mondo mondo-${MONDO_VER}
    80     cp -a /tmp/mondorescue-svn.log mondo-${MONDO_VER}/svn.log
    81     cd mondo-${MONDO_VER}
    82     echo "Bootstraping mondo ... "
    83     ./bootstrap
    84     find . -type d -name .svn | xargs rm -rf
    85     find . -type f -name '.*.swp' | xargs rm -rf
    86     find . -type f -name '*~' | xargs rm -rf
    87     cd ..
    8850    if [ -f mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec ]; then
    8951        specfile=mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec
     
    9153        specfile=mondo-${MONDO_VER}/distributions/common/mondo.spec
    9254    fi
    93     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
     55    sed -e "s/^%define mrel..*RRR/%define mrel  ${REVISION}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
    9456    rm -rf mondo-${MONDO_VER}/distributions
    9557
    96     echo "Creating mondo tar files"
    97     tar cfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
    98     tar cfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
    99     rm -f ${TMP}/mondo-*-root
    100     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
     58    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
    10159fi
     60
    10261cd ${TOPDIR}/SPECS
    10362status=0
  • branches/2.06/tools/mkdeliv

    r97 r319  
    55# $Id$
    66#
     7
     8# BerliOS FTP/SSH setup
     9BERLIOSAC=bcornec@shell.berlios.de
     10DSTDIR=/home/groups/ftp/pub/mondorescue
     11FTPSERV="ftp.berlios.de"
     12FTPDIR="/incoming"
    713
    814dname=`dirname $0`
     
    4046    srpms="$srpms ${TOPDIR}/SRPMS/mondo-${MONDO_VER}-${rev}.${suf}.src.rpm"
    4147fi
    42 echo "Sources delivery to ${SVNAUTH}:${DSTDIR}/src"
    43 scp ${tgz} ${SVNAUTH}:${DSTDIR}/src
    44 ssh ${SVNAUTH} "mkdir -p ${DSTDIR}/${ddir}/${dver}"
    45 echo "Packages delivery to ${SVNAUTH}:${DSTDIR}/${ddir}/${dver}"
    46 scp ${rpms} ${SVNAUTH}:${DSTDIR}/${ddir}/${dver}
    47 scp ${srpms} ${SVNAUTH}:${DSTDIR}/${ddir}/${dver}
     48echo "Sources delivery to ${BERLIOSAC}:${DSTDIR}/src"
     49scp ${tgz} ${BERLIOSAC}:${DSTDIR}/src
     50ssh ${BERLIOSAC} "mkdir -p ${DSTDIR}/${ddir}/${dver}"
     51echo "Packages delivery to ${BERLIOSAC}:${DSTDIR}/${ddir}/${dver}"
     52scp ${rpms} ${BERLIOSAC}:${DSTDIR}/${ddir}/${dver}
     53scp ${srpms} ${BERLIOSAC}:${DSTDIR}/${ddir}/${dver}
    4854echo "Sources delivery to ${FTPSERV} ${FTPDIR}"
    4955if [ "`which ncftpput`" != "" ]; then
  • branches/2.06/tools/mkrpm

    r318 r319  
    1717. $TOOLHOME/rpm-env
    1818
    19 # To be safe for SVN commands
    20 cd $TOOLHOME/..
    21 rev=`$TOOLHOME/mksvnversion`
    22 
    23 echo "Generating SVN log file ..."
    24 svn log -v > /tmp/mondorescue-svn.log
    25 
    2619if [ "$1" = "" ]; then
    2720    c="mindi mondo"
     
    2922    c=$1
    3023fi
     24
     25$TOOLHOME/mkcommon "$c"
     26
    3127if [ "`echo $c | grep mindi-kernel`" != "" ]; then
    3228    cd ${BASE}/svn
    33     echo "Management of mindi-kernel ${MINDI_VER}-$rev"
    34     rm -fr mindi-kernel-${MINDI_VER}
    35     cp -a ${VER}/mindi-kernel mindi-kernel-${MINDI_VER}
    36     find mindi-kernel-${MINDI_VER} -type d -name .svn | xargs rm -rf
    37     find mindi-kernel-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    38     find mindi-kernel-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    3929    mkdir -p ${TOPDIR}/SOURCES
    40 
    41     echo "Creating mindi-kernel tar files"
    42     tar cvfhz ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tgz mindi-kernel-${MINDI_VER}
    43     tar cvfhj ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tar.bz2 mindi-kernel-${MINDI_VER}
    44     sed "s/^%define mrel..*RRR/%define mrel ${rev}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
    45     rm -f ${TMP}/mindi-kernel*-root
    46     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
     30    sed "s/^%define mrel..*RRR/%define mrel ${REVISION}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
     31    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
    4732fi
    4833if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
    4934    cd ${BASE}/svn
    50     echo "Management of mindi ${MINDI_VER}-$rev"
    51     rm -fr mindi-${MINDI_VER}
    52     cp -a ${VER}/mindi mindi-${MINDI_VER}
    53     cp -a /tmp/mondorescue-svn.log mindi-${MINDI_VER}/svn.log
    54     find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
    55     find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    56     find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    5735    if [ -f mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec ]; then
    5836        specfile=mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec
     
    6038        specfile=mindi-${MINDI_VER}/distributions/common/mindi.spec
    6139    fi
    62     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
     40    sed -e "s/^%define mrel..*RRR/%define mrel  ${REVISION}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
    6341    rm -rf mindi-${MINDI_VER}/distributions
    64     rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
    6542    mkdir -p ${TOPDIR}/SOURCES
    6643
    67     echo "Creating mindi tar files"
    68     tar cfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
    69     tar cfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
    70     rm -f ${TMP}/mindi-*-root
    71     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
     44    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
    7245    # ATTENTION: This could be dangerous for your setup
    7346    opt="rm -rf /usr/lib/mindi ;"
     
    7548if [ "`echo $c | grep  mondo`" != "" ]; then
    7649    cd ${BASE}/svn
    77     echo "Management of mondo ${MONDO_VER}-$rev"
    78     rm -rf mondo-${MONDO_VER}
    79     cp -a ${VER}/mondo mondo-${MONDO_VER}
    80     cp -a /tmp/mondorescue-svn.log mondo-${MONDO_VER}/svn.log
    81     cd mondo-${MONDO_VER}
    82     echo "Bootstraping mondo ... "
    83     ./bootstrap
    84     find . -type d -name .svn | xargs rm -rf
    85     find . -type f -name '.*.swp' | xargs rm -rf
    86     find . -type f -name '*~' | xargs rm -rf
    87     cd ..
    8850    if [ -f mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec ]; then
    8951        specfile=mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec
     
    9153        specfile=mondo-${MONDO_VER}/distributions/common/mondo.spec
    9254    fi
    93     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
     55    sed -e "s/^%define mrel..*RRR/%define mrel  ${REVISION}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
    9456    rm -rf mondo-${MONDO_VER}/distributions
    9557
    96     echo "Creating mondo tar files"
    97     tar cfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
    98     tar cfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
    99     rm -f ${TMP}/mondo-*-root
    100     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
     58    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
    10159fi
     60
    10261cd ${TOPDIR}/SPECS
    10362status=0
  • branches/2.06/tools/mksvnversion

    r237 r319  
    11#!/bin/bash
    2 ########################################################
    3 # $Id$
    4 ########################################################
    52#
    63# on every build, record the working copy revision string
    74#
    8 dname=`dirname $0`
    9 prem=`echo $dname |cut -c1`
    10 if [ ${prem} == "/" ]; then
    11     export TOOLHOME=$dname
    12 else
    13     export TOOLHOME=${PWD}/$dname
     5# $Id$
     6#
     7
     8# TOOLHOME should be provided by callers
     9if [ _"$TOOLHOME" = _"" ]; then
     10    # It's not the case so compute it
     11    dname=`dirname $0`
     12    prem=`echo $dname |cut -c1`
     13    if [ ${prem} == "/" ]; then
     14        export TOOLHOME=$dname
     15    else
     16        export TOOLHOME=${PWD}/$dname
     17    fi
    1418fi
    15 . $TOOLHOME/rpm-env
    1619
    17 #
    18 # Create a .c file for mondo to link with and get
    19 # the right build version from SVN
    20 #
    2120rel=`svnversion $TOOLHOME/..`
    22 cat > $TOOLHOME/../mondo/revision.h << EOF
    23 #define REVISION "${rel}"
    24 EOF
     21
    2522cat > $TOOLHOME/../mondo/REVISION << EOF
    2623${rel}
  • branches/2.06/tools/rpm-env

    r318 r319  
    66#
    77
    8 # Adapt to your needs
    9 export BASE=${HOME}/mondo
    10 export SVNAUTH=bcornec@shell.berlios.de
    11 export DSTDIR=/home/groups/ftp/pub/mondorescue
    12 export FTPSERV="ftp.berlios.de"
    13 export FTPDIR="/incoming"
     8dname=`dirname $0`
     9prem=`echo $dname |cut -c1`
     10if [ ${prem} == "/" ]; then
     11        export TOOLHOME=$dname
     12else
     13    export TOOLHOME=${PWD}/$dname
     14fi
     15
     16. $TOOLHOME/common-env
     17
     18export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    1419
    1520# Should not be modified below
    16 dname=`dirname $0`
    17 export VER="branches/`cat $dname/../mondo/VERSION`"
    1821export pkg=""
    1922export opt=""
    20 export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    2123
    22 export TMP=${BASE}/tmp
    23 mkdir -p ${TMP}
    2424if [ -f ${HOME}/.rpmmacros ]; then
    2525    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
     
    3030cd ${TOPDIR}
    3131mkdir -p RPMS SRPMS SPECS SOURCES BUILD
    32 
    33 export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
    34 export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
    3532
    3633if [ -e /etc/mandriva-release ]; then
Note: See TracChangeset for help on using the changeset viewer.