source: trunk/tools/mkrpm @ 119

Last change on this file since 119 was 63, checked in by bcornec, 14 years ago

merge r62 of 2.04_berlios branch to trunk (rpm build env)

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4#
5# $Id: mkrpm 63 2005-10-14 14:05:32Z bcornec $
6#
7
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/rpm-env
17
18rev=`$TOOLHOME/mksvnversion`
19
20if [ "$1" = "" ]; then
21    c="mindi mondo"
22else
23    c=$1
24fi
25if [ "`echo $c | grep mindi`" != "" ]; then
26    cd ${BASE}/svn
27    echo "Management of mindi ${MINDI_VER}"
28    rm -fr mindi-${MINDI_VER}
29    cp -a ${VER}/mindi mindi-${MINDI_VER}
30    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
31    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
32    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
33    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
34    mkdir -p ${TOPDIR}/SOURCES
35    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
36    tar cvfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
37    sed "s/^%define mrel..*/%define mrel    ${rev}.${suf}/" mindi-${MINDI_VER}/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
38    rm -f ${TMP}/mindi-*-root
39    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}.${suf}.${ARCH}.rpm"
40    # ATTENTION: This could be dangerous for your setup
41    opt="rm -rf /usr/share/mindi ;"
42fi
43if [ "`echo $c | grep  mondo`" != "" ]; then
44    cd ${BASE}/svn
45    echo "Management of mondo ${MONDO_VER}"
46    rm -rf mondo-${MONDO_VER}
47    cp -a ${VER}/mondo mondo-${MONDO_VER}
48    cd mondo-${MONDO_VER}
49    echo "Bootstraping mondo ... "
50    ./bootstrap
51    find . -type d -name .svn | xargs rm -rf
52    find . -type f -name '.*.swp' | xargs rm -rf
53    find . -type f -name '*~' | xargs rm -rf
54    cd ..
55    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
56    tar cvfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
57    sed "s/^%define mrel..*/%define mrel    ${rev}.${suf}/" mondo-${MONDO_VER}/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
58    rm -f ${TMP}/mondo-*-root
59    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}.${suf}.${ARCH}.rpm"
60fi
61cd ${TOPDIR}/SPECS
62if [ "`echo $c | grep mindi`" != "" ]; then
63    rpmbuild -ba mindi.spec
64fi
65if [ "`echo $c | grep mondo`" != "" ]; then
66    rpmbuild -ba --without xmondo mondo.spec
67fi
68su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.