[20] | 1 | #!/bin/bash
|
---|
| 2 | #
|
---|
[547] | 3 | # Prepare source packages from SVN repository as a tar file
|
---|
| 4 | # Also prepare the documentation which is common as a separate tar files
|
---|
[33] | 5 | #
|
---|
| 6 | # $Id: mkcommon 547 2006-05-13 22:36:25Z bcornec $
|
---|
| 7 | #
|
---|
[20] | 8 |
|
---|
[157] | 9 | umask 022
|
---|
[547] | 10 | dname=`dirname $0`
|
---|
| 11 | prem=`echo $dname |cut -c1`
|
---|
| 12 | if [ ${prem} == "/" ]; then
|
---|
| 13 | export TOOLHOME=$dname
|
---|
| 14 | else
|
---|
| 15 | export TOOLHOME=${PWD}/$dname
|
---|
| 16 | fi
|
---|
[20] | 17 |
|
---|
[547] | 18 | cd $TOOLHOME
|
---|
| 19 | . ./common-env
|
---|
[33] | 20 |
|
---|
[547] | 21 | mkdir -p ${TOPDIR}/SOURCES
|
---|
| 22 |
|
---|
[20] | 23 | if [ "$1" = "" ]; then
|
---|
[543] | 24 | c="mondo-doc mindi mondo"
|
---|
[20] | 25 | else
|
---|
[543] | 26 | if [ "$1" = "all" ]; then
|
---|
| 27 | c="mindi-kernel mondo-doc mindi mondo"
|
---|
| 28 | else
|
---|
| 29 | c=$1
|
---|
| 30 | fi
|
---|
[20] | 31 | fi
|
---|
[318] | 32 |
|
---|
[543] | 33 |
|
---|
[547] | 34 | cd ${BASE}/svn
|
---|
| 35 |
|
---|
| 36 | for 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 ..
|
---|
[545] | 57 | fi
|
---|
[547] | 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
|
---|
[545] | 67 | fi
|
---|
[547] | 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
|
---|
[544] | 77 |
|
---|
[547] | 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
|
---|
| 82 | done
|
---|