source: branches/2.06/tools/mkrpm @ 303

Last change on this file since 303 was 303, checked in by bcornec, 13 years ago

Include the result of svn log -v in the tar files generated for RPM build.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1#!/bin/bash
2#
3# Creates RPMs packages from SVN repository for local tests
4#
5# $Id: mkrpm 303 2006-01-12 12:14:30Z 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
19rev=`$TOOLHOME/mksvnversion`
20
21if [ "$1" = "" ]; then
22    c="mindi mondo"
23else
24    c=$1
25fi
26if [ "`echo $c | grep mindi-kernel`" != "" ]; then
27    cd ${BASE}/svn
28    echo "Management of mindi-kernel ${MINDI_VER}"
29    rm -fr mindi-kernel-${MINDI_VER}
30    cp -a ${VER}/mindi-kernel mindi-kernel-${MINDI_VER}
31    find mindi-kernel-${MINDI_VER} -type d -name .svn | xargs rm -rf
32    find mindi-kernel-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
33    find mindi-kernel-${MINDI_VER} -type f -name '*~' | xargs rm -rf
34    mkdir -p ${TOPDIR}/SOURCES
35    tar cvfhz ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tgz mindi-kernel-${MINDI_VER}
36    tar cvfhj ${TOPDIR}/SOURCES/mindi-kernel-${MINDI_VER}.tar.bz2 mindi-kernel-${MINDI_VER}
37    sed "s/^%define mrel..*/%define mrel    ${rev}.${suf}/" mindi-kernel-${MINDI_VER}/mindi-kernel.spec > ${TOPDIR}/SPECS/mindi-kernel.spec
38    rm -f ${TMP}/mindi-kernel*-root
39    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-kernel-${MINDI_VER}-${rev}.${suf}.${ARCH}.rpm"
40fi
41if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
42    cd ${BASE}/svn
43    echo "Management of mindi ${MINDI_VER}"
44    rm -fr mindi-${MINDI_VER}
45    cp -a ${VER}/mindi mindi-${MINDI_VER}
46    svn log -v > mindi-${MINDI_VER}/svn.log
47    find mindi-${MINDI_VER} -type d -name .svn | xargs rm -rf
48    find mindi-${MINDI_VER} -type f -name '.*.swp' | xargs rm -rf
49    find mindi-${MINDI_VER} -type f -name '*~' | xargs rm -rf
50    rm -f mindi-${MINDI_VER}/parted2fdisk mindi-${MINDI_VER}/parted2fdisk.c mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
51    mkdir -p ${TOPDIR}/SOURCES
52    tar cvfhz ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tgz mindi-${MINDI_VER}
53    tar cvfhj ${TOPDIR}/SOURCES/mindi-${MINDI_VER}.tar.bz2 mindi-${MINDI_VER}
54    sed -e "s/^%define mrel..*/%define mrel ${rev}.${suf}/" -e "s/VVV/${MINDI_VER}/" mindi-${MINDI_VER}/mindi.spec > ${TOPDIR}/SPECS/mindi.spec
55    rm -f ${TMP}/mindi-*-root
56    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mindi-${MINDI_VER}-${rev}.${suf}.${ARCH}.rpm"
57    # ATTENTION: This could be dangerous for your setup
58    opt="rm -rf /usr/lib/mindi ;"
59fi
60if [ "`echo $c | grep  mondo`" != "" ]; then
61    cd ${BASE}/svn
62    echo "Management of mondo ${MONDO_VER}"
63    rm -rf mondo-${MONDO_VER}
64    cp -a ${VER}/mondo mondo-${MONDO_VER}
65    svn log -v > mondo-${MONDO_VER}/svn.log
66    cd mondo-${MONDO_VER}
67    echo "Bootstraping mondo ... "
68    ./bootstrap
69    find . -type d -name .svn | xargs rm -rf
70    find . -type f -name '.*.swp' | xargs rm -rf
71    find . -type f -name '*~' | xargs rm -rf
72    cd ..
73    tar cvfhz ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tgz mondo-${MONDO_VER}
74    tar cvfhj ${TOPDIR}/SOURCES/mondo-${MONDO_VER}.tar.bz2 mondo-${MONDO_VER}
75    sed -e "s/^%define mrel..*/%define mrel ${rev}.${suf}/" -e "s/VVV/${MONDO_VER}/" mondo-${MONDO_VER}/mondo.spec > ${TOPDIR}/SPECS/mondo.spec
76    rm -f ${TMP}/mondo-*-root
77    pkg="$pkg ${TOPDIR}/RPMS/${ARCH}/mondo-${MONDO_VER}-${rev}.${suf}.${ARCH}.rpm"
78fi
79cd ${TOPDIR}/SPECS
80if [ "`echo $c | grep kernel`" != "" ]; then
81    rpmbuild -ba mindi-kernel.spec
82fi
83if [ "`echo $c | grep -v kernel | grep mindi`" != "" ]; then
84    rpmbuild -ba mindi.spec
85fi
86if [ "`echo $c | grep mondo`" != "" ]; then
87    rpmbuild -ba mondo.spec
88fi
89su - -c "$opt rpm -Uvh --force $pkg"
Note: See TracBrowser for help on using the repository browser.