summaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rwxr-xr-xextra/source/brltty/brltty.SlackBuild5
-rw-r--r--extra/source/tigervnc/doinst.sh31
-rw-r--r--extra/source/tigervnc/patches/tigervnc.pam.d.diff15
-rw-r--r--extra/source/tigervnc/patches/tigervnc.xorg-server-1.20.7.diff18
-rw-r--r--extra/source/tigervnc/patches/tigervnc13_link_png.patch12
-rw-r--r--extra/source/tigervnc/patches/vncserver.no.rfbwait.diff11
-rw-r--r--extra/source/tigervnc/patches/xorg-server/06_use-intel-only-on-pre-gen4.diff30
-rw-r--r--extra/source/tigervnc/patches/xorg-server/fix-pci-segfault.diff12
-rwxr-xr-xextra/source/tigervnc/tigervnc.SlackBuild443
-rw-r--r--extra/source/tigervnc/vncserver898
-rw-r--r--extra/source/tigervnc/vncserver.1204
11 files changed, 1352 insertions, 327 deletions
diff --git a/extra/source/brltty/brltty.SlackBuild b/extra/source/brltty/brltty.SlackBuild
index df20dd56e..4e3a7d405 100755
--- a/extra/source/brltty/brltty.SlackBuild
+++ b/extra/source/brltty/brltty.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright 2010, 2012, 2013, 2016, 2017, 2018, 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2010, 2012, 2013, 2016, 2017, 2018, 2020, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -32,7 +32,7 @@ PKG=/tmp/package-brltty
PKGNAM=brltty
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -92,6 +92,7 @@ find . -perm 600 -exec chmod 644 {} \+
make $NUMJOBS || exit 1
make install INSTALL_ROOT=$PKG || exit 1
+make install TCL_DIR=/usr/lib${LIBDIRSUFFIX} INSTALL_ROOT=$PKG || exit 1
chmod 755 $PKG/bin/* $PKG/lib${LIBDIRSUFFIX}/brltty/*
# Add polkit configs:
diff --git a/extra/source/tigervnc/doinst.sh b/extra/source/tigervnc/doinst.sh
new file mode 100644
index 000000000..601c47cc0
--- /dev/null
+++ b/extra/source/tigervnc/doinst.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+config etc/X11/xorg.conf.d/10-libvnc.conf.new
+
+# Update the desktop database:
+if [ -x usr/bin/update-desktop-database ]; then
+ chroot . /usr/bin/update-desktop-database usr/share/applications 1>/dev/null 2>&1
+fi
+
+# Update the mime database:
+if [ -x usr/bin/update-mime-database ]; then
+ chroot . /usr/bin/update-mime-database usr/share/mime 1>/dev/null 2>&1
+fi
+
+# Update hicolor theme cache:
+if [ -d usr/share/icons/hicolor ]; then
+ if [ -x usr/bin/gtk-update-icon-cache ]; then
+ chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null
+ fi
+fi
+
diff --git a/extra/source/tigervnc/patches/tigervnc.pam.d.diff b/extra/source/tigervnc/patches/tigervnc.pam.d.diff
new file mode 100644
index 000000000..775820b06
--- /dev/null
+++ b/extra/source/tigervnc/patches/tigervnc.pam.d.diff
@@ -0,0 +1,15 @@
+--- ./unix/vncserver/tigervnc.pam.orig 2021-11-09 01:51:28.000000000 -0600
++++ ./unix/vncserver/tigervnc.pam 2021-11-15 14:58:09.273033740 -0600
+@@ -1,11 +1,8 @@
+ #%PAM-1.0
+-# pam_selinux.so close should be the first session rule
+--session required pam_selinux.so close
+ session required pam_loginuid.so
+ -session required pam_selinux.so open
+ session required pam_namespace.so
+ session optional pam_keyinit.so force revoke
+ session required pam_limits.so
+--session optional pam_systemd.so
++session optional pam_elogind.so
+ session required pam_unix.so
+--session optional pam_reauthorize.so prepare
diff --git a/extra/source/tigervnc/patches/tigervnc.xorg-server-1.20.7.diff b/extra/source/tigervnc/patches/tigervnc.xorg-server-1.20.7.diff
deleted file mode 100644
index 4eff6b66b..000000000
--- a/extra/source/tigervnc/patches/tigervnc.xorg-server-1.20.7.diff
+++ /dev/null
@@ -1,18 +0,0 @@
---- ./unix/xserver/hw/vnc/xvnc.c.orig 2019-12-20 01:02:02.000000000 -0600
-+++ ./unix/xserver/hw/vnc/xvnc.c 2020-02-09 16:48:59.587362042 -0600
-@@ -295,6 +295,15 @@
- }
- #endif
-
-+#if INPUTTHREAD
-+/** This function is called in Xserver/os/inputthread.c when starting
-+ the input thread. */
-+void
-+ddxInputThreadInit(void)
-+{
-+}
-+#endif
-+
- void ddxUseMsg(void)
- {
- vncPrintBanner();
diff --git a/extra/source/tigervnc/patches/tigervnc13_link_png.patch b/extra/source/tigervnc/patches/tigervnc13_link_png.patch
deleted file mode 100644
index e5f3374aa..000000000
--- a/extra/source/tigervnc/patches/tigervnc13_link_png.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 4689566..e3475f7 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -265,6 +265,7 @@ if(UNIX AND NOT APPLE)
- if(X11_Xcursor_FOUND)
- set(FLTK_LIBRARIES ${FLTK_LIBRARIES} ${X11_Xcursor_LIB})
- endif()
-+ set(FLTK_LIBRARIES ${FLTK_LIBRARIES} png)
- endif()
-
- if(FLTK_FOUND)
diff --git a/extra/source/tigervnc/patches/vncserver.no.rfbwait.diff b/extra/source/tigervnc/patches/vncserver.no.rfbwait.diff
new file mode 100644
index 000000000..c3b0bf23b
--- /dev/null
+++ b/extra/source/tigervnc/patches/vncserver.no.rfbwait.diff
@@ -0,0 +1,11 @@
+--- ./vncserver.orig 2019-12-20 01:02:02.000000000 -0600
++++ ./vncserver 2021-11-15 15:52:29.648106674 -0600
+@@ -205,7 +205,7 @@
+ $default_opts{geometry} = $geometry if ($geometry);
+ $default_opts{depth} = $depth if ($depth);
+ $default_opts{pixelformat} = $pixelformat if ($pixelformat);
+-$default_opts{rfbwait} = 30000;
++#$default_opts{rfbwait} = 30000;
+ $default_opts{rfbauth} = "$vncUserDir/passwd";
+ $default_opts{rfbport} = $vncPort;
+ $default_opts{fp} = $fontPath if ($fontPath);
diff --git a/extra/source/tigervnc/patches/xorg-server/06_use-intel-only-on-pre-gen4.diff b/extra/source/tigervnc/patches/xorg-server/06_use-intel-only-on-pre-gen4.diff
new file mode 100644
index 000000000..4994492f6
--- /dev/null
+++ b/extra/source/tigervnc/patches/xorg-server/06_use-intel-only-on-pre-gen4.diff
@@ -0,0 +1,30 @@
+Description: Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting
+Author: Timo Aaltonen <tjaalton@debian.org>
+
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -1173,7 +1173,23 @@ xf86VideoPtrToDriverList(struct pci_devi
+ case 0x0bef:
+ /* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+ break;
+- default:
++ /* Default to intel only on pre-gen4 chips */
++ case 0x3577:
++ case 0x2562:
++ case 0x3582:
++ case 0x358e:
++ case 0x2572:
++ case 0x2582:
++ case 0x258a:
++ case 0x2592:
++ case 0x2772:
++ case 0x27a2:
++ case 0x27ae:
++ case 0x29b2:
++ case 0x29c2:
++ case 0x29d2:
++ case 0xa001:
++ case 0xa011:
+ driverList[0] = "intel";
+ break;
+ }
diff --git a/extra/source/tigervnc/patches/xorg-server/fix-pci-segfault.diff b/extra/source/tigervnc/patches/xorg-server/fix-pci-segfault.diff
new file mode 100644
index 000000000..400376287
--- /dev/null
+++ b/extra/source/tigervnc/patches/xorg-server/fix-pci-segfault.diff
@@ -0,0 +1,12 @@
+diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
+index cef47da03d0e91e6a56a5e3cb14a51d931633eff..dadbac6c8f0ae6f3d636fdfe245e61bc0c98581d 100644
+--- a/hw/xfree86/common/xf86platformBus.c
++++ b/hw/xfree86/common/xf86platformBus.c
+@@ -289,7 +289,7 @@ xf86platformProbe(void)
+ for (i = 0; i < xf86_num_platform_devices; i++) {
+ char *busid = xf86_platform_odev_attributes(i)->busid;
+
+- if (pci && (strncmp(busid, "pci:", 4) == 0)) {
++ if (pci && busid && (strncmp(busid, "pci:", 4) == 0)) {
+ platform_find_pci_info(&xf86_platform_devices[i], busid);
+ }
diff --git a/extra/source/tigervnc/tigervnc.SlackBuild b/extra/source/tigervnc/tigervnc.SlackBuild
index 75b10bd6b..26b6c6158 100755
--- a/extra/source/tigervnc/tigervnc.SlackBuild
+++ b/extra/source/tigervnc/tigervnc.SlackBuild
@@ -1,187 +1,117 @@
#!/bin/bash
-# $Id: tigervnc.SlackBuild,v 1.25 2015/08/26 18:24:43 root Exp root $
+
# Copyright 2010, 2011, 2012, 2013, 2014, 2015 Eric Hameleers, Eindhoven. NL
-# Copyright 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2015, 2016, 2020, 2021 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
-# Permission to use, copy, modify, and distribute this software for
-# any purpose with or without fee is hereby granted, provided that
-# the above copyright notice and this permission notice appear in all
-# copies.
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
#
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-# -----------------------------------------------------------------------------
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
#
-# Slackware SlackBuild script
-# ===========================
-# By: Eric Hameleers <alien@slackware.com>
-# For: tigervnc
-# Descr: VNC server and client
-# URL: http://tigervnc.org/
-# Needs:
-# BuildNeeds: jdk (only when building the java applet)
-# Changelog:
-# r4126-1: 31/Aug/2010 by Eric Hameleers <alien@slackware.com>
-# * Initial build.
-# r4126-2: 02/sep/2010 by Eric Hameleers <alien@slackware.com>
-# * Fix a syntax error in thye doinst.sh script
-# 1.0.90-1: 14/may/2011 by Eric Hameleers <alien@slackware.com>
-# * Update to 1.1.beta1
-# 1.1.0-1: 14/nov/2011 by Eric Hameleers <alien@slackware.com>
-# * Update to 1.1.0
-# 1.2.0-1: 23/jun/2012 by Eric Hameleers <alien@slackware.com>
-# * Update.
-# 1.1.0-2: 28/jul/2012 by Eric Hameleers <alien@slackware.com>
-# * Build 1.1.0 again, using a revised script which can be used
-# on Slackware 14 as well. Also, enable compositing in the
-# server. Abandon the tigervnc-1.2 branch for now, because
-# the fltk based viewer rewrite is not yet fully functional.
-# 1.1.0-3: 22/may/2013 by Eric Hameleers <alien@slackware.com>
-# * Build 1.1.0 again, on slackware-current (nee 14.1) with new
-# X.Org 1.13 patches.
-# 1.1.0-4: 11/oct/2013 by Eric Hameleers <alien@slackware.com>
-# * Build 1.1.0 again, on slackware-current (nee 14.1) with new
-# X.Org 1.14 patches.
-# 1.3.0-1: 12/dec/2013 by Eric Hameleers <alien@slackware.com>
-# * Update. All my issues except copy/paste from local to remote
-# seem to have been addressed in 1.3.0.
-# Build against private versions of libjpeg-turbo and fltk,
-# in order to eliminate external dependencies.
-# 1.4.3-1: 11/apr/2015 by Eric Hameleers <alien@slackware.com>
-# * Update.
-# 1.4.3-2: 03/may/2015 by Eric Hameleers <alien@slackware.com>
-# * Rebuild for slackware-current (fix libgcrypt.so library error)
-# 1.5.0-1: 14/jul/2015 by Eric Hameleers <alien@slackware.com>
-# * Update.
-# 1.5.0-2: 24/aug/2015 by Eric Hameleers <alien@slackware.com>
-# * Rebuild was needed on slackware-current.
-# 1.5.0-3: 26/aug/2015 by Eric Hameleers <alien@slackware.com>
-# * I uploaded the wrong package so I needed to update the BUILD.
-# 1.5.0-1: 07/nov/2015 by Patrick Volkerding <volkerdi@slackware.com>
-# * Removed bundled FLTK and libjpeg-turbo builds.
-# * Reset build to -1 for inclusion in Slackware's /extra.
-# 1.6.0-1: 22/feb/2016 by Patrick Volkerding <volkerdi@slackware.com>
-# 1.9.0-1: 26/jul/2018 by Patrick Volkerding <volkerdi@slackware.com>
-# 1.10.0-1: 18/nov/2019 by Patrick Volkerding <volkerdi@slackware.com>
-# 1.10.0-2: 18/nov/2019 by Patrick Volkerding <volkerdi@slackware.com>
-# Rebuilt for new xorg-server.
-# 1.10.1-1: 20/dec/2019 by Patrick Volkerding <volkerdi@slackware.com>
-# 1.10.1-2: 09/feb/2020 by Patrick Volkerding <volkerdi@slackware.com>
-# Removed redundant .desktop file. Thanks to upnort.
-# Patched for latest xorg-server.
-#
-# -----------------------------------------------------------------------------
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=tigervnc
-VERSION=${VERSION:-1.10.1}
-PVER=$(echo $VERSION | cut -f 1,2 -d . | tr -d .)
-BUILD=${BUILD:-3}
-NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
-TAG=${TAG:-}
-
-# TigerVNC needs to use source of the X.Org server whose version matches
-# that of your installed X.Org package:
-XORG=${XORG:-$(X -version 2>&1 | grep "^X.Org X Server " | cut -f4 -d' ')}
-MAXPATCHVER="$(echo $XORG | cut -f1,2 -d. | tr -d '.')"
-
-# OS Stamp into the binaries:
-OSNAME="$(head -1 /etc/slackware-version)"
-OSVENDOR="Slackware Linux Project"
-BUILDER="Built by Slackware on $(date -u)"
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+XORGVER=${XORGVER:-$(echo xorg-server-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
# Do we build the java applet (needs jdk)?
-DO_APPLET=${DO_APPLET:-"NO"}
-
-# Check for the availability of a Java compiler:
-if [ "$DO_APPLET" = "YES" ]; then
- if ! javac -version 1>/dev/null 2>&1 ; then
- echo "**"
- echo "** DO_APPLET="YES" means to compile the Java viewer,"
- echo "** However you do not have a Java JDK installed."
- echo "** Press Ctrl-C to abort this script,"
- echo "** or wait 10 seconds to continue without building the Java viewer."
- echo "**"
- sleep 10
- DO_APPLET="NO"
- fi
+JAVA_APPLET=${JAVA_APPLET:-"OFF"}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
fi
-# This covers most filenames you'd want as documentation. Change if needed.
-DOCS="BUILDING.txt LICENCE.TXT README.txt doc/TODO doc/*.txt doc/*.odt"
-DOCS_XORG="COPYING ChangeLog"
-
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-$PKGNAM
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
-if [ -e $CWD/machine.conf ]; then
- . $CWD/machine.conf ]
-elif [ -e /etc/slackbuild/machine.conf ]; then
- . /etc/slackbuild/machine.conf ]
+NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
else
- # Automatically determine the architecture we're building on:
- MARCH=$( uname -m )
- if [ -z "$ARCH" ]; then
- case "$MARCH" in
- i?86) export ARCH=i586 ;;
- arm*) export ARCH=arm ;;
- # Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$MARCH ;;
- esac
- fi
- # Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
- if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
- elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
- elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
- elif [ "$ARCH" = "arm" ]; then
- SLKCFLAGS="-O2 -march=armv5te"
- LIBDIRSUFFIX=""
- else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
- fi
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+export CFLAGS="$SLKCFLAGS"
+export CXXFLAGS="$SLKCFLAGS"
-case "$ARCH" in
- arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
- *) TARGET=$ARCH-slackware-linux ;;
-esac
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
-rm -rf $TMP/tmp-${PKGNAM} $PKG
-mkdir -p $TMP/tmp-${PKGNAM}/deps/usr $PKG
-cd $TMP/tmp-${PKGNAM}
-tar --owner=root --group=root -xvf $CWD/sources/$PKGNAM-$VERSION.tar.?z* || exit 1
-tar --owner=root --group=root -xvf $CWD/sources/xorg-server-${XORG}.tar.?z* || exit 1
+rm -rf $PKG
+mkdir -p $TMP $PKG
-### BEGIN PATCHES FROM source/x/x11/patch
-( cd xorg-server-${XORG}
- zcat $CWD/patches/xorg-server/x11.startwithblackscreen.diff.gz | patch -p1 --verbose || exit 1
- zcat $CWD/patches/xorg-server/xorg-server.combo.mouse.keyboard.layout.patch.gz | patch -p1 --verbose || exit 1
- zcat $CWD/patches/xorg-server/fix-nouveau-segfault.diff.gz | patch -p1 --verbose || exit 1
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
+# Extract the X server sources:
+tar xvf $CWD/xorg-server-$XORGVER.tar.?z --strip-components=1 -C unix/xserver || exit 1
+# Patch the X server sources:
+( cd unix/xserver
+ zcat $CWD/patches/xserver120.patch.gz | patch -p1 --verbose || exit 1
zcat $CWD/patches/xorg-server/0001-Always-install-vbe-and-int10-sdk-headers.patch.gz | patch -p1 --verbose || exit 1
zcat $CWD/patches/xorg-server/0001-autobind-GPUs-to-the-screen.patch.gz | patch -p1 --verbose || exit 1
zcat $CWD/patches/xorg-server/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch.gz | patch -p1 --verbose || exit 1
+ zcat $CWD/patches/xorg-server/06_use-intel-only-on-pre-gen4.diff.gz | patch -p1 --verbose || exit 1
+ zcat $CWD/patches/xorg-server/fix-nouveau-segfault.diff.gz | patch -p1 --verbose || exit 1
+ zcat $CWD/patches/xorg-server/fix-pci-segfault.diff.gz | patch -p1 --verbose || exit 1
+ zcat $CWD/patches/xorg-server/x11.startwithblackscreen.diff.gz | patch -p1 --verbose || exit 1
+ zcat $CWD/patches/xorg-server/xorg-server.combo.mouse.keyboard.layout.patch.gz | patch -p1 --verbose || exit 1
+ autoreconf -vif || exit 1
) || exit 1
-### END PATCHES FROM source/x/x11/patch
-# Make sure ownerships and permissions are sane:
+# HACK! Force protocol 3.3 for UVNCSC
+zcat $CWD/patches/force_protocol_3.3_for_UVNCSC.patch.gz | patch -p1 || exit 1
+
+# Fix pam.d file:
+zcat $CWD/patches/tigervnc.pam.d.diff.gz | patch -p1 --verbose || exit 1
+
+if [ "$JAVA_APPLET" = "ON" ]; then
+ # Explicitly put the java applet into a directory named 'tigervnc':
+ sed -i -e 's#/vnc/class#/tigervnc/class#'g $(grep -rl vnc/class .)
+ sed -i -e 's#DESTINATION vnc/class#DESTINATION share/tigervnc/class#'g $(grep -rl vnc/class .)
+fi
+
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -189,86 +119,32 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
-export LDFLAGS="$SLKLDFLAGS"
-export CXXFLAGS="$SLKCFLAGS"
-export CFLAGS="$SLKCFLAGS"
-
-
-cat <<EOT
-#
-# Compile tigervnc:
-#
-EOT
-
-cd $PKGNAM-$VERSION || exit 1
-
-# HACK! Force protocol 3.3 for UVNCSC
-zcat $CWD/patches/force_protocol_3.3_for_UVNCSC.patch.gz | patch -p1 || exit 1
-
-# Patch to support xorg-server 1.20.7:
-zcat $CWD/patches/tigervnc.xorg-server-1.20.7.diff.gz | patch -p1 --verbose || exit 1
-
-# Explicitly link against libpng to prevent linking errors:
-zcat $CWD/patches/tigervnc13_link_png.patch.gz | patch -p1 --verbose || exit 1
-
-[ "$DO_APPLET" = "YES" ] && CMAKE_JAVA="ON" || CMAKE_JAVA="OFF"
-# Explicitly put the java applet into a directory named 'tigervnc':
-sed -i -e 's#/vnc/class#/tigervnc/class#'g $(grep -rl vnc/class .)
-sed -i -e 's#DESTINATION vnc/class#DESTINATION share/tigervnc/class#'g $(grep -rl vnc/class .)
-
-export LDFLAGS="$SLKLDFLAGS -ldl -lpthread"
-export CXXFLAGS="$SLKCFLAGS -fpermissive -I $(pwd)/common"
-
-# Fix the man page and documentation installation:
-sed -e 's,set(MAN_DIR "${DATA_DIR}/man"),set(MAN_DIR "${MAN_INSTALL_DIR}"),' \
- -e 's,set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/,set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/,' \
- -i CMakeLists.txt
-
-echo -e "\n*** Building vnc client ***\n"
+# Build and install the VNC viewer:
cmake \
-G "Unix Makefiles" \
-Wno-dev \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DMAN_INSTALL_DIR=/usr/man \
-DSYSCONF_INSTALL_DIR=/etc \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DENABLE_PAM:BOOL=OFF \
- -DBUILD_JAVA:BOOL=${CMAKE_JAVA} \
+ -DENABLE_PAM:BOOL=ON \
+ -DINSTALL_SYSTEMD_UNITS=OFF \
+ -DBUILD_JAVA:BOOL=${JAVA_APPLET} \
.
make V=1 $NUMJOBS || make || exit 1
make DESTDIR=$PKG install || exit 1
-# Do we have a patch for X.Org which tigervnc does not have?
-if [ ! -f unix/xserver${MAXPATCHVER}.patch.gz -a -f $CWD/patches/xserver${MAXPATCHVER}.patch.gz ]
-then
- cp $CWD/patches/xserver${MAXPATCHVER}.patch.gz unix/
-fi
-
-# Prepare the Xvnc sources (we are building out-of-tree, in ./build directory):
-mkdir -p build/unix
-cp -R unix/xserver unix/xserver${MAXPATCHVER}.patch.gz build/unix/
-cp -R ../xorg-server-${XORG}/* build/unix/xserver/
-
-cd build/unix/xserver/
- # Patch the xorg-server source to include building vnc driver:
- zcat ../xserver${MAXPATCHVER}.patch.gz | patch -p1 --verbose
-
- echo -e "\n*** Building vnc server ***\n"
- autoreconf -vif
-
+# Build and install the VNC server:
+( cd unix/xserver
# Default font paths to be used by the X server
DEF_FONTPATH="/usr/share/fonts/local,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,/usr/share/fonts/misc,/usr/share/fonts/CID,/usr/share/fonts/75dpi/:unscaled,/usr/share/fonts/100dpi/:unscaled,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/cyrillic"
-
- CFLAGS="$CFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
- --mandir=/usr/man \
- --disable-dri --enable-dri2 --disable-dri3 \
+ --disable-dri --enable-dri2 --disable-dri3 \
--disable-static \
--disable-xorg --disable-xnest --disable-xvfb --disable-dmx \
--disable-xwin --disable-xephyr --disable-kdrive --disable-xwayland \
@@ -291,97 +167,74 @@ cd build/unix/xserver/
--disable-selective-werror \
--disable-unit-tests \
--without-dtrace \
- --with-os-name="$OSNAME" \
- --with-os-vendor="$OSVENDOR" \
- --with-builderstring="$BUILDER" \
+ --with-os-name="$(head -1 /etc/slackware-version)" \
+ --with-os-vendor="Slackware Linux Project" \
+ --with-builderstring="Built by Slackware for xorg-server-$XORGVER" \
--build=$TARGET || exit 1
-
- make V=1 TIGERVNC_SRCDIR="$TMP/tmp-${PKGNAM}/${PKGNAM}-${VERSION}" $NUMJOBS || exit 1
- make TIGERVNC_SRCDIR="$TMP/tmp-${PKGNAM}/${PKGNAM}-${VERSION}" -C hw/vnc \
+ make V=1 TIGERVNC_SRCDIR="$TMP/${PKGNAM}-${VERSION}" $NUMJOBS || exit 1
+ make TIGERVNC_SRCDIR="$TMP/${PKGNAM}-${VERSION}" -C hw/vnc \
DESTDIR=$PKG install || exit 1
-cd -
+) || exit 1
+
+# Relocate the man pages:
+mv $PKG/usr/share/man $PKG/usr
+
+# Remove installed docs (we'll install them later):
+rm -r $PKG/usr/share/doc
# Provide a sample configuration for the libvnc.so extension of X.Org,
# documentation is available inside the file:
mkdir -p $PKG/etc/X11/xorg.conf.d
install -m644 $CWD/10-libvnc.conf $PKG/etc/X11/xorg.conf.d/10-libvnc.conf.new
-# Install menu entry:
-mkdir -p $PKG/usr/share/{applications,icons/hicolor/{16x16,24x24,32x32,48x48}/apps}
+# Install icons:
+mkdir -p $PKG/usr/share/icons/hicolor/{16x16,24x24,32x32,48x48}/apps
for PSIZE in 16 24 32 48; do
install -m644 media/icons/tigervnc_${PSIZE}.png \
- $PKG/usr/share/icons/hicolor/${PSIZE}x${PSIZE}/apps/tigervnc.png
+ $PKG/usr/share/icons/hicolor/${PSIZE}x${PSIZE}/apps/tigervnc.png
done
-# Add this to the doinst.sh:
-! [ -d $PKG/install ] && mkdir -p $PKG/install
-cat <<EOT >> $PKG/install/doinst.sh
-# Handle the incoming configuration files:
-config() {
- for infile in \$1; do
- NEW="\$infile"
- OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`"
- # If there's no config file by that name, mv it over:
- if [ ! -r \$OLD ]; then
- mv \$NEW \$OLD
- elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then
- # toss the redundant copy
- rm \$NEW
- fi
- # Otherwise, we leave the .new copy for the admin to consider...
- done
-}
-
-config etc/X11/xorg.conf.d/10-libvnc.conf.new
-
-# Update the desktop database:
-if [ -x usr/bin/update-desktop-database ]; then
- chroot . /usr/bin/update-desktop-database usr/share/applications 1>/dev/null 2>&1
-fi
-
-# Update the mime database:
-if [ -x usr/bin/update-mime-database ]; then
- chroot . /usr/bin/update-mime-database usr/share/mime 1>/dev/null 2>&1
-fi
-
-# Update hicolor theme cache:
-if [ -d usr/share/icons/hicolor ]; then
- if [ -x usr/bin/gtk-update-icon-cache ]; then
- chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null
- fi
-fi
+# Remove bogus vncserver script and replace it with the last good one (from
+# tigervnc-1.11.0):
+rm $PKG/usr/libexec/vncserver
+rmdir $PKG/usr/libexec
+rm $PKG/usr/man/man8/vncserver.8
+cp -a $CWD/vncserver $PKG/usr/bin
+chown root:root $PKG/usr/bin/vncserver
+chmod 755 $PKG/usr/bin/vncserver
+cp -a $CWD/vncserver.1 $PKG/usr/man/man1/vncserver.1
+chown root:root $PKG/usr/man/man1/vncserver.1
+chmod 644 $PKG/usr/man/man1/vncserver.1
+
+# This option is not available in recent versions of tigervnc:
+( cd $PKG/usr/bin
+ zcat $CWD/patches/vncserver.no.rfbwait.diff.gz | patch -p1 --verbose || exit 1
+ rm -f vncserver.orig
+) || exit 1
-EOT
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
-# Add documentation:
-# First, remove files which were misplaced:
-rm -f $PKG/usr/doc/* 2> /dev/null
-cd $TMP/tmp-${PKGNAM}/${PKGNAM}-${VERSION}
-mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
-cp -a $DOCS $PKG/usr/doc/$PKGNAM-$VERSION || true
-for FIL in $(echo $DOCS_XORG); do cp -a build/unix/xserver/$FIL $PKG/usr/doc/$PKGNAM-$VERSION/${FIL}.xorg ; done || true
-#cat $CWD/$(basename $0) > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild
-chown -R root:root $PKG/usr/doc/$PKGNAM-$VERSION
-find $PKG/usr/doc -type f -exec chmod 644 {} \+
+# Strip binaries:
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
-# Compress the man page(s):
-if [ -d $PKG/usr/man ]; then
- find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \+
- for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-fi
+# Compress manual pages:
+find $PKG/usr/man -type f -exec gzip -9 {} \+
+for i in $( find $PKG/usr/man -type l ) ; do
+ ln -s $( readlink $i ).gz $i.gz
+ rm $i
+done
-# Strip binaries (if any):
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ BUILDING* LICENCE* README* doc/* \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a unix/xserver/COPYING $PKG/usr/doc/${PKGNAM}-$VERSION/COPYING.xorg-server
-# Add a package description:
mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
-if [ -f $CWD/doinst.sh.gz ]; then
- zcat $CWD/doinst.sh.gz >> $PKG/install/doinst.sh
-fi
-# Build the package:
cd $PKG
-/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}
-
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/extra/source/tigervnc/vncserver b/extra/source/tigervnc/vncserver
new file mode 100644
index 000000000..68be032d1
--- /dev/null
+++ b/extra/source/tigervnc/vncserver
@@ -0,0 +1,898 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2009-2010 D. R. Commander. All Rights Reserved.
+# Copyright (C) 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
+# Copyright (C) 2002-2003 Constantin Kaplinsky. All Rights Reserved.
+# Copyright (C) 2002-2005 RealVNC Ltd.
+# Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+#
+# This is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this software; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+# USA.
+#
+
+#
+# vncserver - wrapper script to start an X VNC server.
+#
+
+# First make sure we're operating in a sane environment.
+$exedir = "";
+$slashndx = rindex($0, "/");
+if($slashndx>=0) {
+ $exedir = substr($0, 0, $slashndx+1);
+}
+
+&SanityCheck();
+
+#
+# Global variables. You may want to configure some of these for
+# your site
+#
+
+$geometry = "1024x768";
+#$depth = 16;
+
+$vncUserDir = "$ENV{HOME}/.vnc";
+$vncUserConfig = "$vncUserDir/config";
+
+$vncSystemConfigDir = "/etc/tigervnc";
+$vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults";
+$vncSystemConfigMandatoryFile = "$vncSystemConfigDir/vncserver-config-mandatory";
+
+$skipxstartup = 0;
+$xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority";
+
+$xstartupFile = $vncUserDir . "/xstartup";
+$defaultXStartup
+ = ("#!/bin/sh\n\n".
+ "unset SESSION_MANAGER\n".
+ "unset DBUS_SESSION_BUS_ADDRESS\n".
+ "OS=`uname -s`\n".
+ "if [ \$OS = 'Linux' ]; then\n".
+ " case \"\$WINDOWMANAGER\" in\n".
+ " \*gnome\*)\n".
+ " if [ -e /etc/SuSE-release ]; then\n".
+ " PATH=\$PATH:/opt/gnome/bin\n".
+ " export PATH\n".
+ " fi\n".
+ " ;;\n".
+ " esac\n".
+ "fi\n".
+ "if [ -x /etc/X11/xinit/xinitrc ]; then\n".
+ " exec /etc/X11/xinit/xinitrc\n".
+ "fi\n".
+ "if [ -f /etc/X11/xinit/xinitrc ]; then\n".
+ " exec sh /etc/X11/xinit/xinitrc\n".
+ "fi\n".
+ "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n".
+ "xsetroot -solid grey\n".
+ "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
+ "twm &\n");
+
+$defaultConfig
+ = ("## Supported server options to pass to vncserver upon invocation can be listed\n".
+ "## in this file. See the following manpages for more: vncserver(1) Xvnc(1).\n".
+ "## Several common ones are shown below. Uncomment and modify to your liking.\n".
+ "##\n".
+ "# securitytypes=vncauth,tlsvnc\n".
+ "# desktop=sandbox\n".
+ "# geometry=2000x1200\n".
+ "# localhost\n".
+ "# alwaysshared\n");
+
+chop($host = `uname -n`);
+
+if (-d "/etc/X11/fontpath.d") {
+ $fontPath = "catalogue:/etc/X11/fontpath.d";
+}
+
+@fontpaths = ('/usr/share/X11/fonts', '/usr/share/fonts', '/usr/share/fonts/X11/');
+if (! -l "/usr/lib/X11") {push(@fontpaths, '/usr/lib/X11/fonts');}
+if (! -l "/usr/X11") {push(@fontpaths, '/usr/X11/lib/X11/fonts');}
+if (! -l "/usr/X11R6") {push(@fontpaths, '/usr/X11R6/lib/X11/fonts');}
+push(@fontpaths, '/usr/share/fonts/default');
+
+@fonttypes = ('misc',
+ '75dpi',
+ '100dpi',
+ 'Speedo',
+ 'Type1');
+
+foreach $_fpath (@fontpaths) {
+ foreach $_ftype (@fonttypes) {
+ if (-f "$_fpath/$_ftype/fonts.dir") {
+ if (! -l "$_fpath/$_ftype") {
+ $defFontPath .= "$_fpath/$_ftype,";
+ }
+ }
+ }
+}
+
+if ($defFontPath) {
+ if (substr($defFontPath, -1, 1) == ',') {
+ chop $defFontPath;
+ }
+}
+
+if ($fontPath eq "") {
+ $fontPath = $defFontPath;
+}
+
+# Check command line options
+
+&ParseOptions("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,
+ "-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0,"-noxstartup",0,"-xstartup",1);
+
+&Usage() if ($opt{'-help'} || $opt{'-h'} || $opt{'--help'});
+
+&Kill() if ($opt{'-kill'});
+
+&List() if ($opt{'-list'});
+
+# Uncomment this line if you want default geometry, depth and pixelformat
+# to match the current X display:
+# &GetXDisplayDefaults();
+
+if ($opt{'-geometry'}) {
+ $geometry = $opt{'-geometry'};
+}
+if ($opt{'-depth'}) {
+ $depth = $opt{'-depth'};
+ $pixelformat = "";
+}
+if ($opt{'-pixelformat'}) {
+ $pixelformat = $opt{'-pixelformat'};
+}
+if ($opt{'-noxstartup'}) {
+ $skipxstartup = 1;
+}
+if ($opt{'-xstartup'}) {
+ $xstartupFile = $opt{'-xstartup'};
+}
+if ($opt{'-fp'}) {
+ $fontPath = $opt{'-fp'};
+ $fpArgSpecified = 1;
+}
+
+&CheckGeometryAndDepth();
+
+# Create the user's vnc directory if necessary.
+if (!(-e $vncUserDir)) {
+ if (!mkdir($vncUserDir,0755)) {
+ die "$prog: Could not create $vncUserDir.\n";
+ }
+}
+
+# Find display number.
+if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
+ $displayNumber = $1;
+ shift(@ARGV);
+ if (!&CheckDisplayNumber($displayNumber)) {
+ die "A VNC server is already running as :$displayNumber\n";
+ }
+} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
+ &Usage();
+} else {
+ $displayNumber = &GetDisplayNumber();
+}
+
+$vncPort = 5900 + $displayNumber;
+
+if ($opt{'-name'}) {
+ $desktopName = $opt{'-name'};
+} else {
+ $desktopName = "$host:$displayNumber ($ENV{USER})";
+}
+
+my %default_opts;
+my %config;
+
+# We set some reasonable defaults. Config file settings
+# override these where present.
+$default_opts{desktop} = &quotedString($desktopName);
+$default_opts{auth} = &quotedString($xauthorityFile);
+$default_opts{geometry} = $geometry if ($geometry);
+$default_opts{depth} = $depth if ($depth);
+$default_opts{pixelformat} = $pixelformat if ($pixelformat);
+$default_opts{rfbwait} = 30000;
+$default_opts{rfbauth} = "$vncUserDir/passwd";
+$default_opts{rfbport} = $vncPort;
+$default_opts{fp} = $fontPath if ($fontPath);
+$default_opts{pn} = "";
+
+# Load user-overrideable system defaults
+LoadConfig($vncSystemConfigDefaultsFile);
+
+# Then the user's settings
+LoadConfig($vncUserConfig);
+
+# And then override anything set above if mandatory settings exist.
+# WARNING: "Mandatory" is used loosely here! As the man page says,
+# there is nothing stopping someone from EASILY subverting the
+# settings in $vncSystemConfigMandatoryFile by simply passing
+# CLI args to vncserver, which trump config files! To properly
+# hard force policy in a non-subvertible way would require major
+# development work that touches Xvnc itself.
+LoadConfig($vncSystemConfigMandatoryFile, 1);
+
+#
+# Check whether VNC authentication is enabled, and if so, prompt the user to
+# create a VNC password if they don't already have one.
+#
+
+$securityTypeArgSpecified = 0;
+$vncAuthEnabled = 0;
+$passwordArgSpecified = 0;
+@vncAuthStrings = ("vncauth", "tlsvnc", "x509vnc");
+
+# ...first we check our configuration files' settings
+if ($config{'securitytypes'}) {
+ $securityTypeArgSpecified = 1;
+ foreach $arg2 (split(',', $config{'securitytypes'})) {
+ if (grep {$_ eq lc($arg2)} @vncAuthStrings) {
+ $vncAuthEnabled = 1;
+ }
+ }
+}
+
+# ...and finally we check CLI args, which in the case of the topic at
+# hand (VNC auth or not), override anything found in configuration files
+# (even so-called "mandatory" settings).
+for ($i = 0; $i < @ARGV; ++$i) {
+ # -SecurityTypes can be followed by a space or "="
+ my @splitargs = split('=', $ARGV[$i]);
+ if (@splitargs <= 1 && $i < @ARGV - 1) {
+ push(@splitargs, $ARGV[$i + 1]);
+ }
+ if (lc(@splitargs[0]) eq "-securitytypes") {
+ if (@splitargs > 1) {
+ $securityTypeArgSpecified = 1;
+ }
+ foreach $arg2 (split(',', @splitargs[1])) {
+ if (grep {$_ eq lc($arg2)} @vncAuthStrings) {
+ $vncAuthEnabled = 1;
+ }
+ }
+ }
+ if ((lc(@splitargs[0]) eq "-password")
+ || (lc(@splitargs[0]) eq "-passwordfile"
+ || (lc(@splitargs[0]) eq "-rfbauth"))) {
+ $passwordArgSpecified = 1;
+ }
+}
+
+if ((!$securityTypeArgSpecified || $vncAuthEnabled) && !$passwordArgSpecified) {
+ ($z,$z,$mode) = stat("$vncUserDir/passwd");
+ if (!(-e "$vncUserDir/passwd") || ($mode & 077)) {
+ warn "\nYou will require a password to access your desktops.\n\n";
+ system($exedir."vncpasswd -q $vncUserDir/passwd");
+ if (($? >> 8) != 0) {
+ exit 1;
+ }
+ }
+}
+
+$desktopLog = "$vncUserDir/$host:$displayNumber.log";
+unlink($desktopLog);
+
+# Make an X server cookie and set up the Xauthority file
+# mcookie is a part of util-linux, usually only GNU/Linux systems have it.
+$cookie = `mcookie`;
+# Fallback for non GNU/Linux OS - use /dev/urandom on systems that have it,
+# otherwise use perl's random number generator, seeded with the sum
+# of the current time, our PID and part of the encrypted form of the password.
+if ($cookie eq "" && open(URANDOM, '<', '/dev/urandom')) {
+ my $randata;
+ if (sysread(URANDOM, $randata, 16) == 16) {
+ $cookie = unpack 'h*', $randata;
+ }
+ close(URANDOM);
+}
+if ($cookie eq "") {
+ srand(time+$$+unpack("L",`cat $vncUserDir/passwd`));
+ for (1..16) {
+ $cookie .= sprintf("%02x", int(rand(256)) % 256);
+ }
+}
+
+open(XAUTH, "|xauth -f $xauthorityFile source -");
+print XAUTH "add $host:$displayNumber . $cookie\n";
+print XAUTH "add $host/unix:$displayNumber . $cookie\n";
+close(XAUTH);
+
+# Now start the X VNC Server
+
+# We build up our Xvnc command with options
+$cmd = $exedir."Xvnc :$displayNumber";
+
+foreach my $k (sort keys %config) {
+ $cmd .= " -$k $config{$k}";
+ delete $default_opts{$k}; # file options take precedence
+}
+
+foreach my $k (sort keys %default_opts) {
+ $cmd .= " -$k $default_opts{$k}";
+}
+
+# Add color database stuff here, e.g.:
+# $cmd .= " -co /usr/lib/X11/rgb";
+
+foreach $arg (@ARGV) {
+ $cmd .= " " . &quotedString($arg);
+}
+$cmd .= " >> " . &quotedString($desktopLog) . " 2>&1";
+
+# Run $cmd and record the process ID.
+$pidFile = "$vncUserDir/$host:$displayNumber.pid";
+system("$cmd & echo \$! >$pidFile");
+
+# Give Xvnc a chance to start up
+
+sleep(3);
+if ($fontPath ne $defFontPath) {
+ unless (kill 0, `cat $pidFile`) {
+ if ($fpArgSpecified) {
+ warn "\nWARNING: The first attempt to start Xvnc failed, probably because the font\n";
+ warn "path you specified using the -fp argument is incorrect. Attempting to\n";
+ warn "determine an appropriate font path for this system and restart Xvnc using\n";
+ warn "that font path ...\n";
+ } else {
+ warn "\nWARNING: The first attempt to start Xvnc failed, possibly because the font\n";
+ warn "catalog is not properly configured. Attempting to determine an appropriate\n";
+ warn "font path for this system and restart Xvnc using that font path ...\n";
+ }
+ $cmd =~ s@-fp [^ ]+@@;
+ $cmd .= " -fp $defFontPath" if ($defFontPath);
+ system("$cmd & echo \$! >$pidFile");
+ sleep(3);
+ }
+}
+unless (kill 0, `cat $pidFile`) {
+ warn "Could not start Xvnc.\n\n";
+ unlink $pidFile;
+ open(LOG, "<$desktopLog");
+ while (<LOG>) { print; }
+ close(LOG);
+ die "\n";
+}
+
+warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n";
+
+# Create the user's xstartup script if necessary.
+if (! $skipxstartup) {
+ if (!(-e "$xstartupFile")) {
+ warn "Creating default startup script $xstartupFile\n";
+ open(XSTARTUP, ">$xstartupFile");
+ print XSTARTUP $defaultXStartup;
+ close(XSTARTUP);
+ chmod 0755, "$xstartupFile";
+ }
+}
+
+# Create the user's config file if necessary.
+if (!(-e "$vncUserDir/config")) {
+ warn "Creating default config $vncUserDir/config\n";
+ open(VNCUSERCONFIG, ">$vncUserDir/config");
+ print VNCUSERCONFIG $defaultConfig;
+ close(VNCUSERCONFIG);
+ chmod 0644, "$vncUserDir/config";
+}
+
+# Run the X startup script.
+if (! $skipxstartup) {
+ warn "Starting applications specified in $xstartupFile\n";
+}
+warn "Log file is $desktopLog\n\n";
+
+# If the unix domain socket exists then use that (DISPLAY=:n) otherwise use
+# TCP (DISPLAY=host:n)
+
+if (-e "/tmp/.X11-unix/X$displayNumber" ||
+ -e "/usr/spool/sockets/X11/$displayNumber")
+{
+ $ENV{DISPLAY}= ":$displayNumber";
+} else {
+ $ENV{DISPLAY}= "$host:$displayNumber";
+}
+$ENV{VNCDESKTOP}= $desktopName;
+
+if ($opt{'-fg'}) {
+ if (! $skipxstartup) {
+ system("$xstartupFile >> " . &quotedString($desktopLog) . " 2>&1");
+ }
+ if (kill 0, `cat $pidFile`) {
+ $opt{'-kill'} = ':'.$displayNumber;
+ &Kill();
+ }
+} else {
+ if ($opt{'-autokill'}) {
+ if (! $skipxstartup) {
+ system("($xstartupFile; $0 -kill :$displayNumber) >> "
+ . &quotedString($desktopLog) . " 2>&1 &");
+ }
+ } else {
+ if (! $skipxstartup) {
+ system("$xstartupFile >> " . &quotedString($desktopLog)
+ . " 2>&1 &");
+ }
+ }
+}
+
+exit;
+
+###############################################################################
+# Functions
+###############################################################################
+
+#
+# Populate the global %config hash with settings from a specified
+# vncserver configuration file if it exists
+#
+# Args: 1. file path
+# 2. optional boolean flag to enable warning when a previously
+# set configuration setting is being overridden
+#
+sub LoadConfig {
+ local ($configFile, $warnoverride) = @_;
+ local ($toggle) = undef;
+
+ if (stat($configFile)) {
+ if (open(IN, $configFile)) {
+ while (<IN>) {
+ next if /^#/;
+ if (my ($k, $v) = /^\s*(\w+)\s*=\s*(.+)$/) {
+ $k = lc($k); # must normalize key case
+ if ($warnoverride && $config{$k}) {
+ print("Warning: $configFile is overriding previously defined '$k' to be '$v'\n");
+ }
+ $config{$k} = $v;
+ } elsif ($_ =~ m/^\s*(\S+)/) {
+ # We can't reasonably warn on override of toggles (e.g. AlwaysShared)
+ # because it would get crazy to do so. We'd have to check if the
+ # current config file being loaded defined the logical opposite setting
+ # (NeverShared vs. AlwaysShared, etc etc).
+ $toggle = lc($1); # must normalize key case
+ $config{$toggle} = $k;
+ }
+ }
+ close(IN);
+ }
+ }
+}
+
+#
+# CheckGeometryAndDepth simply makes sure that the geometry and depth values
+# are sensible.
+#
+
+sub CheckGeometryAndDepth
+{
+ if ($geometry =~ /^(\d+)x(\d+)$/) {
+ $width = $1; $height = $2;
+
+ if (($width<1) || ($height<1)) {
+ die "$prog: geometry $geometry is invalid\n";
+ }
+
+ $geometry = "${width}x$height";
+ } else {
+ die "$prog: geometry $geometry is invalid\n";
+ }
+
+ if ($depth && (($depth < 8) || ($depth > 32))) {
+ die "Depth must be between 8 and 32\n";
+ }
+}
+
+
+#
+# GetDisplayNumber gets the lowest available display number. A display number
+# n is taken if something is listening on the VNC server port (5900+n) or the
+# X server port (6000+n).
+#
+
+sub GetDisplayNumber
+{
+ foreach $n (1..99) {
+ if (&CheckDisplayNumber($n)) {
+ return $n+0; # Bruce Mah's workaround for bug in perl 5.005_02
+ }
+ }
+
+ die "$prog: no free display number on $host.\n";
+}
+
+
+#
+# CheckDisplayNumber checks if the given display number is available. A
+# display number n is taken if something is listening on the VNC server port
+# (5900+n) or the X server port (6000+n).
+#
+
+sub CheckDisplayNumber
+{
+ local ($n) = @_;
+
+ socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
+ eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
+ if (!bind(S, pack('S n x12', $AF_INET, 6000 + $n))) {
+ close(S);
+ return 0;
+ }
+ close(S);
+
+ socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
+ eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
+ if (!bind(S, pack('S n x12', $AF_INET, 5900 + $n))) {
+ close(S);
+ return 0;
+ }
+ close(S);
+
+ if (-e "/tmp/.X$n-lock") {
+ warn "\nWarning: $host:$n is taken because of /tmp/.X$n-lock\n";
+ warn "Remove this file if there is no X server $host:$n\n";
+ return 0;
+ }
+
+ if (-e "/tmp/.X11-unix/X$n") {
+ warn "\nWarning: $host:$n is taken because of /tmp/.X11-unix/X$n\n";
+ warn "Remove this file if there is no X server $host:$n\n";
+ return 0;
+ }
+
+ if (-e "/usr/spool/sockets/X11/$n") {
+ warn("\nWarning: $host:$n is taken because of ".
+ "/usr/spool/sockets/X11/$n\n");
+ warn "Remove this file if there is no X server $host:$n\n";
+ return 0;
+ }
+
+ return 1;
+}
+
+
+#
+# GetXDisplayDefaults uses xdpyinfo to find out the geometry, depth and pixel
+# format of the current X display being used. If successful, it sets the
+# options as appropriate so that the X VNC server will use the same settings
+# (minus an allowance for window manager decorations on the geometry). Using
+# the same depth and pixel format means that the VNC server won't have to
+# translate pixels when the desktop is being viewed on this X display (for
+# TrueColor displays anyway).
+#
+
+sub GetXDisplayDefaults
+{
+ local (@lines, @matchlines, $width, $height, $defaultVisualId, $i,
+ $red, $green, $blue);
+
+ $wmDecorationWidth = 4; # a guess at typical size for window manager
+ $wmDecorationHeight = 24; # decoration size
+
+ return if (!defined($ENV{DISPLAY}));
+
+ @lines = `xdpyinfo 2>/dev/null`;
+
+ return if ($? != 0);
+
+ @matchlines = grep(/dimensions/, @lines);
+ if (@matchlines) {
+ ($width, $height) = ($matchlines[0] =~ /(\d+)x(\d+) pixels/);
+
+ $width -= $wmDecorationWidth;
+ $height -= $wmDecorationHeight;
+
+ $geometry = "${width}x$height";
+ }
+
+ @matchlines = grep(/default visual id/, @lines);
+ if (@matchlines) {
+ ($defaultVisualId) = ($matchlines[0] =~ /id:\s+(\S+)/);
+
+ for ($i = 0; $i < @lines; $i++) {
+ if ($lines[$i] =~ /^\s*visual id:\s+$defaultVisualId$/) {
+ if (($lines[$i+1] !~ /TrueColor/) ||
+ ($lines[$i+2] !~ /depth/) ||
+ ($lines[$i+4] !~ /red, green, blue masks/))
+ {
+ return;
+ }
+ last;
+ }
+ }
+
+ return if ($i >= @lines);
+
+ ($depth) = ($lines[$i+2] =~ /depth:\s+(\d+)/);
+ ($red,$green,$blue)
+ = ($lines[$i+4]
+ =~ /masks:\s+0x([0-9a-f]+), 0x([0-9a-f]+), 0x([0-9a-f]+)/);
+
+ $red = hex($red);
+ $green = hex($green);
+ $blue = hex($blue);
+
+ if ($red > $blue) {
+ $red = int(log($red) / log(2)) - int(log($green) / log(2));
+ $green = int(log($green) / log(2)) - int(log($blue) / log(2));
+ $blue = int(log($blue) / log(2)) + 1;
+ $pixelformat = "rgb$red$green$blue";
+ } else {
+ $blue = int(log($blue) / log(2)) - int(log($green) / log(2));
+ $green = int(log($green) / log(2)) - int(log($red) / log(2));
+ $red = int(log($red) / log(2)) + 1;
+ $pixelformat = "bgr$blue$green$red";
+ }
+ }
+}
+
+
+#
+# quotedString returns a string which yields the original string when parsed
+# by a shell.
+#
+
+sub quotedString
+{
+ local ($in) = @_;
+
+ $in =~ s/\'/\'\"\'\"\'/g;
+
+ return "'$in'";
+}
+
+
+#
+# removeSlashes turns slashes into underscores for use as a file name.
+#
+
+sub removeSlashes
+{
+ local ($in) = @_;
+
+ $in =~ s|/|_|g;
+
+ return "$in";
+}
+
+
+#
+# Usage
+#
+
+sub Usage
+{
+ die("\nusage: $prog [:<number>] [-name <desktop-name>] [-depth <depth>]\n".
+ " [-geometry <width>x<height>]\n".
+ " [-pixelformat rgbNNN|bgrNNN]\n".
+ " [-fp <font-path>]\n".
+ " [-fg]\n".
+ " [-autokill]\n".
+ " [-noxstartup]\n".
+ " [-xstartup <file>]\n".
+ " <Xvnc-options>...\n\n".
+ " $prog -kill <X-display>\n\n".
+ " $prog -list\n\n");
+}
+
+
+#
+# List
+#
+
+sub List
+{
+ opendir(dir, $vncUserDir);
+ my @filelist = readdir(dir);
+ closedir(dir);
+ print "\nTigerVNC server sessions:\n\n";
+ print "X DISPLAY #\tPROCESS ID\n";
+ foreach my $file (@filelist) {
+ if ($file =~ /$host:(\d+)$\.pid/) {
+ chop($tmp_pid = `cat $vncUserDir/$file`);
+ if (kill 0, $tmp_pid) {
+ print ":".$1."\t\t".`cat $vncUserDir/$file`;
+ } else {
+ unlink ($vncUserDir . "/" . $file);
+ }
+ }
+ }
+ exit;
+}
+
+
+#
+# Kill
+#
+
+sub Kill
+{
+ $opt{'-kill'} =~ s/(:\d+)\.\d+$/$1/; # e.g. turn :1.0 into :1
+
+ if ($opt{'-kill'} =~ /^:\d+$/) {
+ $pidFile = "$vncUserDir/$host$opt{'-kill'}.pid";
+ } else {
+ if ($opt{'-kill'} !~ /^$host:/) {
+ die "\nCan't tell if $opt{'-kill'} is on $host\n".
+ "Use -kill :<number> instead\n\n";
+ }
+ $pidFile = "$vncUserDir/$opt{'-kill'}.pid";
+ }
+
+ if (! -r $pidFile) {
+ die "\nCan't find file $pidFile\n".
+ "You'll have to kill the Xvnc process manually\n\n";
+ }
+
+ $SIG{'HUP'} = 'IGNORE';
+ chop($pid = `cat $pidFile`);
+ warn "Killing Xvnc process ID $pid\n";
+
+ if (kill 0, $pid) {
+ system("kill $pid");
+ sleep(1);
+ if (kill 0, $pid) {
+ print "Xvnc seems to be deadlocked. Kill the process manually and then re-run\n";
+ print " ".$0." -kill ".$opt{'-kill'}."\n";
+ print "to clean up the socket files.\n";
+ exit
+ }
+
+ } else {
+ warn "Xvnc process ID $pid already killed\n";
+ $opt{'-kill'} =~ s/://;
+
+ if (-e "/tmp/.X11-unix/X$opt{'-kill'}") {
+ print "Xvnc did not appear to shut down cleanly.";
+ print " Removing /tmp/.X11-unix/X$opt{'-kill'}\n";
+ unlink "/tmp/.X11-unix/X$opt{'-kill'}";
+ }
+ if (-e "/tmp/.X$opt{'-kill'}-lock") {
+ print "Xvnc did not appear to shut down cleanly.";
+ print " Removing /tmp/.X$opt{'-kill'}-lock\n";
+ unlink "/tmp/.X$opt{'-kill'}-lock";
+ }
+ }
+
+ unlink $pidFile;
+ exit;
+}
+
+
+#
+# ParseOptions takes a list of possible options and a boolean indicating
+# whether the option has a value following, and sets up an associative array
+# %opt of the values of the options given on the command line. It removes all
+# the arguments it uses from @ARGV and returns them in @optArgs.
+#
+
+sub ParseOptions
+{
+ local (@optval) = @_;
+ local ($opt, @opts, %valFollows, @newargs);
+
+ while (@optval) {
+ $opt = shift(@optval);
+ push(@opts,$opt);
+ $valFollows{$opt} = shift(@optval);
+ }
+
+ @optArgs = ();
+ %opt = ();
+
+ arg: while (defined($arg = shift(@ARGV))) {
+ foreach $opt (@opts) {
+ if ($arg eq $opt) {
+ push(@optArgs, $arg);
+ if ($valFollows{$opt}) {
+ if (@ARGV == 0) {
+ &Usage();
+ }
+ $opt{$opt} = shift(@ARGV);
+ push(@optArgs, $opt{$opt});
+ } else {
+ $opt{$opt} = 1;
+ }
+ next arg;
+ }
+ }
+ push(@newargs,$arg);
+ }
+
+ @ARGV = @newargs;
+}
+
+
+# Routine to make sure we're operating in a sane environment.
+sub SanityCheck
+{
+ local ($cmd);
+
+ # Get the program name
+ ($prog) = ($0 =~ m|([^/]+)$|);
+
+ #
+ # Check we have all the commands we'll need on the path.
+ #
+
+ cmd:
+ foreach $cmd ("uname","xauth") {
+ for (split(/:/,$ENV{PATH})) {
+ if (-x "$_/$cmd") {
+ next cmd;
+ }
+ }
+ die "$prog: couldn't find \"$cmd\" on your PATH.\n";
+ }
+
+ if($exedir eq "") {
+ cmd2:
+ foreach $cmd ("Xvnc","vncpasswd") {
+ for (split(/:/,$ENV{PATH})) {
+ if (-x "$_/$cmd") {
+ next cmd2;
+ }
+ }
+ die "$prog: couldn't find \"$cmd\" on your PATH.\n";
+ }
+ }
+ else {
+ cmd3:
+ foreach $cmd ($exedir."Xvnc",$exedir."vncpasswd") {
+ for (split(/:/,$ENV{PATH})) {
+ if (-x "$cmd") {
+ next cmd3;
+ }
+ }
+ die "$prog: couldn't find \"$cmd\".\n";
+ }
+ }
+
+ if (!defined($ENV{HOME})) {
+ die "$prog: The HOME environment variable is not set.\n";
+ }
+
+ #
+ # Find socket constants. 'use Socket' is a perl5-ism, so we wrap it in an
+ # eval, and if it fails we try 'require "sys/socket.ph"'. If this fails,
+ # we just guess at the values. If you find perl moaning here, just
+ # hard-code the values of AF_INET and SOCK_STREAM. You can find these out
+ # for your platform by looking in /usr/include/sys/socket.h and related
+ # files.
+ #
+
+ chop($os = `uname`);
+ chop($osrev = `uname -r`);
+
+ eval 'use Socket';
+ if ($@) {
+ eval 'require "sys/socket.ph"';
+ if ($@) {
+ if (($os eq "SunOS") && ($osrev !~ /^4/)) {
+ $AF_INET = 2;
+ $SOCK_STREAM = 2;
+ } else {
+ $AF_INET = 2;
+ $SOCK_STREAM = 1;
+ }
+ } else {
+ $AF_INET = &AF_INET;
+ $SOCK_STREAM = &SOCK_STREAM;
+ }
+ } else {
+ $AF_INET = &AF_INET;
+ $SOCK_STREAM = &SOCK_STREAM;
+ }
+}
diff --git a/extra/source/tigervnc/vncserver.1 b/extra/source/tigervnc/vncserver.1
new file mode 100644
index 000000000..95f7960fa
--- /dev/null
+++ b/extra/source/tigervnc/vncserver.1
@@ -0,0 +1,204 @@
+.TH vncserver 1 "" "TigerVNC" "Virtual Network Computing"
+.SH NAME
+vncserver \- start or stop a VNC server
+.SH SYNOPSIS
+.B vncserver
+.RI [: display# ]
+.RB [ \-name
+.IR desktop-name ]
+.RB [ \-geometry
+.IR width x height ]
+.RB [ \-depth
+.IR depth ]
+.RB [ \-pixelformat
+.IR format ]
+.RB [ \-fp
+.IR font-path ]
+.RB [ \-fg ]
+.RB [ \-autokill ]
+.RB [ \-noxstartup ]
+.RB [ \-xstartup
+.IR script ]
+.RI [ Xvnc-options... ]
+.br
+.BI "vncserver \-kill :" display#
+.br
+.BI "vncserver \-list"
+.SH DESCRIPTION
+.B vncserver
+is used to start a VNC (Virtual Network Computing) desktop.
+.B vncserver
+is a Perl script which simplifies the process of starting an Xvnc server. It
+runs Xvnc with appropriate options and starts a window manager on the VNC
+desktop.
+
+.B vncserver
+can be run with no options at all. In this case it will choose the first
+available display number (usually :1), start Xvnc with that display number,
+and start the default window manager in the Xvnc session. You can also
+specify the display number, in which case vncserver will attempt to start
+Xvnc with that display number and exit if the display number is not
+available. For example:
+
+.RS
+vncserver :13
+.RE
+
+Editing the file $HOME/.vnc/xstartup allows you to change the applications run
+at startup (but note that this will not affect an existing VNC session.)
+
+.SH OPTIONS
+You can get a list of options by passing \fB\-h\fP as an option to vncserver.
+In addition to the options listed below, any unrecognised options will be
+passed to Xvnc - see the Xvnc man page, or "Xvnc \-help", for details.
+
+.TP
+.B \-name \fIdesktop-name\fP
+Each VNC desktop has a name which may be displayed by the viewer. The desktop
+name defaults to "\fIhost\fP:\fIdisplay#\fP (\fIusername\fP)", but you can
+change it with this option. The desktop name option is passed to the xstartup
+script via the $VNCDESKTOP environment variable, which allows you to run a
+different set of applications depending on the name of the desktop.
+.
+.TP
+.B \-geometry \fIwidth\fPx\fIheight\fP
+Specify the size of the VNC desktop to be created. Default is 1024x768.
+.
+.TP
+.B \-depth \fIdepth\fP
+Specify the pixel depth (in bits) of the VNC desktop to be created. Default is
+24. Other possible values are 8, 15 and 16 - anything else is likely to cause
+strange behaviour by applications.
+.
+.TP
+.B \-pixelformat \fIformat\fP
+Specify pixel format for Xvnc to use (BGRnnn or RGBnnn). The default for
+depth 8 is BGR233 (meaning the most significant two bits represent blue, the
+next three green, and the least significant three represent red), the default
+for depth 16 is RGB565, and the default for depth 24 is RGB888.
+.
+.TP
+.B \-cc 3
+As an alternative to the default TrueColor visual, this allows you to run an
+Xvnc server with a PseudoColor visual (i.e. one which uses a color map or
+palette), which can be useful for running some old X applications which only
+work on such a display. Values other than 3 (PseudoColor) and 4 (TrueColor)
+for the \-cc option may result in strange behaviour, and PseudoColor desktops
+must have an 8-bit depth.
+.
+.TP
+.B \-kill :\fIdisplay#\fP
+This kills a VNC desktop previously started with vncserver. It does this by
+killing the Xvnc process, whose process ID is stored in the file
+"$HOME/.vnc/\fIhost\fP:\fIdisplay#\fP.pid". The
+.B \-kill
+option ignores anything preceding the first colon (":") in the display
+argument. Thus, you can invoke "vncserver \-kill $DISPLAY", for example at the
+end of your xstartup file after a particular application exits.
+.
+.TP
+.B \-fp \fIfont-path\fP
+If the vncserver script detects that the X Font Server (XFS) is running, it
+will attempt to start Xvnc and configure Xvnc to use XFS for font handling.
+Otherwise, if XFS is not running, the vncserver script will attempt to start
+Xvnc and allow Xvnc to use its own preferred method of font handling (which may
+be a hard-coded font path or, on more recent systems, a font catalog.) In
+any case, if Xvnc fails to start, the vncserver script will then attempt to
+determine an appropriate X font path for this system and start Xvnc using
+that font path.
+
+The
+.B \-fp
+argument allows you to override the above fallback logic and specify a font
+path for Xvnc to use.
+.
+.TP
+.B \-fg
+Runs Xvnc as a foreground process. This has two effects: (1) The VNC server
+can be aborted with CTRL-C, and (2) the VNC server will exit as soon as the
+user logs out of the window manager in the VNC session. This may be necessary
+when launching TigerVNC from within certain grid computing environments.
+.
+.TP
+.B \-autokill
+Automatically kill Xvnc whenever the xstartup script exits. In most cases,
+this has the effect of terminating Xvnc when the user logs out of the window
+manager.
+.
+.TP
+.B \-noxstartup
+Do not run the %HOME/.vnc/xstartup script after launching Xvnc. This
+option allows you to manually start a window manager in your TigerVNC session.
+.
+.TP
+.B \-xstartup \fIscript\fP
+Run a custom startup script, instead of %HOME/.vnc/xstartup, after launching
+Xvnc. This is useful to run full-screen applications.
+.
+.TP
+.B \-list
+Lists all VNC desktops started by vncserver.
+
+.SH FILES
+Several VNC-related files are found in the directory $HOME/.vnc:
+.TP
+$HOME/.vnc/xstartup
+A shell script specifying X applications to be run when a VNC desktop is
+started. If this file does not exist, then vncserver will create a default
+xstartup script which attempts to launch your chosen window manager.
+.TP
+/etc/tigervnc/vncserver-config-defaults
+The optional system-wide equivalent of $HOME/.vnc/config. If this file exists
+and defines options to be passed to Xvnc, they will be used as defaults for
+users. The user's $HOME/.vnc/config overrides settings configured in this file.
+The overall configuration file load order is: this file, $HOME/.vnc/config,
+and then /etc/tigervnc/vncserver-config-mandatory. None are required to exist.
+.TP
+/etc/tigervnc/vncserver-config-mandatory
+The optional system-wide equivalent of $HOME/.vnc/config. If this file exists
+and defines options to be passed to Xvnc, they will override any of the same
+options defined in a user's $HOME/.vnc/config. This file offers a mechanism
+to establish some basic form of system-wide policy. WARNING! There is
+nothing stopping users from constructing their own vncserver-like script
+that calls Xvnc directly to bypass any options defined in
+/etc/tigervnc/vncserver-config-mandatory. Likewise, any CLI arguments passed
+to vncserver will override ANY config file setting of the same name. The
+overall configuration file load order is:
+/etc/tigervnc/vncserver-config-defaults, $HOME/.vnc/config, and then this file.
+None are required to exist.
+.TP
+$HOME/.vnc/config
+An optional server config file wherein options to be passed to Xvnc are listed
+to avoid hard-coding them to the physical invocation. List options in this file
+one per line. For those requiring an argument, simply separate the option from
+the argument with an equal sign, for example: "geometry=2000x1200" or
+"securitytypes=vncauth,tlsvnc". Options without an argument are simply listed
+as a single word, for example: "localhost" or "alwaysshared".
+.TP
+$HOME/.vnc/passwd
+The VNC password file.
+.TP
+$HOME/.vnc/\fIhost\fP:\fIdisplay#\fP.log
+The log file for Xvnc and applications started in xstartup.
+.TP
+$HOME/.vnc/\fIhost\fP:\fIdisplay#\fP.pid
+Identifies the Xvnc process ID, used by the
+.B \-kill
+option.
+
+.SH SEE ALSO
+.BR vncviewer (1),
+.BR vncpasswd (1),
+.BR vncconfig (1),
+.BR Xvnc (1)
+.br
+https://www.tigervnc.org
+
+.SH AUTHOR
+Tristan Richardson, RealVNC Ltd., D. R. Commander and others.
+
+VNC was originally developed by the RealVNC team while at Olivetti
+Research Ltd / AT&T Laboratories Cambridge. TightVNC additions were
+implemented by Constantin Kaplinsky. Many other people have since
+participated in development, testing and support. This manual is part
+of the TigerVNC software suite.