b9a7b6787538f34307c2e979a233b5cbee750e99
[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 | debian"
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 debian="debian-8.4.0"
18 fedora="fedora-23"
19 leap="leap-42.1"
20 mint="mint-14.04.1"
21 suse="opensuse-13.2"
22 ub14="ub14.04.1"
23 ub15="ub15.10"
24 ubuntu="ubuntu-14.04.1"
25
26 eval os="\${$dir}"
27 if [ -z "$os" ]; then
28   echo "unknown os: $dir"
29 fi
30
31 if [ ! -d "$path/$dir/$bld/$proj/$base" ]; then
32   echo "missing $bld/$proj/$base in $path/$dir"
33   exit 1
34 fi
35
36 typ=$2
37 sfx=`uname -m`-`date +"%Y%m%d"`
38 if [ "$typ" = "static" ]; then
39   sfx="$sfx-static"
40 elif [ "$typ" != "dynamic" ]; then
41   echo "err: suffix must be [static | dynamic]"
42   exit 1
43 fi
44
45 cd "$path/$dir/$bld/$proj/$base"
46 tar -C bin -cJf "../$base-$os-$sfx.txz" .
47 rm -f "$path/$dir/$base-$os-$sfx.txz"
48 mv "../$base-$os-$sfx.txz" "$path/$dir/."
49