Changeset 19


Ignore:
Timestamp:
Sep 7, 2005, 7:35:26 PM (14 years ago)
Author:
bcornec
Message:

Improve delivery script to BerliOS

Location:
trunk
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/mkdeliv

    r18 r19  
    11#!/bin/bash
    22#
    3 # Creates RPMs packages from SVN repository for local tests
     3# Deliver RPMs packages and tgz files to BerliOS
    44
    5 # Adapt to your needs
    6 BASE=/bruno/mondo
    7 # Look at opt below if this is dangerous for you or not.
     5. ./rpm-env
    86
    9 # Should not be modified below
    10 VER=trunk
    11 pkg=""
    12 opt=""
    13 ARCH=`/bin/arch`
    14 
    15 mkdir -p ${BASE}/RPMS
    16 TMP=${BASE}/tmp
    17 mkdir -p ${TMP}
    18 if [ -f ${HOME}/.rpmmacros ]; then
    19     TOPDIR=`grep _topdir ${HOME}/.rpmmacros | awk '{print $2}'`
    20 else
    21     TOPDIR=${BASE}/RPMS
    22 fi
    23 cd ${TOPDIR}
    24 mkdir -p RPMS SRPMS SPECS SOURCES BUILD
     7tgz=""
     8srpms=""
     9rpms=""
    2510
    2611if [ "$1" = "" ]; then
     
    3015fi
    3116if [ "`echo $c | grep mindi`" != "" ]; then
    32     cd ${BASE}/svn
    33     MINDI_VER=`cat ${VER}/mindi/mindi.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[     ]*//"`
    34     echo "Management of mindi ${MINDI_VER}"
    35     rm -fr mindi-${MINDI_VER}
    36     cp -a ${VER}/mindi mindi-${MINDI_VER}
    37     find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
    38     find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    39     rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
    40     mkdir -p ${TOPDIR}/SOURCES
    41     tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
    42     cp mindi-${MINDI_VER}/mindi.spec ${TOPDIR}/SPECS/mindi.spec
    43     rm -f ${TMP}/mindi-*-root
    44     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-1.${ARCH}.rpm"
    45     # ATTENTION: This could be dangerous for your setup
    46     opt="rm -rf /usr/share/mindi ;"
     17    tgz="$tgz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz"
     18    rpms="$rpms ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-1.${ARCH}.rpm"
     19    srpms="$srpms ${TOPDIR}/SRPMS/mindi-${MINDI_VER}-1.src.rpm"
    4720fi
    4821if [ "`echo $c | grep  mondo`" != "" ]; then
    49     cd ${BASE}/svn
    50     MONDO_VER=`cat ${VER}/mondo/mondo.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[     ]*//"`
    51     rm -rf mondo-${MONDO_VER}
    52     cp -a ${VER}/mondo mondo-${MONDO_VER}
    53     cd mondo-${MONDO_VER}
    54     echo "Bootstraping mondo ... "
    55     ./bootstrap
    56     find . -type d -name .svn | xargs rm -rf
    57     find . -type f -name '.*.swp' | xargs rm -rf
    58     cd ..
    59     tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
    60     cp mondo-${MONDO_VER}/mondo.spec ${TOPDIR}/SPECS/mondo.spec
    61     rm -f ${TMP}/mondo-*-root
    62     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-1.${ARCH}.rpm"
     22    tgz="$tgz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz"
     23    rpms="$rpms ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-1.${ARCH}.rpm"
     24    srpms="$srpms ${TOPDIR}/SRPMS/mondo-${MONDO_VER}-1.src.rpm"
    6325fi
    64 cd ${TOPDIR}/SPECS
    65 if [ "`echo $c | grep mindi`" != "" ]; then
    66     rpmbuild -ba mindi.spec
    67 fi
    68 if [ "`echo $c | grep mondo`" != "" ]; then
    69     rpmbuild -ba --without xmondo mondo.spec
    70 fi
    71 su - -c "$opt rpm -Uvh --force $pkg"
     26scp -p ${tgz} ${SVNAUTH}:${DSTDIR}/TGZ
     27scp -p ${rpms} ${SVNAUTH}:${DSTDIR}/RPMS
     28scp -p ${srpms} ${SVNAUTH}:${DSTDIR}/SRPMS
  • trunk/mkrpm

    r18 r19  
    33# Creates RPMs packages from SVN repository for local tests
    44
    5 # Adapt to your needs
    6 BASE=/bruno/mondo
    7 # Look at opt below if this is dangerous for you or not.
    8 
    9 # Should not be modified below
    10 VER=trunk
    11 pkg=""
    12 opt=""
    13 ARCH=`/bin/arch`
    14 
    15 mkdir -p ${BASE}/RPMS
    16 TMP=${BASE}/tmp
    17 mkdir -p ${TMP}
    18 if [ -f ${HOME}/.rpmmacros ]; then
    19     TOPDIR=`grep _topdir ${HOME}/.rpmmacros | awk '{print $2}'`
    20 else
    21     TOPDIR=${BASE}/RPMS
    22 fi
    23 cd ${TOPDIR}
    24 mkdir -p RPMS SRPMS SPECS SOURCES BUILD
     5. ./rpm-env
    256
    267if [ "$1" = "" ]; then
     
    3112if [ "`echo $c | grep mindi`" != "" ]; then
    3213    cd ${BASE}/svn
    33     MINDI_VER=`cat ${VER}/mindi/mindi.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[     ]*//"`
    3414    echo "Management of mindi ${MINDI_VER}"
    3515    rm -fr mindi-${MINDI_VER}
     
    3717    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
    3818    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
     19    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
    3920    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
    4021    mkdir -p ${TOPDIR}/SOURCES
     
    4829if [ "`echo $c | grep  mondo`" != "" ]; then
    4930    cd ${BASE}/svn
    50     MONDO_VER=`cat ${VER}/mondo/mondo.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[     ]*//"`
     31    echo "Management of mondo ${MONDO_VER}"
    5132    rm -rf mondo-${MONDO_VER}
    5233    cp -a ${VER}/mondo mondo-${MONDO_VER}
     
    5637    find . -type d -name .svn | xargs rm -rf
    5738    find . -type f -name '.*.swp' | xargs rm -rf
     39    find . -type f -name '*~' | xargs rm -rf
    5840    cd ..
    5941    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
  • trunk/rpm-env

    r18 r19  
    11#!/bin/bash
    22#
    3 # Creates RPMs packages from SVN repository for local tests
     3# Creates RPMs environment from SVN repository
    44
    55# Adapt to your needs
    6 BASE=/bruno/mondo
    7 # Look at opt below if this is dangerous for you or not.
     6export BASE=/bruno/mondo
     7export SVNAUTH=bcornec@shell.berlios.de
     8export DSTDIR=/home/groups/mondorescue/htdocs
    89
    910# Should not be modified below
    10 VER=trunk
    11 pkg=""
    12 opt=""
    13 ARCH=`/bin/arch`
     11export VER=trunk
     12export pkg=""
     13export opt=""
     14export ARCH=`rpm --showrc | egrep "^build arch" | awk '{print $4}'`
    1415
    1516mkdir -p ${BASE}/RPMS
    16 TMP=${BASE}/tmp
     17export TMP=${BASE}/tmp
    1718mkdir -p ${TMP}
    1819if [ -f ${HOME}/.rpmmacros ]; then
    19     TOPDIR=`grep _topdir ${HOME}/.rpmmacros | awk '{print $2}'`
     20    export TOPDIR=`grep _topdir ${HOME}/.rpmmacros | awk '{print $2}'`
    2021else
    21     TOPDIR=${BASE}/RPMS
     22    export TOPDIR=${BASE}/RPMS
    2223fi
    2324cd ${TOPDIR}
    2425mkdir -p RPMS SRPMS SPECS SOURCES BUILD
    2526
    26 if [ "$1" = "" ]; then
    27     c="mindi mondo"
    28 else
    29     c=$1
    30 fi
    31 if [ "`echo $c | grep mindi`" != "" ]; then
    32     cd ${BASE}/svn
    33     MINDI_VER=`cat ${VER}/mindi/mindi.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[     ]*//"`
    34     echo "Management of mindi ${MINDI_VER}"
    35     rm -fr mindi-${MINDI_VER}
    36     cp -a ${VER}/mindi mindi-${MINDI_VER}
    37     find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
    38     find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
    39     rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
    40     mkdir -p ${TOPDIR}/SOURCES
    41     tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
    42     cp mindi-${MINDI_VER}/mindi.spec ${TOPDIR}/SPECS/mindi.spec
    43     rm -f ${TMP}/mindi-*-root
    44     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-1.${ARCH}.rpm"
    45     # ATTENTION: This could be dangerous for your setup
    46     opt="rm -rf /usr/share/mindi ;"
    47 fi
    48 if [ "`echo $c | grep  mondo`" != "" ]; then
    49     cd ${BASE}/svn
    50     MONDO_VER=`cat ${VER}/mondo/mondo.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[     ]*//"`
    51     rm -rf mondo-${MONDO_VER}
    52     cp -a ${VER}/mondo mondo-${MONDO_VER}
    53     cd mondo-${MONDO_VER}
    54     echo "Bootstraping mondo ... "
    55     ./bootstrap
    56     find . -type d -name .svn | xargs rm -rf
    57     find . -type f -name '.*.swp' | xargs rm -rf
    58     cd ..
    59     tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
    60     cp mondo-${MONDO_VER}/mondo.spec ${TOPDIR}/SPECS/mondo.spec
    61     rm -f ${TMP}/mondo-*-root
    62     pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-1.${ARCH}.rpm"
    63 fi
    64 cd ${TOPDIR}/SPECS
    65 if [ "`echo $c | grep mindi`" != "" ]; then
    66     rpmbuild -ba mindi.spec
    67 fi
    68 if [ "`echo $c | grep mondo`" != "" ]; then
    69     rpmbuild -ba --without xmondo mondo.spec
    70 fi
    71 su - -c "$opt rpm -Uvh --force $pkg"
     27export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/mindi.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[  ]*//"`
     28export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/mondo.spec | egrep '^Version:' | cut -d: -f2 | sed "s/[  ]*//"`
Note: See TracChangeset for help on using the changeset viewer.