Changeset 320 in MondoRescue for trunk/tools/mkrpm


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

merge -r316:319 $SVN_M/branches/2.06

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.