source: MondoRescue/branches/stable/tools/mkdeb@ 541

Last change on this file since 541 was 541, checked in by bcornec, 18 years ago

Stable is reverted to r436 (2.0.7) to put it in line with 2.0.8 and start from there over

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.5 KB
RevLine 
[20]1#!/bin/bash
2#
[319]3# Creates debs packages from SVN repository for local tests
[33]4#
5# $Id: mkdeb 541 2006-05-13 18:47:23Z bcornec $
6#
[20]7
[157]8umask 022
[33]9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ ${prem} == "/" ]; then
12 export TOOLHOME=$dname
13else
14 export TOOLHOME=${PWD}/$dname
15fi
[20]16
[319]17. $TOOLHOME/deb-env
[33]18
[20]19if [ "$1" = "" ]; then
20 c="mindi mondo"
21else
22 c=$1
23fi
[319]24
25$TOOLHOME/mkcommon "$c"
26
[204]27if [ "`echo $c | grep mindi-kernel`" != "" ]; then
[20]28 cd ${BASE}/svn
[204]29 mkdir -p ${TOPDIR}/SOURCES
[541]30 sed "s/^%define mrel..*RRR/%define mrel ${REVISION}${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
31 pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
[204]32fi
33if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
34 cd ${BASE}/svn
[541]35 if [ -f mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec ]; then
36 specfile=mindi-${MINDI_VER}/distributions/${ddir}/mindi.spec
37 else
38 specfile=mindi-${MINDI_VER}/distributions/common/mindi.spec
39 fi
40 sed -e "s/^%define mrel..*RRR/%define mrel ${REVISION}${suf}/" -e "s/VVV/${MINDI_VER}/" $specfile > ${TOPDIR}/SPECS/mindi.spec
[318]41 rm -rf mindi-${MINDI_VER}/distributions
[20]42 mkdir -p ${TOPDIR}/SOURCES
[318]43
[541]44 pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
45 # ATTENTION: This could be dangerous for your setup
46 opt="rm -rf /usr/lib/mindi ;"
[20]47fi
48if [ "`echo $c | grep mondo`" != "" ]; then
49 cd ${BASE}/svn
[541]50 if [ -f mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec ]; then
51 specfile=mondo-${MONDO_VER}/distributions/${ddir}/mondo.spec
52 else
53 specfile=mondo-${MONDO_VER}/distributions/common/mondo.spec
54 fi
55 sed -e "s/^%define mrel..*RRR/%define mrel ${REVISION}${suf}/" -e "s/VVV/${MONDO_VER}/" $specfile > ${TOPDIR}/SPECS/mondo.spec
[318]56 rm -rf mondo-${MONDO_VER}/distributions
57
[541]58 pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
[20]59fi
[319]60
[20]61cd ${TOPDIR}/SPECS
[318]62status=0
[541]63if [ "`echo $c | grep kernel`" != "" ]; then
64 echo "Generating mindi-kernel RPMS"
65 log=/tmp/mindi-kernel-rpm.log
66 rpmbuild -ba mindi-kernel.spec 2> $log 1> $log
[318]67 if [ $? != 0 ]; then
68 cat $log
69 status=-1
70 fi
[204]71fi
[541]72if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
73 echo "Generating mindi RPMS"
74 log=/tmp/mindi-rpm.log
75 rpmbuild -ba mindi.spec 2> $log 1> $log
76 if [ $? != 0 ]; then
77 cat $log
78 status=-1
79 fi
80fi
81if [ "`echo $c | grep mondo`" != "" ]; then
82 echo "Generating mondo RPMS"
83 log=/tmp/mondo-rpm.log
84 rpmbuild -ba mondo.spec 2> $log 1> $log
85 if [ $? != 0 ]; then
86 cat $log
87 status=-1
88 fi
89fi
[318]90if [ $status = 0 ]; then
[541]91 echo "Installing RPMS as root ($pkg)"
[318]92 su - -c "$opt rpm -Uvh --force $pkg"
93fi
Note: See TracBrowser for help on using the repository browser.