source: branches/stable/tools/mkcommon @ 544

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

Build process reviewed:
mkcommon will now export everything from SVN and create tar files containing everyhting

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#!/bin/bash
2#
3# Prepare source packages from SVN repository as a tar file
4# Also prepare the documentation which is common as a separate tar files
5#
6# $Id: mkcommon 544 2006-05-13 22:11:27Z bcornec $
7#
8
9umask 022
10dname=`dirname $0`
11prem=`echo $dname |cut -c1`
12if [ ${prem} == "/" ]; then
13        export TOOLHOME=$dname
14else
15        export TOOLHOME=${PWD}/$dname
16fi
17
18cd $TOOLHOME
19. ./common-env
20
21mkdir -p ${TOPDIR}/SOURCES
22
23if [ "$1" = "" ]; then
24        c="mondo-doc mindi mondo"
25else
26    if [ "$1" = "all" ]; then
27            c="mindi-kernel mondo-doc mindi mondo"
28    else
29        c=$1
30    fi
31fi
32
33
34cd ${BASE}/svn
35
36for p in "$c"; do
37    v=`cat ${VER}/$p/VERSION`
38    echo "Management of $p $v-$REVISION"
39    rm -fr $p-$v
40    svn export ${VER}/$p $p-$v
41    echo "$REVISION" > $p-$v/REVISION
42    echo "Generating SVN log file ..."
43    svn log -v ${VER}/$p > $p-$v/svn.log
44
45    if [ _"`echo $p | grep mondo-doc`" != _"" ]; then
46        cd ${p}-${v}
47        $TOOLHOME/expandver mondorescue-howto.sgml *8
48        make -f Makefile.howto
49        if [ $? != 0 ]; then
50            exit -1
51        fi
52        make -f Makefile.man
53        if [ $? != 0 ]; then
54            exit -1
55        fi
56        cd ..
57    fi
58
59    if [ _"`echo $p | grep -v kernel | grep mindi`" != _"" ]; then
60        v1=`cat ${VER}/mondo-doc/VERSION`
61        if [ ! -d mondo-doc-$v1 ]; then
62            echo "mondo-doc should be created before $p"
63            exit -1
64        fi
65        (cd mondo-doc-$v1 ; make -f Makefile.man install-$p INSTALLDIR=../$p-$v)
66        rm -f mindi-${MINDI_VER}/rootfs/sbin/parted2fdisk-ia64
67    fi
68    if [ "`echo $p | grep -v doc | grep  mondo`" != "" ]; then
69        v1=`cat ${VER}/mondo-doc/VERSION`
70        if [ ! -d mondo-doc-$v1 ]; then
71            echo "mondo-doc should be created before $p"
72            exit -1
73        fi
74        (cd mondo-doc-$v1 ; make -f Makefile.howto install INSTALLDIR=../$p-$v/docs/en ; make -f Makefile.man install-$p INSTALLDIR=../$p-$v/docs/man)
75        (cd $p-$v ; echo "Bootstraping mondo ... " ; ./bootstrap)
76    fi
77
78    # Finally creates the tar files
79    echo "Creating $p tar files"
80    tar cvfhz ${TOPDIR}/SOURCES/$p-$v.tgz $p-$v
81    tar cvfhj ${TOPDIR}/SOURCES/$p-$v.tar.bz2 $p-$v
82done
Note: See TracBrowser for help on using the repository browser.