source: trunk/tools/mkrpm @ 34

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

some fies needs to be executables

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4#
5# $Id: mkrpm 34 2005-09-29 01:14:36Z 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`
19
20if [ "$1" = "" ]; then
21    c="mindi mondo"
22else
23    c=$1
24fi
25if [ "`echo $c | grep mindi`" != "" ]; then
26    cd ${BASE}/svn
27    echo "Management of mindi ${MINDI_VER}"
28    rm -fr mindi-${MINDI_VER}
29    cp -a ${VER}/mindi mindi-${MINDI_VER}
30    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
31    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
32    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
33    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
34    mkdir -p ${TOPDIR}/SOURCES
35    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
36    cp mindi-${MINDI_VER}/mindi.spec ${TOPDIR}/SPECS/mindi.spec
37    rm -f ${TMP}/mindi-*-root
38    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}.${ARCH}.rpm"
39    # ATTENTION: This could be dangerous for your setup
40    opt="rm -rf /usr/share/mindi ;"
41fi
42if [ "`echo $c | grep  mondo`" != "" ]; then
43    cd ${BASE}/svn
44    echo "Management of mondo ${MONDO_VER}"
45    rm -rf mondo-${MONDO_VER}
46    cp -a ${VER}/mondo mondo-${MONDO_VER}
47    cd mondo-${MONDO_VER}
48    echo "Bootstraping mondo ... "
49    ./bootstrap
50    find . -type d -name .svn | xargs rm -rf
51    find . -type f -name '.*.swp' | xargs rm -rf
52    find . -type f -name '*~' | xargs rm -rf
53    cd ..
54    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
55    cp mondo-${MONDO_VER}/mondo.spec ${TOPDIR}/SPECS/mondo.spec
56    rm -f ${TMP}/mondo-*-root
57    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}.${ARCH}.rpm"
58fi
59cd ${TOPDIR}/SPECS
60if [ "`echo $c | grep mindi`" != "" ]; then
61    rpmbuild -ba mindi.spec
62fi
63if [ "`echo $c | grep mondo`" != "" ]; then
64    rpmbuild -ba --without xmondo mondo.spec
65fi
66su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.