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

Revision 504, 1.8 KB checked in by marcus, 11 years ago (diff)

r266 | walther | 2011-12-01 15:41:20 +0100 (Do, 01. Dez 2011) | 2 Zeilen

  • file doesn't exist in trunk
  • 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    for i in $delinput ; do rm $TMPDIR/inputs/$i ; done
40
41    mv $TMPDIR/inputs/STATINF.DAT $TMPDIR/inputs/STATINF.DAT.dist
42    mv $TMPDIR/inputs/sensitivities.txt $TMPDIR/inputs/sensitivities.txt.dist
43    mv $TMPDIR/inputs/filter_lookup.txt $TMPDIR/inputs/filter_lookup.txt.dist
44    mv $TMPDIR/inputs/chantrans.txt $TMPDIR/inputs/chantrans.txt.dist
45    echo $rev > $TMPDIR/setup/revision
46}
47
48function compress {
49    echo "3. Building tar archive..."
50    cd $TMPDIR
51    tar czf SHM.tar.gz *
52    cd $OLDPWD
53}
54
55function joinarchive {
56    echo "4. Creating self-extracting executable..."
57    cat $TMPDIR/setup/decompress.sh > /tmp/SHM-install.sh
58    base64 $TMPDIR/SHM.tar.gz >> /tmp/SHM-install.sh
59    chmod 755 /tmp/SHM-install.sh
60}
61
62function main {
63    setup
64    exportsource
65    update
66    compress
67    joinarchive
68    cleanup
69}
70
71main
Note: See TracBrowser for help on using the repository browser.