source: branches/2.0.8/tools/pkg2mdv @ 597

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

Build process fixes following first attempt to deliver 2.0.8

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/bash
2#
3# Deliver packages and tgz files to Mandriva
4#
5# $Id$
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/common-env
17. $TOOLHOME/distro-env
18. $TOOLHOME/mdv-env
19
20# We need to get $VER and $TAG
21if [ "$1" = "" ]; then
22    LAST=`cat ${TOPDIR}/LAST`
23else
24    LAST=$1
25    shift
26fi
27VER=`echo $LAST | cut -d- -f1`
28TAG=`echo $LAST | cut -d- -f2`
29echo "Working on ${VER}-$TAG"
30   
31if [ "$1" = "" ]; then
32    c="mondo-doc mindi mondo"
33else
34    if [ "$1" = "all" ]; then
35        c="mindi-kernel mondo-doc mindi mondo"
36    else
37        c=$1
38    fi
39fi
40
41export pkg=""
42echo "Working under $TOPBUILDDIR"
43cd $TOPBUILDDIR
44
45ppkg=""
46spkg=""
47
48for p in $c; do
49    # s= stable; t = trunk; 1-9 = official version
50    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
51    pv=`basename $src .tar.gz`
52    spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv${suf}.src.rpm"
53    ppkg="$ppkg $pv${suf}.src.rpm"
54done
55
56echo "Packages delivery to ${ACCOUNT}"
57cat > /tmp/mkmondo << EOF
58rm -f /tmp/mondorescue.log
59for p in $ppkg ; do
60    rpm -ivh \$p
61    s=\`rpm -qlp \$p | egrep '\.spec'\`
62    # Use mkrel for mdv
63    perl -pi -e 's/define mrel[ \t]+([0-9]+)\..*/define mrel    %mkrel \$1/' rpm/SPECS/\$s
64    rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log
65done
66apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
67sudo ftpcontrib \$apkg
68rm -f $ppkg
69EOF
70chmod 755 /tmp/mkmondo
71scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
72scp -p /tmp/mkmondo ${ACCOUNT}:
73echo "Packages rebuild on ${DSTNODE}"
74ssh ${ACCOUNT} ${DSTNODE} "./mkmondo"
Note: See TracBrowser for help on using the repository browser.