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
diff --git a/cinelerra-5.1/bld_scripts/bld_package.sh b/cinelerra-5.1/bld_scripts/bld_package.sh
new file mode 100755 (executable)
index 0000000..ff715bf
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+if [ $# -ne 2 ]; then
+  echo "usage: $0 <os> <typ>"
+  echo "  os = centos | ubuntu | suse"
+  echo " typ = static | dynamic"
+  exit 1
+fi
+
+dir="$1"
+path="/home"
+bld="git-repo"
+proj="cinelerra5"
+base="cinelerra-5.1"
+
+centos="centos-7.0-1406"
+suse="opensuse-13.2"
+ubuntu="ubuntu-14.04.1"
+
+eval os="\${$dir}"
+if [ -z "$os" ]; then
+  echo "unknown os: $dir"
+fi
+
+if [ ! -d "$path/$dir/$bld/$proj/$base" ]; then
+  echo "missing $bld/$proj/$base in $path/$dir"
+  exit 1
+fi
+
+typ=$2
+sfx=`uname -m`-`date +"%Y%m%d"`
+if [ "$typ" = "static" ]; then
+  sfx="$sfx-static"
+elif [ "$typ" != "dynamic" ]; then
+  echo "err: suffix must be [static | dynamic]"
+  exit 1
+fi
+
+cd "$path/$dir/$bld/$proj/$base"
+tar -C bin -cJf "../$base-$os-$sfx.txz" .
+rm -f "$path/$dir/$base-$os-$sfx.txz"
+mv "../$base-$os-$sfx.txz" "$path/$dir/."
+