source: branches/2.05/tools/mkrpm @ 237

Last change on this file since 237 was 237, checked in by bcornec, 14 years ago
  • single place for VERSION numbers in mondo and mindi (Bruno Cornec)
  • revision taken from global tree, not from files for mindi/mondo tagging (Bruno Cornec)
  • chown can't be done for RPMS in install.sh
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4#
5# $Id: mkrpm 237 2005-12-19 19:23:17Z bcornec $
6#
7
8umask 022
9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ ${prem} == "/" ]; then
12    export TOOLHOME=$dname
13else
14    export TOOLHOME=${PWD}/$dname
15fi
16
17. $TOOLHOME/rpm-env
18
19rev=`$TOOLHOME/mksvnversion`
20
21if [ "$1" = "" ]; then
22    c="mindi mondo"
23else
24    c=$1
25fi
26if [ "`echo $c | grep mindi-kernel`" != "" ]; then
27    cd ${BASE}/svn
28    echo "Management of mindi-kernel ${MINDI_VER}"
29    rm -fr mindi-kernel-${MINDI_VER}
30    cp -a ${VER}/mindi-kernel mindi-kernel-${MINDI_VER}
31    find mindi-kernel-${MINDI_VER} -type d -name .svn | xargs rm -rf
32    find mindi-kernel-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
33    find mindi-kernel-${MINDI_VER} -type f -name '*~' | xargs rm -rf
34    mkdir -p ${TOPDIR}/SOURCES
35    tar cvfhz ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tgz mindi-kernel-${MINDI_VER}
36    tar cvfhj ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tar.bz2 mindi-kernel-${MINDI_VER}
37    sed "s/^%define mrel..*/%define mrel    ${rev}.${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
38    rm -f ${TMP}/mindi-kernel*-root
39    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${rev}.${suf}.${ARCH}.rpm"
40fi
41if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
42    cd ${BASE}/svn
43    echo "Management of mindi ${MINDI_VER}"
44    rm -fr mindi-${MINDI_VER}
45    cp -a ${VER}/mindi mindi-${MINDI_VER}
46    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
47    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
48    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
49    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
50    mkdir -p ${TOPDIR}/SOURCES
51    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
52    tar cvfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
53    sed -e "s/^%define mrel..*/%define mrel ${rev}.${suf}/" -e "s/VVV/${MINDI_VER}/" mindi-${MINDI_VER}/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
54    rm -f ${TMP}/mindi-*-root
55    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}.${suf}.${ARCH}.rpm"
56    # ATTENTION: This could be dangerous for your setup
57    opt="rm -rf /usr/lib/mindi ;"
58fi
59if [ "`echo $c | grep  mondo`" != "" ]; then
60    cd ${BASE}/svn
61    echo "Management of mondo ${MONDO_VER}"
62    rm -rf mondo-${MONDO_VER}
63    cp -a ${VER}/mondo mondo-${MONDO_VER}
64    cd mondo-${MONDO_VER}
65    echo "Bootstraping mondo ... "
66    ./bootstrap
67    find . -type d -name .svn | xargs rm -rf
68    find . -type f -name '.*.swp' | xargs rm -rf
69    find . -type f -name '*~' | xargs rm -rf
70    cd ..
71    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
72    tar cvfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
73    sed -e "s/^%define mrel..*/%define mrel ${rev}.${suf}/" -e "s/VVV/${MONDO_VER}/" mondo-${MONDO_VER}/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
74    rm -f ${TMP}/mondo-*-root
75    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}.${suf}.${ARCH}.rpm"
76fi
77cd ${TOPDIR}/SPECS
78if [ "`echo $c | grep kernel`" != "" ]; then
79    rpmbuild -ba mindi-kernel.spec
80fi
81if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
82    rpmbuild -ba mindi.spec
83fi
84if [ "`echo $c | grep mondo`" != "" ]; then
85    rpmbuild -ba mondo.spec
86fi
87su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.