source: MondoRescue/trunk/tools/mkrpm @ 394

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

merge -r387:391 $SVN_M/branches/stable

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.1 KB
RevLine 
[20]1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
[33]4#
5# $Id: mkrpm 394 2006-02-15 10:44:31Z bcornec $
6#
[20]7
[146]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
[33]17. $TOOLHOME/rpm-env
18
[20]19if [ "$1" = "" ]; then
20    c="mindi mondo"
21else
22    c=$1
23fi
[320]24
25$TOOLHOME/mkcommon "$c"
26
[219]27if [ "`echo $c | grep mindi-kernel`" != "" ]; then
[20]28    cd ${BASE}/svn
[219]29    mkdir -p ${TOPDIR}/SOURCES
[394]30    $TOOLHOME/mkspec ${MINDI_VER} mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
[320]31    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
[219]32fi
33if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
34    cd ${BASE}/svn
[394]35    $TOOLHOME/mkspec ${MINDI_VER} mindi-${MINDI_VER}/distributions/rpm/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
[320]36    rm -rf mindi-${MINDI_VER}/distributions
[20]37    mkdir -p ${TOPDIR}/SOURCES
[320]38
39    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
[20]40    # ATTENTION: This could be dangerous for your setup
[219]41    opt="rm -rf /usr/lib/mindi ;"
[20]42fi
43if [ "`echo $c | grep  mondo`" != "" ]; then
44    cd ${BASE}/svn
[394]45    $TOOLHOME/mkspec ${MONDO_VER} mondo-${MONDO_VER}/distributions/rpm/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
[320]46    rm -rf mondo-${MONDO_VER}/distributions
47
48    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
[20]49fi
[320]50
[20]51cd ${TOPDIR}/SPECS
[320]52status=0
[219]53if [ "`echo $c | grep kernel`" != "" ]; then
[320]54    echo "Generating mindi-kernel RPMS"
55    log=/tmp/mindi-kernel-rpm.log
56    rpmbuild -ba mindi-kernel.spec 2> $log 1> $log
57    if [ $? != 0 ]; then 
58        cat $log
59        status=-1
60    fi
[219]61fi
62if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
[320]63    echo "Generating mindi RPMS"
64    log=/tmp/mindi-rpm.log
65    rpmbuild -ba mindi.spec 2> $log 1> $log
66    if [ $? != 0 ]; then
67        cat $log
68        status=-1
69    fi
[20]70fi
71if [ "`echo $c | grep mondo`" != "" ]; then
[320]72    echo "Generating mondo RPMS"
73    log=/tmp/mondo-rpm.log
74    rpmbuild -ba mondo.spec 2> $log 1> $log
75    if [ $? != 0 ]; then 
76        cat $log
77        status=-1
78    fi
[20]79fi
[320]80if [ $status = 0 ]; then
81    echo "Installing RPMS as root ($pkg)"
82    su - -c "$opt rpm -Uvh --force $pkg"
83fi
Note: See TracBrowser for help on using the repository browser.