source: MondoRescue/branches/stable/tools/mkrpm @ 423

Last change on this file since 423 was 423, checked in by bcornec, 14 years ago
  • .spec files adapted to make rpmlint happy
  • no more dyn. libs in mondo
  • no more the X11 part in mondo
  • 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 423 2006-02-21 17:27:48Z 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
[33]17. $TOOLHOME/rpm-env
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
[388]30    $TOOLHOME/mkspec ${MINDI_VER} mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
[423]31    pkg1="${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
32    pkg="$pkg $pkg1"
33    rm -f $pkg1
[204]34fi
35if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
36    cd ${BASE}/svn
[388]37    $TOOLHOME/mkspec ${MINDI_VER} mindi-${MINDI_VER}/distributions/rpm/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
[318]38    rm -rf mindi-${MINDI_VER}/distributions
[20]39    mkdir -p ${TOPDIR}/SOURCES
[318]40
[423]41    pkg1="${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
42    pkg="$pkg $pkg1"
43    rm -f $pkg1
[20]44    # ATTENTION: This could be dangerous for your setup
[204]45    opt="rm -rf /usr/lib/mindi ;"
[20]46fi
47if [ "`echo $c | grep  mondo`" != "" ]; then
48    cd ${BASE}/svn
[388]49    $TOOLHOME/mkspec ${MONDO_VER} mondo-${MONDO_VER}/distributions/rpm/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
[318]50    rm -rf mondo-${MONDO_VER}/distributions
51
[423]52    pkg1="${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
53    pkg="$pkg $pkg1"
54    rm -f $pkg1
[20]55fi
[319]56
[20]57cd ${TOPDIR}/SPECS
[318]58status=0
[204]59if [ "`echo $c | grep kernel`" != "" ]; then
[318]60    echo "Generating mindi-kernel RPMS"
61    log=/tmp/mindi-kernel-rpm.log
62    rpmbuild -ba mindi-kernel.spec 2> $log 1> $log
63    if [ $? != 0 ]; then 
64        cat $log
65        status=-1
66    fi
[204]67fi
68if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
[318]69    echo "Generating mindi RPMS"
70    log=/tmp/mindi-rpm.log
71    rpmbuild -ba mindi.spec 2> $log 1> $log
72    if [ $? != 0 ]; then
73        cat $log
74        status=-1
75    fi
[20]76fi
77if [ "`echo $c | grep mondo`" != "" ]; then
[318]78    echo "Generating mondo RPMS"
79    log=/tmp/mondo-rpm.log
80    rpmbuild -ba mondo.spec 2> $log 1> $log
81    if [ $? != 0 ]; then 
82        cat $log
83        status=-1
84    fi
[20]85fi
[318]86if [ $status = 0 ]; then
87    echo "Installing RPMS as root ($pkg)"
88    su - -c "$opt rpm -Uvh --force $pkg"
89fi
Note: See TracBrowser for help on using the repository browser.