source: MondoRescue/trunk/tools/pkg2fc@ 1043

Last change on this file since 1043 was 1043, checked in by Bruno Cornec, 18 years ago

merge -r978:1042 $SVN_M/branches/stable

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