Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / bld_scripts / bld_package.sh
1 #!/bin/bash
2
3 if [ $# -ne 2 ]; then
4   echo "usage: $0 <os> <typ>"
5   echo "  os = centos | ubuntu | suse"
6   echo " typ = static | dynamic"
7   exit 1
8 fi
9
10 dir="$1"
11 path="/home"
12 bld="git-repo"
13 proj="cinelerra5"
14 base="cinelerra-5.1"
15
16 centos="centos-7.0-1406"
17 suse="opensuse-13.2"
18 ubuntu="ubuntu-14.04.1"
19
20 eval os="\${$dir}"
21 if [ -z "$os" ]; then
22   echo "unknown os: $dir"
23 fi
24
25 if [ ! -d "$path/$dir/$bld/$proj/$base" ]; then
26   echo "missing $bld/$proj/$base in $path/$dir"
27   exit 1
28 fi
29
30 typ=$2
31 sfx=`uname -m`-`date +"%Y%m%d"`
32 if [ "$typ" = "static" ]; then
33   sfx="$sfx-static"
34 elif [ "$typ" != "dynamic" ]; then
35   echo "err: suffix must be [static | dynamic]"
36   exit 1
37 fi
38
39 cd "$path/$dir/$bld/$proj/$base"
40 tar -C bin -cJf "../$base-$os-$sfx.txz" .
41 rm -f "$path/$dir/$base-$os-$sfx.txz"
42 mv "../$base-$os-$sfx.txz" "$path/$dir/."
43