source: SH_SHM/trunk/setup/makerelease.sh @ 347

Revision 347, 1.8 KB checked in by marcus, 12 years ago (diff)

r186 | walther | 2011-03-10 16:10:48 +0100 (Do, 10 Mär 2011) | 1 line

Allow checkout from any subversion path.

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3# Script for building a Seismic Handler release from subversion repository.
4# Main tasks:
5#   1. svn export into temporary directory
6#   2. remove all unwanted files from export
7#   3. build compressed tar file
8#   4. create self-executing installation script
9#
10
11LANG=C
12SRC=$1
13[ "$SRC" == "" ] && SRC="trunk"
14URI="https://www.seismic-handler.org/svn/SH_SHM/${SRC}/"
15
16function setup {
17    TMPDIR=`mktemp -d /tmp/release.XXXXXX`
18    echo "0. Temp directory: $TMPDIR"
19    #TMPDIR=/tmp/release.b26070/
20}
21
22function cleanup {
23    rm -rf $TMPDIR
24    echo "Done. Temp directory removed."
25}
26
27function exportsource {
28    echo "1. Exporting source from subversion server..."
29    svn --force --quiet export $URI $TMPDIR
30    rev=`svn info $URI | awk -F": " '$1=="Last Changed Rev" {print $2}'`
31}
32
33function update {
34    echo "2. Updating source tree..."
35
36    delinput="shm-config.txt LocalStatinf.dat LocalSensitivities.dat \
37              LocalFilterLookup.dat"
38
39    rm $TMPDIR/setup/shsetup
40    for i in $delinput ; do rm $TMPDIR/inputs/$i ; done
41
42    mv $TMPDIR/inputs/STATINF.DAT $TMPDIR/inputs/STATINF.DAT.dist
43    mv $TMPDIR/inputs/sensitivities.txt $TMPDIR/inputs/sensitivities.txt.dist
44    mv $TMPDIR/inputs/filter_lookup.txt $TMPDIR/inputs/filter_lookup.txt.dist
45    mv $TMPDIR/inputs/chantrans.txt $TMPDIR/inputs/chantrans.txt.dist
46    echo $rev > $TMPDIR/setup/revision
47}
48
49function compress {
50    echo "3. Building tar archive..."
51    cd $TMPDIR
52    tar czf SHM.tar.gz *
53    cd $OLDPWD
54}
55
56function joinarchive {
57    echo "4. Creating self-extracting executable..."
58    cat decompress.sh > /tmp/SHM-install.sh
59    base64 $TMPDIR/SHM.tar.gz >> /tmp/SHM-install.sh
60    chmod 755 /tmp/SHM-install.sh
61}
62
63function main {
64    setup
65    exportsource
66    update
67    compress
68    joinarchive
69    cleanup
70}
71
72main
Note: See TracBrowser for help on using the repository browser.