source: trunk/tools/mkrpm @ 27

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

-p option added

File size: 1.7 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4
5. ./rpm-env
6
7if [ "$1" = "" ]; then
8    c="mindi mondo"
9else
10    c=$1
11fi
12if [ "`echo $c | grep mindi`" != "" ]; then
13    cd ${BASE}/svn
14    echo "Management of mindi ${MINDI_VER}"
15    rm -fr mindi-${MINDI_VER}
16    cp -a ${VER}/mindi mindi-${MINDI_VER}
17    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
18    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
19    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
20    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
21    mkdir -p ${TOPDIR}/SOURCES
22    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
23    cp mindi-${MINDI_VER}/mindi.spec ${TOPDIR}/SPECS/mindi.spec
24    rm -f ${TMP}/mindi-*-root
25    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-1.${ARCH}.rpm"
26    # ATTENTION: This could be dangerous for your setup
27    opt="rm -rf /usr/share/mindi ;"
28fi
29if [ "`echo $c | grep  mondo`" != "" ]; then
30    cd ${BASE}/svn
31    echo "Management of mondo ${MONDO_VER}"
32    rm -rf mondo-${MONDO_VER}
33    cp -a ${VER}/mondo mondo-${MONDO_VER}
34    cd mondo-${MONDO_VER}
35    echo "Bootstraping mondo ... "
36    ./bootstrap
37    find . -type d -name .svn | xargs rm -rf
38    find . -type f -name '.*.swp' | xargs rm -rf
39    find . -type f -name '*~' | xargs rm -rf
40    cd ..
41    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
42    cp mondo-${MONDO_VER}/mondo.spec ${TOPDIR}/SPECS/mondo.spec
43    rm -f ${TMP}/mondo-*-root
44    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-1.${ARCH}.rpm"
45fi
46cd ${TOPDIR}/SPECS
47if [ "`echo $c | grep mindi`" != "" ]; then
48    rpmbuild -ba mindi.spec
49fi
50if [ "`echo $c | grep mondo`" != "" ]; then
51    rpmbuild -ba --without xmondo mondo.spec
52fi
53su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.