]> git.bzium.org/ - embe/overlay.git/blobdiff - dev-util/adobe-air-sdk-bin/files/airstart
Nowy pakiet: dev-util/adobe-air-sdk-bin-2.6
[embe/overlay.git] / dev-util / adobe-air-sdk-bin / files / airstart
diff --git a/dev-util/adobe-air-sdk-bin/files/airstart b/dev-util/adobe-air-sdk-bin/files/airstart
new file mode 100644 (file)
index 0000000..db76d6c
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+synopsis() {
+       echo "Synopsis: $0 appl.air" >&2
+       exit 1
+}
+
+[ -z "$1" ] && synopsis
+
+tmpdir="$(mktemp -d /tmp/adobeair.XXXXXXXXXX)"
+
+cleanup() {
+       rm -rf "${tmpdir}"
+}
+
+runair() {
+       if [ ! -f "$1" ]; then
+               echo 'Specified application file not found:' "$1" >&2
+               cleanup
+               synopsis
+               return 1
+       fi
+
+       if ! unzip -q "$1" -d "${tmpdir}"; then
+               echo 'Unable to extract AIR application:' "$1" >&2
+               return 1
+       fi
+
+       /opt/bin/adl -nodebug "${tmpdir}"/META-INF/AIR/application.xml "${tmpdir}"
+}
+
+trap cleanup HUP INT QUIT TERM
+runair "$1"
+cleanup