Changeset 319 in MondoRescue for branches/2.06/tools/mkcommon


Ignore:
Timestamp:
Jan 14, 2006, 11:44:12 AM (15 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

File:
1 copied

Legend:

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