source: branches/stable/tools/pkg2mdv @ 755

Last change on this file since 755 was 755, checked in by Bruno Cornec, 14 years ago
  • Use _defaultdocdir instead of RPM_DOC_DIR for doc built
  • %doc in spec files reviewed
  • Log file for all build scripts
  • Fix a bug for ebuild
  • src file is now name-verion.tar.gz (without TAG)
  • deb pkgs should now be copied on ftp server
  • Fix 2 warnings in mondo
  • Fix a bug introduced for LVM on Debian hopefully
  • Fix a bug on old distros where mktemp needs a template
  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2#
3# Deliver packages and tgz files to Mandriva
4#
5# $Id$
6#
7
8exec > /tmp/pkg2mdv.log 2>&1
9
10dname=`dirname $0`
11prem=`echo $dname |cut -c1`
12if [ ${prem} == "/" ]; then
13        export TOOLHOME=$dname
14else
15    export TOOLHOME=${PWD}/$dname
16fi
17
18. $TOOLHOME/common-env
19. $TOOLHOME/distro-env
20. $TOOLHOME/mdv-env
21
22# We need to get $VER and $TAG
23if [ "$1" = "" ]; then
24    LAST=`cat ${TOPDIR}/LAST`
25else
26    LAST=$1
27    shift
28fi
29VER=`echo $LAST | cut -d- -f1`
30TAG=`echo $LAST | cut -d- -f2`
31echo "Working on ${VER}-$TAG"
32   
33if [ "$1" = "" ]; then
34    c="mondo-doc mindi mondo"
35else
36    if [ "$1" = "all" ]; then
37        c="mindi-kernel mondo-doc mindi mondo"
38    else
39        c=$1
40    fi
41fi
42
43export pkg=""
44echo "Working under $TOPBUILDDIR"
45cd $TOPBUILDDIR
46
47ppkg=""
48spkg=""
49
50for p in $c; do
51    # s= stable; t = trunk; 1-9 = official version
52    src=${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz
53    pv=`basename $src .tar.gz`
54    spkg="$spkg ${TOPBUILDDIR}/SRPMS/$pv${suf}.src.rpm"
55    ppkg="$ppkg $pv${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 mkrel for mdv
65    perl -pi -e 's/define mrel[ \t]+([0-9]+)\..*/define mrel    %mkrel \$1/' rpm/SPECS/\$s
66    perl -pi -e 's/ Bruno Cornec <bruno@mondorescue.org> ([0-9]+.*)/ Bruno Cornec <bcornec@mandriva.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"\`
72for d in 2006 200664; do
73    scp -p \$aspkg chroot\${d}:
74    ssh chroot\${d} "for p in $aspkg; do rpm -ivh \`basename \$p\` ; rpmbuild -ba rpm/SPECS/\$s | tee -a /tmp/mondorescue.log ; done ; sudo ftp\${d}contrib \`egrep '^Wrote:' /tmp/mondorescue.log | grep -v debug | cut -d: -f2\`"
75done
76for p in \$apkg; do
77    sudo ftpcontrib \$p
78done
79rm -f \$ppkg
80EOF
81chmod 755 /tmp/mkmondo
82scp -p ${spkg} /tmp/mkmondo ${ACCOUNT}:
83scp -p /tmp/mkmondo ${ACCOUNT}:
84echo "Packages rebuild on ${DSTNODE}"
85ssh ${ACCOUNT} ${DSTNODE} "./mkmondo"
Note: See TracBrowser for help on using the repository browser.