Changeset 320 for trunk/tools


Ignore:
Timestamp:
Jan 15, 2006, 12:29:12 AM (14 years ago)
Author:
bcornec
Message:

merge -r316:319 $SVN_M/branches/2.06

Location:
trunk/tools
Files:
4 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/tools/mkdeliv

    r98 r320  
    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
  • trunk/tools/mkrpm

    r317 r320  
    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}"
    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     tar cvfhz ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tgz mindi-kernel-${MINDI_VER}
    41     tar cvfhj ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tar.bz2 mindi-kernel-${MINDI_VER}
    42     sed "s/^%define mrel..*RRR/%define mrel ${rev}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
    43     rm -f ${TMP}/mindi-kernel*-root
    44     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"
    4532fi
    4633if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
    4734    cd ${BASE}/svn
    48     echo "Management of mindi ${MINDI_VER}"
    49     rm -fr mindi-${MINDI_VER}
    50     cp -a ${VER}/mindi mindi-${MINDI_VER}
    51     cp -a /tmp/mondorescue-svn.log mindi-${MINDI_VER}/svn.log
    52     find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
    53     find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    54     find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    55     rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
     35    if [ -f mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec ]; then
     36        specfile=mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec
     37    else
     38        specfile=mindi-${MINDI_VER}/distributions/common/mindi.spec
     39    fi
     40    sed -e "s/^%define mrel..*RRR/%define mrel  ${REVISION}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
     41    rm -rf mindi-${MINDI_VER}/distributions
    5642    mkdir -p ${TOPDIR}/SOURCES
    57     tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
    58     tar cvfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
    59     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MINDI_VER}/" mindi-${MINDI_VER}/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
    60     rm -f ${TMP}/mindi-*-root
    61     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
     43
     44    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
    6245    # ATTENTION: This could be dangerous for your setup
    6346    opt="rm -rf /usr/lib/mindi ;"
     
    6548if [ "`echo $c | grep  mondo`" != "" ]; then
    6649    cd ${BASE}/svn
    67     echo "Management of mondo ${MONDO_VER}"
    68     rm -rf mondo-${MONDO_VER}
    69     cp -a ${VER}/mondo mondo-${MONDO_VER}
    70     cp -a /tmp/mondorescue-svn.log mondo-${MONDO_VER}/svn.log
    71     cd mondo-${MONDO_VER}
    72     echo "Bootstraping mondo ... "
    73     ./bootstrap
    74     find . -type d -name .svn | xargs rm -rf
    75     find . -type f -name '.*.swp' | xargs rm -rf
    76     find . -type f -name '*~' | xargs rm -rf
    77     cd ..
    78     tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
    79     tar cvfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
    80     sed -e "s/^%define mrel..*RRR/%define mrel  ${rev}${suf}/" -e "s/VVV/${MONDO_VER}/" mondo-${MONDO_VER}/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
    81     rm -f ${TMP}/mondo-*-root
    82     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
     50    if [ -f mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec ]; then
     51        specfile=mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec
     52    else
     53        specfile=mondo-${MONDO_VER}/distributions/common/mondo.spec
     54    fi
     55    sed -e "s/^%define mrel..*RRR/%define mrel  ${REVISION}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
     56    rm -rf mondo-${MONDO_VER}/distributions
     57
     58    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
    8359fi
     60
    8461cd ${TOPDIR}/SPECS
     62status=0
    8563if [ "`echo $c | grep kernel`" != "" ]; then
    86     rpmbuild -ba mindi-kernel.spec
     64    echo "Generating mindi-kernel RPMS"
     65    log=/tmp/mindi-kernel-rpm.log
     66    rpmbuild -ba mindi-kernel.spec 2> $log 1> $log
     67    if [ $? != 0 ]; then
     68        cat $log
     69        status=-1
     70    fi
    8771fi
    8872if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
    89     rpmbuild -ba mindi.spec
     73    echo "Generating mindi RPMS"
     74    log=/tmp/mindi-rpm.log
     75    rpmbuild -ba mindi.spec 2> $log 1> $log
     76    if [ $? != 0 ]; then
     77        cat $log
     78        status=-1
     79    fi
    9080fi
    9181if [ "`echo $c | grep mondo`" != "" ]; then
    92     rpmbuild -ba mondo.spec
     82    echo "Generating mondo RPMS"
     83    log=/tmp/mondo-rpm.log
     84    rpmbuild -ba mondo.spec 2> $log 1> $log
     85    if [ $? != 0 ]; then
     86        cat $log
     87        status=-1
     88    fi
    9389fi
    94 su - -c "$opt rpm -Uvh --force $pkg"
     90if [ $status = 0 ]; then
     91    echo "Installing RPMS as root ($pkg)"
     92    su - -c "$opt rpm -Uvh --force $pkg"
     93fi
  • trunk/tools/mksvnversion

    r238 r320  
    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}
  • trunk/tools/rpm-env

    r317 r320  
    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
     
    1722export pkg=""
    1823export opt=""
    19 export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    2024
    21 mkdir -p ${BASE}/RPMS
    22 export TMP=${BASE}/tmp
    23 mkdir -p ${TMP}
    2425if [ -f ${HOME}/.rpmmacros ]; then
    2526    export TOPDIR=`egrep '^%_topdir' ${HOME}/.rpmmacros | awk '{print $2}'`
     
    2728    export TOPDIR=${BASE}/RPMS
    2829fi
     30mkdir -p ${TOPDIR}
    2931cd ${TOPDIR}
    3032mkdir -p RPMS SRPMS SPECS SOURCES BUILD
    31 
    32 export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
    33 export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
    3433
    3534if [ -e /etc/mandriva-release ]; then
Note: See TracChangeset for help on using the changeset viewer.