summaryrefslogtreecommitdiff
path: root/binary/pack
blob: 57cce4e013498acf1c741a7c92c61455f2820848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /usr/bin/env bash

# Pack ODB compiler sources and build scripts for building and testing a
# binary.
#
# Usage: pack <platform>
#
# <platforms> is one of: linux-gnu, darwin, solaris
#
#
trap 'exit 1' ERR

function error ()
{
  echo "$*" 1>&2
}

if [ "$1" = "" ]; then
  error "Usage: $0 platform"
  exit 1
fi

platform=$1

src=/tmp

cver=`echo $src/libcutl-?.*.tar.gz | sed -e "s%$src/libcutl-\(.*\).tar.gz%\1%"`
over=`echo $src/pack/odb-?.*.tar.gz | sed -e "s%$src/pack/odb-\(.*\).tar.gz%\1%"`
mver=`echo $over | sed -e 's%\([0-9]*\.[0-9]*\).*%\1%'`

out=/tmp/pack-$platform-$over

# Clean everything up.
#
rm -rf $out
mkdir -p $out

# Copy scripts.
#
cp -rL $platform/* $out/

# Copy sources for binary build.
#
cp $src/libcutl-$cver.tar.gz $out/
cp $src/pack/odb-$over.tar.gz $out/
cp $src/pack/libodb-$mver.*.tar.gz $out/
cp $src/pack/libodb-boost-$mver.*.tar.gz $out/
cp $src/pack/libodb-qt-$mver.*.tar.gz $out/

# Copy sources for testing.
#
cp $src/pack/lib*-$mver.*.tar.bz2 $out/test/
cp $src/pack/odb-examples-$mver.*.tar.bz2 $out/test/
cp $src/pack/odb-tests-$mver.*.tar.bz2 $out/test/
cp ./build-test $out/test/