source: MondoRescue/branches/stable/tools/pkg2fc @ 1121

Last change on this file since 1121 was 1121, checked in by Bruno Cornec, 13 years ago
  • 1722 Floppies are NOT supported anymore (allows for mindi to become noarch)
  • mindi is now a noarch type of package
  • RPM Packaging improvements for Fedora
  • Property svn:executable set to *
File size: 1.9 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
21export LANGUAGE="C"
22
23# We need to get $VER and $TAG
24if [ "$1" = "" ]; then
25    LAST=`cat ${TOPDIR}/LAST`
26else
27    LAST=$1
28    shift
29fi
30VER=`echo $LAST | cut -d- -f1`
31TAG=`echo $LAST | cut -d- -f2`
32echo "Working on ${VER}-$TAG"
33   
34if [ "$1" = "" ]; then
35    c="mondo-doc mindi mindi-busybox mondo"
36else
37    if [ "$1" = "all" ]; then
38        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
39    else
40        c="$*"
41    fi
42fi
43
44export pkg=""
45echo "Working under $TOPBUILDDIR"
46cd $TOPBUILDDIR
47
48ppkg=""
49spkg=""
50
51for p in $c; do
52    # s= stable; t = trunk; 1-9 = official version
53    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
54    pv=`basename $src .tar.gz`
55    tag=`echo $pv | sed "s/-\([0-9]*.*\)/\2/"` 
56    spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv-${tag}${suf}.src.rpm"
57    ppkg="$ppkg $pv-${tag}${suf}.src.rpm"
58done
59
60echo "Packages delivery to ${ACCOUNT}"
61cat > /tmp/mkmondo << EOF
62rm -f /tmp/mondorescue.log
63for p in $ppkg ; do
64    rpm -ivh \$p
65    s=\`rpm -qlp \$p | egrep '\.spec'\`
66    # Use dist for fc
67    perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: $1%{?dist}/" rpm/SPECS/\$s
68    perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' rpm/SPECS/\$s
69    rm -rf rpm/BUILD/*
70    rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log
71done
72apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
73aspkg=\`echo \$apkg | egrep "\.src.rpm"\`
74mkdir -p \$DSTDIR
75mv \$aspkg \$DSTDIR
76rm -f \$ppkg
77EOF
78chmod 755 /tmp/mkmondo
79scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
80scp -p /tmp/mkmondo ${ACCOUNT}:
81echo "Packages rebuild on ${DSTNODE}"
82ssh -q ${ACCOUNT} ${DSTNODE} "./mkmondo"
83) 2>&1 | tee /tmp/pk2mdv.log
Note: See TracBrowser for help on using the repository browser.