source: MondoRescue/trunk/mkrpm@ 17

Last change on this file since 17 was 17, checked in by bcornec, 19 years ago

Add an mkrpm script used to re-created RPMs locally for testing purposes

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4
5# Adapt to your needs
6BASE=/bruno/mondo
7# Look at opt below if this is dangerous for you or not.
8
9# Should not be modified below
10VER=trunk
11pkg=""
12opt=""
13ARCH=`/bin/arch`
14
15mkdir -p ${BASE}/RPMS
16cd ${BASE}/RPMS
17mkdir -p RPMS SRPMS SPECS SOURCES BUILD
18
19cd ${BASE}/svn
20if [ "$1" = "" ]; then
21 c="mindi mondo"
22else
23 c=$1
24fi
25if [ "`echo $c | grep mindi`" != "" ]; then
26 cd mindi
27 MINDI_VER=`cat $VER/mindi.spec | egrep '^Version:' | cut -d: -f2 | sed "s/ *//"`
28 rm -fr mindi-${MINDI_VER}
29 cp -a $VER 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 rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
33 mkdir -p ../../RPMS/SOURCES
34 tar cvfhz ../../RPMS/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
35 cp mindi-${MINDI_VER}/mindi.spec ../../RPMS/SPECS/mindi.spec
36 rm -f ${BASE}/../tmp/mindi-*-root
37 cd ..
38 pkg="$pkg ${BASE}/RPMS/RPMS/${ARCH}/mindi-${MINDI_VER}-1.${ARCH}.rpm"
39 # ATTENTION: This could be dangerous for your setup
40 opt="rm -rf /usr/share/mindi ;"
41fi
42if [ "`echo $c | grep mondo`" != "" ]; then
43 cd mondo
44 MONDO_VER=`cat $VER/mondo.spec | egrep '^Version:' | cut -d: -f2 | sed "s/ *//"`
45 rm -rf mondo-${MONDO_VER}
46 cp -a $VER mondo-${MONDO_VER}
47 cd mondo-${MONDO_VER}
48 echo "Bootstraping mondo ... "
49 ./bootstrap
50 find . -type d -name .svn | xargs rm -rf
51 find . -type f -name '.*.swp' | xargs rm -rf
52 cd ..
53 tar cvfhz ../../RPMS/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
54 cp mondo-${MONDO_VER}/mondo.spec ../../RPMS/SPECS/mondo.spec
55 rm -f ${BASE}/../tmp/mondo-*-root
56 cd ..
57 pkg="$pkg ${BASE}/RPMS/RPMS/${ARCH}/mondo-${MONDO_VER}-1.${ARCH}.rpm"
58fi
59cd ../RPMS/SPECS
60if [ "`echo $c | grep mindi`" != "" ]; then
61 rpmbuild -ba mindi.spec
62fi
63if [ "`echo $c | grep mondo`" != "" ]; then
64 rpmbuild -ba --without xmondo mondo.spec
65fi
66su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.