source: branches/stable/tools/mkdeb @ 464

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

Addition of changelog for rpms
qemu usage is now more precise
qemu script now kill vm after a certain amount of time (mandrake needs that)

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#!/bin/bash
2#
3# Creates debs packages from SVN repository for local tests
4#
5# $Id: mkdeb 464 2006-04-04 22:09:35Z 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/deb-env
18
19if [ "$1" = "" ]; then
20    c="mindi mondo"
21else
22    c=$1
23fi
24
25$TOOLHOME/mkcommon "$c"
26
27if [ "`echo $c | grep mindi-kernel`" != "" ]; then
28    cd ${BASE}/svn
29    mkdir -p ${TOPDIR}/SOURCES
30    $TOOLHOME/mkspec ${MINDI_VER} mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
31    chmod 644 ${TOPDIR}/SPECS/mindi-kernel.spec
32    pkg1="${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
33    pkg="$pkg $pkg1"
34    rm -f $pkg1
35fi
36if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
37    cd ${BASE}/svn
38    $TOOLHOME/mkspec ${MINDI_VER} mindi-${MINDI_VER}/distributions/rpm/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
39    cat mindi-${MINDI_VER}/distributions/$dfam/changelog >> ${TOPDIR}/SPECS/mindi.spec
40    chmod 644 ${TOPDIR}/SPECS/mindi.spec
41    rm -rf mindi-${MINDI_VER}/distributions
42    mkdir -p ${TOPDIR}/SOURCES
43
44    pkg1="${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
45    pkg="$pkg $pkg1"
46    rm -f $pkg1
47fi
48if [ "`echo $c | grep  mondo`" != "" ]; then
49    cd ${BASE}/svn
50    $TOOLHOME/mkspec ${MONDO_VER} mondo-${MONDO_VER}/distributions/rpm/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
51    cat mondo-${MONDO_VER}/distributions/$dfam/changelog >> ${TOPDIR}/SPECS/mondo.spec
52    chmod 644 ${TOPDIR}/SPECS/mondo.spec
53    rm -rf mondo-${MONDO_VER}/distributions
54
55    pkg1="${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
56    pkg="$pkg $pkg1"
57    rm -f $pkg1
58fi
59
60cd ${TOPDIR}/SPECS
61status=0
62if [ "`echo $c | grep kernel`" != "" ]; then
63    echo "Generating mindi-kernel RPMS"
64    log=/tmp/mindi-kernel-rpm.log
65    rpmbuild -ba mindi-kernel.spec 2> $log 1> $log
66    if [ $? != 0 ]; then 
67        cat $log
68        status=-1
69    fi
70fi
71if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
72    echo "Generating mindi RPMS"
73    log=/tmp/mindi-rpm.log
74    rpmbuild -ba mindi.spec 2> $log 1> $log
75    if [ $? != 0 ]; then
76        cat $log
77        status=-1
78    fi
79fi
80if [ "`echo $c | grep mondo`" != "" ]; then
81    echo "Generating mondo RPMS"
82    log=/tmp/mondo-rpm.log
83    rpmbuild -ba mondo.spec 2> $log 1> $log
84    if [ $? != 0 ]; then 
85        cat $log
86        status=-1
87    fi
88fi
89if [ $status = 0 ]; then
90    echo "Installing RPMS as root ($pkg)"
91    su - -c "$opt rpm -Uvh --force $pkg"
92fi
Note: See TracBrowser for help on using the repository browser.