aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-07-29 00:17:54 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-07-29 00:28:10 +0200
commit142ce5e987d177a180fcedc26ce2e11c039349f4 (patch)
tree83a6028267ba6fda31fb606aae2ecb121fcaa0bc /testing
parent7004919ed9970e5b3c93f370dbba9104ca5d6ba4 (diff)
downloadaports-142ce5e987d177a180fcedc26ce2e11c039349f4.tar.bz2
aports-142ce5e987d177a180fcedc26ce2e11c039349f4.tar.xz
testing/novnc: improve abuild and fix launch script
Diffstat (limited to 'testing')
-rw-r--r--testing/novnc/APKBUILD38
-rw-r--r--testing/novnc/alpine-specific-launch.js.patch51
2 files changed, 71 insertions, 18 deletions
diff --git a/testing/novnc/APKBUILD b/testing/novnc/APKBUILD
index c952fb82a3..a17168d2fb 100644
--- a/testing/novnc/APKBUILD
+++ b/testing/novnc/APKBUILD
@@ -16,23 +16,29 @@ builddir="$srcdir/$_pkgname-$pkgver"
options="!check"
package() {
- mkdir -p "$pkgdir"/usr/share/novnc
- cp -r "$builddir"/* "$pkgdir"/usr/share/novnc
- # Clean up package
- rm "$pkgdir"/usr/share/novnc/CONTRIBUTING.md
- rm "$pkgdir"/usr/share/novnc/utils/README.md
- # Move license files
- mkdir -p "$pkgdir"/usr/share/licenses/novnc
- mv "$pkgdir"/usr/share/novnc/LICENSE.txt "$pkgdir"/usr/share/licenses/novnc
- mv "$pkgdir"/usr/share/novnc/docs/LICENSE.* "$pkgdir"/usr/share/licenses/novnc
- # Move documentation
+ mkdir -p "$pkgdir"/usr/share/$pkgname
+ cd "$pkgdir"/usr/share/$pkgname
+
+ cp -r "$builddir"/* .
+
+ # Clean up package.
+ rm CONTRIBUTING.md utils/README.md
+
+ # Move license files.
+ mkdir -p "$pkgdir"/usr/share/licenses/$pkgname
+ mv LICENSE.txt docs/LICENSE.* "$pkgdir"/usr/share/licenses/novnc/
+
+ # Move documentation.
mkdir -p "$pkgdir"/usr/share/doc
- mv "$pkgdir"/usr/share/novnc/docs "$pkgdir"/usr/share/doc/novnc
- mv "$pkgdir"/usr/share/novnc/README.md "$pkgdir"/usr/share/doc/novnc
- # Add launch.sh to /usr/bin
- mkdir -p "$pkgdir"/usr/bin
- ln -sf /usr/share/novnc/utils/launch.sh "$pkgdir"/usr/bin/novnc_server
+ mv docs "$pkgdir"/usr/share/doc/$pkgname
+ mv README.md "$pkgdir"/usr/share/doc/$pkgname/
+
+ # Install launch.sh to /usr/bin.
+ install -D -m 755 utils/launch.sh "$pkgdir"/usr/bin/novnc_server
+
+ # Remove irrelevant utils.
+ rm -r utils
}
sha512sums="245d205f8935c82722a55d6cfcd2cea1825176c0cd695fd0eec34aa19cdc3b766fed62e741ff41b0a8c4a3b3cbabc5a39dfa6ad8ffa6169f5b88420a4a845a7c novnc-0.6.2.tar.gz
-039abf940909767f93217832bb43dc3405613c9a0d0afa4f4d601c1c1d7459394e93fa9d8e5e880b8e65759e293c7da4cc586b73f2c981f50dcb6872093499bc alpine-specific-launch.js.patch"
+e3a444d8a8cbf742bc1299e229deb129bcb6045eef1aad20e8db066362db1da77a59130fdadfffffbc69a5cb4c5a929eb4d40382305dae5fc4ab5f09f9d9eef6 alpine-specific-launch.js.patch"
diff --git a/testing/novnc/alpine-specific-launch.js.patch b/testing/novnc/alpine-specific-launch.js.patch
index ca1c985188..0228469d04 100644
--- a/testing/novnc/alpine-specific-launch.js.patch
+++ b/testing/novnc/alpine-specific-launch.js.patch
@@ -6,8 +6,55 @@
# Copyright 2016 Joel Martin
# Copyright 2016 Solly Ross
-@@ -141,7 +141,7 @@
- ${WEBSOCKIFY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
+@@ -25,8 +25,8 @@
+ exit 2
+ }
+
+-NAME="$(basename $0)"
+-REAL_NAME="$(readlink -f $0)"
++NAME="$(basename "$0")"
++REAL_NAME="$(readlink -f "$0")"
+ HERE="$(cd "$(dirname "$REAL_NAME")" && pwd)"
+ PORT="6080"
+ VNC_DEST="localhost:5900"
+@@ -106,42 +106,11 @@
+ echo "Warning: could not find self.pem"
+ fi
+
+-# try to find websockify (prefer local, try global, then download local)
+-if [[ -e ${HERE}/websockify ]]; then
+- WEBSOCKIFY=${HERE}/websockify/run
+-
+- if [[ ! -x $WEBSOCKIFY ]]; then
+- echo "The path ${HERE}/websockify exists, but $WEBSOCKIFY either does not exist or is not executable."
+- echo "If you intended to use an installed websockify package, please remove ${HERE}/websockify."
+- exit 1
+- fi
+-
+- echo "Using local websockify at $WEBSOCKIFY"
+-else
+- WEBSOCKIFY=$(which websockify 2>/dev/null)
+-
+- if [[ $? -ne 0 ]]; then
+- echo "No installed websockify, attempting to clone websockify..."
+- WEBSOCKIFY=${HERE}/websockify/run
+- git clone https://github.com/kanaka/websockify ${HERE}/websockify
+-
+- if [[ ! -e $WEBSOCKIFY ]]; then
+- echo "Unable to locate ${HERE}/websockify/run after downloading"
+- exit 1
+- fi
+-
+- echo "Using local websockify at $WEBSOCKIFY"
+- else
+- echo "Using installed websockify at $WEBSOCKIFY"
+- fi
+-fi
+-
+ echo "Starting webserver and WebSockets proxy on port ${PORT}"
+-#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
+-${WEBSOCKIFY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
++websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
proxy_pid="$!"
sleep 1
-if ! ps -p ${proxy_pid} >/dev/null; then