source: branches/2.2.2/tools/pkg2fc @ 1273

Last change on this file since 1273 was 1273, checked in by bruno, 12 years ago
  • On CentOS 4.4 mdrun isn't available anymore so init should use mdadm instead.

(based on a patch of Momtchil Momtchev <momtchil.momtchev_at_linagora.com>)

  • mkchangelog now supports an fc option for Fedora pkg genration
  • Try to improve Fedora official packages generation
  • Property svn:executable set to *
File size: 2.0 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    src=\`rpm -qlp \$p | grep -E '\.spec'\`
64    spec=\`tar tvf rpm/SOURCES/\$src | grep -E "\$p-fc.spec"\`
65    tar xf rpm/SOURCES/\$src \$spec
66    s=\`rpm -qlp \$p | egrep '\.spec'\`
67    mv \$p-fc.spec rpm/SPECS/\$s
68    # Use dist for fc
69    perl -pi -e "s/define Release:[ \t]+([0-9]+)..*/define Release: \$1%{?dist}/" rpm/SPECS/\$s
70    perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org>..*/ Bruno Cornec <bruno@mondorescue.org> %{version}-%{release}/' rpm/SPECS/\$s
71    rm -rf rpm/BUILD/*
72    rpmbuild -ba rpm/SPECS/\$s 2>&1 | tee -a /tmp/mondorescue.log
73done
74apkg=\`egrep "^Wrote:" /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`
75aspkg=\`echo \$apkg | egrep "\.src.rpm"\`
76mkdir -p \$DSTDIR
77mv \$aspkg \$DSTDIR
78rm -f \$ppkg
79EOF
80chmod 755 /tmp/mkmondo
81scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
82scp -p /tmp/mkmondo ${ACCOUNT}:
83echo "Packages rebuild on ${DSTNODE}"
84ssh -q ${ACCOUNT} ${DSTNODE} "./mkmondo"
85) 2>&1 | tee /tmp/pk2fc.log
Note: See TracBrowser for help on using the repository browser.