source: branches/2.04_berlios/tools/mkrpm @ 52

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

mkrpm now handles release suffixes (mdk/mdv)

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4#
5# $Id: mkrpm 52 2005-10-07 22:59:40Z bcornec $
6#
7
8dname=`dirname $0`
9prem=`echo $dname |cut -c1`
10if [ ${prem} == "/" ]; then
11    export TOOLHOME=$dname
12else
13    export TOOLHOME=${PWD}/$dname
14fi
15
16. $TOOLHOME/rpm-env
17
18rev=`$TOOLHOME/mksvnversion`
19if [ -e /etc/mandriva-release ]; then
20        suf=mdk
21elif [ -e /etc/mandrake-release ]; then
22        suf=mdk
23else
24        suf=""
25fi
26
27if [ "$1" = "" ]; then
28    c="mindi mondo"
29else
30    c=$1
31fi
32if [ "`echo $c | grep mindi`" != "" ]; then
33    cd ${BASE}/svn
34    echo "Management of mindi ${MINDI_VER}"
35    rm -fr mindi-${MINDI_VER}
36    cp -a ${VER}/mindi mindi-${MINDI_VER}
37    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
38    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
39    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
40    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
41    mkdir -p ${TOPDIR}/SOURCES
42    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
43    tar cvfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
44    sed "s/^%define mrel..*/%define mrel    ${rev}/" mindi-${MINDI_VER}/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
45    rm -f ${TMP}/mindi-*-root
46    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}${suf}.${ARCH}.rpm"
47    # ATTENTION: This could be dangerous for your setup
48    opt="rm -rf /usr/share/mindi ;"
49fi
50if [ "`echo $c | grep  mondo`" != "" ]; then
51    cd ${BASE}/svn
52    echo "Management of mondo ${MONDO_VER}"
53    rm -rf mondo-${MONDO_VER}
54    cp -a ${VER}/mondo mondo-${MONDO_VER}
55    cd mondo-${MONDO_VER}
56    echo "Bootstraping mondo ... "
57    ./bootstrap
58    find . -type d -name .svn | xargs rm -rf
59    find . -type f -name '.*.swp' | xargs rm -rf
60    find . -type f -name '*~' | xargs rm -rf
61    cd ..
62    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
63    tar cvfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
64    sed "s/^%define mrel..*/%define mrel    ${rev}/" mondo-${MONDO_VER}/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
65    rm -f ${TMP}/mondo-*-root
66    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}${suf}.${ARCH}.rpm"
67fi
68cd ${TOPDIR}/SPECS
69if [ "`echo $c | grep mindi`" != "" ]; then
70    rpmbuild -ba mindi.spec
71fi
72if [ "`echo $c | grep mondo`" != "" ]; then
73    rpmbuild -ba --without xmondo mondo.spec
74fi
75su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.