source: 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
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4#
5# $Id: mkrpm 423 2006-02-21 17:27:48Z 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/rpm-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    pkg1="${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
32    pkg="$pkg $pkg1"
33    rm -f $pkg1
34fi
35if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
36    cd ${BASE}/svn
37    $TOOLHOME/mkspec ${MINDI_VER} mindi-${MINDI_VER}/distributions/rpm/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
38    rm -rf mindi-${MINDI_VER}/distributions
39    mkdir -p ${TOPDIR}/SOURCES
40
41    pkg1="${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${REVISION}${suf}.${ARCH}.rpm"
42    pkg="$pkg $pkg1"
43    rm -f $pkg1
44    # ATTENTION: This could be dangerous for your setup
45    opt="rm -rf /usr/lib/mindi ;"
46fi
47if [ "`echo $c | grep  mondo`" != "" ]; then
48    cd ${BASE}/svn
49    $TOOLHOME/mkspec ${MONDO_VER} mondo-${MONDO_VER}/distributions/rpm/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
50    rm -rf mondo-${MONDO_VER}/distributions
51
52    pkg1="${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${REVISION}${suf}.${ARCH}.rpm"
53    pkg="$pkg $pkg1"
54    rm -f $pkg1
55fi
56
57cd ${TOPDIR}/SPECS
58status=0
59if [ "`echo $c | grep kernel`" != "" ]; then
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
67fi
68if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
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
76fi
77if [ "`echo $c | grep mondo`" != "" ]; then
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
85fi
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.