source: MondoRescue/branches/2.05/tools/mkrpm @ 157

Last change on this file since 157 was 157, checked in by bcornec, 15 years ago

Prepare changelogs for 2.06/1.06 release

  • 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 157 2005-12-08 09:04:21Z 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`" != "" ]; then
27    cd ${BASE}/svn
28    echo "Management of mindi ${MINDI_VER}"
29    rm -fr mindi-${MINDI_VER}
30    cp -a ${VER}/mindi mindi-${MINDI_VER}
31    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
32    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
33    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
34    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
35    mkdir -p ${TOPDIR}/SOURCES
36    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
37    tar cvfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
38    sed "s/^%define mrel..*/%define mrel    ${rev}.${suf}/" mindi-${MINDI_VER}/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
39    rm -f ${TMP}/mindi-*-root
40    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}.${suf}.${ARCH}.rpm"
41    # ATTENTION: This could be dangerous for your setup
42    opt="rm -rf /usr/share/mindi ;"
43fi
44if [ "`echo $c | grep  mondo`" != "" ]; then
45    cd ${BASE}/svn
46    echo "Management of mondo ${MONDO_VER}"
47    rm -rf mondo-${MONDO_VER}
48    cp -a ${VER}/mondo mondo-${MONDO_VER}
49    cd mondo-${MONDO_VER}
50    echo "Bootstraping mondo ... "
51    ./bootstrap
52    find . -type d -name .svn | xargs rm -rf
53    find . -type f -name '.*.swp' | xargs rm -rf
54    find . -type f -name '*~' | xargs rm -rf
55    cd ..
56    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
57    tar cvfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
58    sed "s/^%define mrel..*/%define mrel    ${rev}.${suf}/" mondo-${MONDO_VER}/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
59    rm -f ${TMP}/mondo-*-root
60    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}.${suf}.${ARCH}.rpm"
61fi
62cd ${TOPDIR}/SPECS
63if [ "`echo $c | grep mindi`" != "" ]; then
64    rpmbuild -ba mindi.spec
65fi
66if [ "`echo $c | grep mondo`" != "" ]; then
67    rpmbuild -ba --without xmondo mondo.spec
68fi
69su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.