]> TLD Linux GIT Repositories - packages/tigervnc.git/commitdiff
- from PLD
authorMarcin Krol <hawk@tld-linux.org>
Mon, 27 Jul 2015 18:41:37 +0000 (18:41 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Mon, 27 Jul 2015 18:41:37 +0000 (18:41 +0000)
18 files changed:
format-security.patch [new file with mode: 0644]
no-bashizm.patch [new file with mode: 0644]
tigervnc-as-needed.patch [new file with mode: 0644]
tigervnc-cookie.patch [new file with mode: 0644]
tigervnc-getmaster.patch [new file with mode: 0644]
tigervnc-ipv6.patch [new file with mode: 0644]
tigervnc-ldnow.patch [new file with mode: 0644]
tigervnc-pointersync.patch [new file with mode: 0644]
tigervnc-rh692048.patch [new file with mode: 0644]
tigervnc-xserver-1.17.patch [new file with mode: 0644]
tigervnc-xstartup.patch [new file with mode: 0644]
tigervnc.desktop [new file with mode: 0644]
tigervnc.spec [new file with mode: 0644]
vncserver-service-generator [new file with mode: 0755]
vncserver.init [new file with mode: 0755]
vncserver.sysconfig [new file with mode: 0644]
vncserver.target [new file with mode: 0644]
xserver.patch [new file with mode: 0644]

diff --git a/format-security.patch b/format-security.patch
new file mode 100644 (file)
index 0000000..cbd58ca
--- /dev/null
@@ -0,0 +1,11 @@
+--- tigervnc-1.3.0/vncviewer/vncviewer.cxx.orig        2013-07-01 12:42:05.000000000 +0000
++++ tigervnc-1.3.0/vncviewer/vncviewer.cxx     2013-07-18 13:01:58.387116062 +0000
+@@ -304,7 +304,7 @@
+   snprintf(vncServerName, VNCSERVERNAMELEN, "localhost::%d", localPort);
+   vncServerName[VNCSERVERNAMELEN - 1] = '\0';
+-  vlog.error(vncServerName);
++  vlog.error("%s", vncServerName);
+   return 0;
+ }
diff --git a/no-bashizm.patch b/no-bashizm.patch
new file mode 100644 (file)
index 0000000..752c0a1
--- /dev/null
@@ -0,0 +1,11 @@
+--- tigervnc-1.2.0/unix/xserver/hw/vnc/Makefile.am~    2012-03-23 13:48:14.821937463 +0100
++++ tigervnc-1.2.0/unix/xserver/hw/vnc/Makefile.am     2012-03-23 13:53:47.718619148 +0100
+@@ -68,7 +68,7 @@
+ pixman.h:
+       for i in ${XSERVERLIBS_CFLAGS}; do \
+-              if [[ "$$i" =~ "pixman" ]]; then \
++              if [[ "$$i" = *pixman* ]]; then \
+                       PIXMANINCDIR=`echo $$i | sed s/-I//g`; \
+               fi; \
+       done; \
diff --git a/tigervnc-as-needed.patch b/tigervnc-as-needed.patch
new file mode 100644 (file)
index 0000000..9114eea
--- /dev/null
@@ -0,0 +1,16 @@
+--- tigervnc-1.0.90/unix/xserver/hw/vnc/Makefile.am~   2011-04-20 13:46:16.993047050 +0200
++++ tigervnc-1.0.90/unix/xserver/hw/vnc/Makefile.am    2011-04-20 14:03:35.942724608 +0200
+@@ -1,11 +1,12 @@
+ TIGERVNC_SRCDIR=${top_srcdir}/../..
+ LIB_DIR=${top_builddir}/../../common
++OS_LIB=$(LIB_DIR)/os/libos.a
+ RFB_LIB=$(LIB_DIR)/rfb/librfb.la
+ RDR_LIB=$(LIB_DIR)/rdr/librdr.la
+ NETWORK_LIB=$(LIB_DIR)/network/libnetwork.la
+ XREGION_LIB=$(LIB_DIR)/Xregion/libXregion.la
+-COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
++COMMON_LIBS=$(NETWORK_LIB) $(OS_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB)
+ noinst_LTLIBRARIES = libvnccommon.la
diff --git a/tigervnc-cookie.patch b/tigervnc-cookie.patch
new file mode 100644 (file)
index 0000000..c066a5f
--- /dev/null
@@ -0,0 +1,37 @@
+diff -up tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie tigervnc-1.0.90-20091221svn3929/unix/vncserver
+--- tigervnc-1.0.90-20091221svn3929/unix/vncserver.cookie      2009-11-12 11:39:54.000000000 +0100
++++ tigervnc-1.0.90-20091221svn3929/unix/vncserver     2009-12-21 16:15:01.907799091 +0100
+@@ -189,27 +189,12 @@ $vncPort = 5900 + $displayNumber;
+ $desktopLog = "$vncUserDir/$host:$displayNumber.log";
+ unlink($desktopLog);
+-# Make an X server cookie - 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.
+-
+-my $cookie = "";
+-if (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);
+-  }
+-}
+-
+-system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie");
+-system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); 
++# Make an X server cookie - use mcookie
++$cookie = `/usr/bin/mcookie`;
++open (XAUTH, "|xauth -f $xauthorityFile source -");
++print XAUTH "add $host:$displayNumber . $cookie\n";
++print XAUTH "add $host/unix:$displayNumber . $cookie\n";
++close XAUTH;
+ if ($opt{'-name'}) {
+     $desktopName = $opt{'-name'};
diff --git a/tigervnc-getmaster.patch b/tigervnc-getmaster.patch
new file mode 100644 (file)
index 0000000..cf6ce86
--- /dev/null
@@ -0,0 +1,96 @@
+diff -up tigervnc-1.3.0/unix/xserver/hw/vnc/InputXKB.cc.getmaster tigervnc-1.3.0/unix/xserver/hw/vnc/InputXKB.cc
+--- tigervnc-1.3.0/unix/xserver/hw/vnc/InputXKB.cc.getmaster   2013-07-12 09:30:50.551459439 +0100
++++ tigervnc-1.3.0/unix/xserver/hw/vnc/InputXKB.cc     2013-07-12 09:38:31.037480528 +0100
+@@ -232,10 +232,7 @@ void InputDevice::PrepareInputDevices(vo
+ unsigned InputDevice::getKeyboardState(void)
+ {
+-      DeviceIntPtr master;
+-
+-      master = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT);
+-      return XkbStateFieldFromRec(&master->key->xkbInfo->state);
++      return XkbStateFieldFromRec(&keyboardDev->master->key->xkbInfo->state);
+ }
+ unsigned InputDevice::getLevelThreeMask(void)
+@@ -256,7 +253,7 @@ unsigned InputDevice::getLevelThreeMask(
+                       return 0;
+       }
+-      xkb = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
++      xkb = keyboardDev->master->key->xkbInfo->desc;
+       act = XkbKeyActionPtr(xkb, keycode, state);
+       if (act == NULL)
+@@ -281,7 +278,7 @@ KeyCode InputDevice::pressShift(void)
+       if (state & ShiftMask)
+               return 0;
+-      xkb = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
++      xkb = keyboardDev->master->key->xkbInfo->desc;
+       for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
+               XkbAction *act;
+               unsigned char mask;
+@@ -318,7 +315,7 @@ std::list<KeyCode> InputDevice::releaseS
+       if (!(state & ShiftMask))
+               return keys;
+-      master = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT);
++      master = keyboardDev->master;
+       xkb = master->key->xkbInfo->desc;
+       for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
+               XkbAction *act;
+@@ -371,7 +368,7 @@ KeyCode InputDevice::pressLevelThree(voi
+                       return 0;
+       }
+-      xkb = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
++      xkb = keyboardDev->master->key->xkbInfo->desc;
+       act = XkbKeyActionPtr(xkb, keycode, state);
+       if (act == NULL)
+@@ -399,7 +396,7 @@ std::list<KeyCode> InputDevice::releaseL
+       if (!(state & mask))
+               return keys;
+-      master = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT);
++      master = keyboardDev->master;
+       xkb = master->key->xkbInfo->desc;
+       for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
+               XkbAction *act;
+@@ -440,7 +437,7 @@ KeyCode InputDevice::keysymToKeycode(Key
+       if (new_state != NULL)
+               *new_state = state;
+-      xkb = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
++      xkb = keyboardDev->master->key->xkbInfo->desc;
+       for (key = xkb->min_key_code; key <= xkb->max_key_code; key++) {
+               unsigned int state_out;
+               KeySym dummy;
+@@ -497,7 +494,7 @@ bool InputDevice::isLockModifier(KeyCode
+       XkbDescPtr xkb;
+       XkbAction *act;
+-      xkb = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
++      xkb = keyboardDev->master->key->xkbInfo->desc;
+       act = XkbKeyActionPtr(xkb, keycode, state);
+       if (act == NULL)
+@@ -535,7 +532,7 @@ bool InputDevice::isAffectedByNumLock(Ke
+       if (numlock_keycode == 0)
+               return false;
+-      xkb = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT)->key->xkbInfo->desc;
++      xkb = keyboardDev->master->key->xkbInfo->desc;
+       act = XkbKeyActionPtr(xkb, numlock_keycode, state);
+       if (act == NULL)
+@@ -569,7 +566,7 @@ KeyCode InputDevice::addKeysym(KeySym ke
+       KeySym *syms;
+       KeySym upper, lower;
+-      master = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT);
++      master = keyboardDev->master;
+       xkb = master->key->xkbInfo->desc;
+       for (key = xkb->max_key_code; key >= xkb->min_key_code; key--) {
+               if (XkbKeyNumGroups(xkb, key) == 0)
diff --git a/tigervnc-ipv6.patch b/tigervnc-ipv6.patch
new file mode 100644 (file)
index 0000000..27fd737
--- /dev/null
@@ -0,0 +1,101 @@
+--- common/network/TcpSocket.cxx.orig  2010-02-12 03:19:32.000000000 -0600
++++ common/network/TcpSocket.cxx       2011-04-11 10:58:52.000000000 -0500
+@@ -339,9 +339,38 @@
+     return;
+   }
++  bool use_ipv6;
++  int af;
++#ifdef AF_INET6
++  // - localhostOnly will mean "127.0.0.1 only", no IPv6
++  if (use_ipv6 = !localhostOnly)
++    af = AF_INET6;
++  else
++    af = AF_INET;
++#else
++  use_ipv6 = false;
++  af = AF_INET;
++#endif
++
+   initSockets();
+-  if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+-    throw SocketException("unable to create listening socket", errorNumber);
++  if ((fd = socket(af, SOCK_STREAM, 0)) < 0) {
++    // - Socket creation failed
++    if (use_ipv6) {
++      // - We were trying to make an IPv6-capable socket - try again, but IPv4-only
++      use_ipv6 = false;
++      af = AF_INET;
++      fd = socket(af, SOCK_STREAM, 0);
++    }
++    if (fd < 0)
++      throw SocketException("unable to create listening socket", errorNumber);
++  } else {
++    // - Socket creation succeeded
++    if (use_ipv6) {
++      // - We made an IPv6-capable socket, and we need it to do IPv4 too
++      int opt = 0;
++      setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt));
++    }
++  }
+ #ifndef WIN32
+   // - By default, close the socket on exec()
+@@ -358,27 +387,39 @@
+   // - Bind it to the desired port
+   struct sockaddr_in addr;
+-  memset(&addr, 0, sizeof(addr));
+-  addr.sin_family = AF_INET;
+-
+-  if (localhostOnly) {
+-    addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+-  } else if (listenaddr != NULL) {
++  struct sockaddr_in6 addr6;
++  struct sockaddr *sa;
++  int sa_len;
++
++  if (use_ipv6) {
++    sa_len = sizeof(addr6);
++    memset(&addr6, 0, sa_len);
++    addr6.sin6_family = af;
++    addr6.sin6_port = htons(port);
++    sa = (struct sockaddr*) &addr6;
++  } else {
++    sa_len = sizeof(addr);
++    memset(&addr, 0, sa_len);
++    addr.sin_family = af;
++    addr.sin_port = htons(port);
++    if (localhostOnly)
++      addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
++    else if (listenaddr != NULL) {
+ #ifdef HAVE_INET_ATON
+-    if (inet_aton(listenaddr, &addr.sin_addr) == 0)
++      if (inet_aton(listenaddr, &addr.sin_addr) == 0)
+ #else
+-    /* Some systems (e.g. Windows) do not have inet_aton, sigh */
+-    if ((addr.sin_addr.s_addr = inet_addr(listenaddr)) == INADDR_NONE)
++        /* Some systems (e.g. Windows) do not have inet_aton, sigh */
++        if ((addr.sin_addr.s_addr = inet_addr(listenaddr)) == INADDR_NONE)
+ #endif
+-    {
+-      closesocket(fd);
+-      throw Exception("invalid network interface address: %s", listenaddr);
+-    }
+-  } else
+-    addr.sin_addr.s_addr = htonl(INADDR_ANY); /* Bind to 0.0.0.0 by default. */
+-
+-  addr.sin_port = htons(port);
+-  if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
++        {
++          closesocket(fd);
++          throw Exception("invalid network interface address: %s", listenaddr);
++        }
++    } else
++      addr.sin_addr.s_addr = htonl(INADDR_ANY); /* Bind to 0.0.0.0 by default. */
++    sa = (struct sockaddr*) &addr;
++  }
++  if (bind(fd, sa, sa_len) < 0) {
+     int e = errorNumber;
+     closesocket(fd);
+     throw SocketException("unable to bind listening socket", e);
diff --git a/tigervnc-ldnow.patch b/tigervnc-ldnow.patch
new file mode 100644 (file)
index 0000000..0db5d88
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am.ldnow tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am
+--- tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am.ldnow      2010-05-18 15:48:02.000000000 +0200
++++ tigervnc-1.0.90-20100721svn4113/unix/xserver/hw/vnc/Makefile.am    2010-07-21 17:05:45.242942531 +0200
+@@ -50,7 +50,7 @@ libvnc_la_CPPFLAGS = $(XVNC_CPPFLAGS) -I
+       -I$(top_srcdir)/hw/xfree86/os-support/bus \
+       -I$(includedir)/pixman-1 -I$(includedir)
+-libvnc_la_LDFLAGS = -module -avoid-version
++libvnc_la_LDFLAGS = -module -avoid-version -Wl,-z,now
+ libvnc_la_LIBADD = libvnccommon.la $(COMMON_LIBS)
diff --git a/tigervnc-pointersync.patch b/tigervnc-pointersync.patch
new file mode 100644 (file)
index 0000000..3ac8f2c
--- /dev/null
@@ -0,0 +1,25 @@
+diff -up tigervnc-1.3.0/unix/xserver/hw/vnc/Input.cc.pointersync tigervnc-1.3.0/unix/xserver/hw/vnc/Input.cc
+--- tigervnc-1.3.0/unix/xserver/hw/vnc/Input.cc.pointersync    2014-07-14 16:27:49.412251632 +0100
++++ tigervnc-1.3.0/unix/xserver/hw/vnc/Input.cc        2014-07-14 16:29:06.968643301 +0100
+@@ -1,5 +1,5 @@
+ /* Copyright (C) 2009 TightVNC Team
+- * Copyright (C) 2009 Red Hat, Inc.
++ * Copyright (C) 2009, 2014 Red Hat, Inc.
+  * Copyright 2013 Pierre Ossman for Cendio AB
+  *
+  * This is free software; you can redistribute it and/or modify
+@@ -202,6 +202,14 @@ void InputDevice::PointerMove(const rfb:
+ const rfb::Point &InputDevice::getPointerPos(void)
+ {
++      if (pointerDev != NULL) {
++              int x, y;
++
++              GetSpritePosition (pointerDev, &x, &y);
++              cursorPos.x = x;
++              cursorPos.y = y;
++      }
++
+       return cursorPos;
+ }
diff --git a/tigervnc-rh692048.patch b/tigervnc-rh692048.patch
new file mode 100644 (file)
index 0000000..310cb1b
--- /dev/null
@@ -0,0 +1,44 @@
+diff -up tigervnc-1.4.2/common/rfb/SecurityClient.cxx.rh692048 tigervnc-1.4.2/common/rfb/SecurityClient.cxx
+--- tigervnc-1.4.2/common/rfb/SecurityClient.cxx.rh692048      2015-02-12 18:32:50.168861186 +0000
++++ tigervnc-1.4.2/common/rfb/SecurityClient.cxx       2015-02-12 18:33:13.168003696 +0000
+@@ -49,7 +49,7 @@ StringParameter SecurityClient::secTypes
+ #endif
+  ")",
+ #ifdef HAVE_GNUTLS
+- "X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None",
++ "VeNCrypt,X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None",
+ #else
+  "VncAuth,None",
+ #endif
+diff -up tigervnc-1.4.2/common/rfb/Security.cxx.rh692048 tigervnc-1.4.2/common/rfb/Security.cxx
+--- tigervnc-1.4.2/common/rfb/Security.cxx.rh692048    2015-01-23 23:37:23.000000000 +0000
++++ tigervnc-1.4.2/common/rfb/Security.cxx     2015-02-12 18:32:50.168861186 +0000
+@@ -68,7 +68,6 @@ const std::list<rdr::U8> Security::GetEn
+   list<rdr::U8> result;
+   list<U32>::iterator i;
+-  result.push_back(secTypeVeNCrypt);
+   for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++)
+     if (*i < 0x100)
+       result.push_back(*i);
+@@ -106,8 +105,6 @@ bool Security::IsSupported(U32 secType)
+   for (i = enabledSecTypes.begin(); i != enabledSecTypes.end(); i++)
+     if (*i == secType)
+       return true;
+-  if (secType == secTypeVeNCrypt)
+-    return true;
+   return false;
+ }
+diff -up tigervnc-1.4.2/common/rfb/SecurityServer.cxx.rh692048 tigervnc-1.4.2/common/rfb/SecurityServer.cxx
+--- tigervnc-1.4.2/common/rfb/SecurityServer.cxx.rh692048      2015-02-12 18:32:50.168861186 +0000
++++ tigervnc-1.4.2/common/rfb/SecurityServer.cxx       2015-02-12 18:33:24.977076868 +0000
+@@ -43,7 +43,7 @@ StringParameter SecurityServer::secTypes
+ #endif
+  ")",
+ #ifdef HAVE_GNUTLS
+- "TLSVnc,VncAuth",
++ "VncAuth",
+ #else
+  "VncAuth",
+ #endif
diff --git a/tigervnc-xserver-1.17.patch b/tigervnc-xserver-1.17.patch
new file mode 100644 (file)
index 0000000..c5dd67b
--- /dev/null
@@ -0,0 +1,44 @@
+diff -up tigervnc-1.4.2/unix/xserver/hw/vnc/xorg-version.h.xserver117 tigervnc-1.4.2/unix/xserver/hw/vnc/xorg-version.h
+--- tigervnc-1.4.2/unix/xserver/hw/vnc/xorg-version.h.xserver117       2015-01-23 23:37:23.000000000 +0000
++++ tigervnc-1.4.2/unix/xserver/hw/vnc/xorg-version.h  2015-02-13 17:35:29.847294663 +0000
+@@ -48,8 +48,10 @@
+ #define XORG 115
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (16 * 100000) + (99 * 1000))
+ #define XORG 116
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (17 * 100000) + (99 * 1000))
++#define XORG 117
+ #else
+-#error "X.Org newer than 1.16 is not supported"
++#error "X.Org newer than 1.17 is not supported"
+ #endif
+ #endif
+diff -up tigervnc-1.4.2/unix/xserver/hw/vnc/xvnc.cc.xserver117 tigervnc-1.4.2/unix/xserver/hw/vnc/xvnc.cc
+--- tigervnc-1.4.2/unix/xserver/hw/vnc/xvnc.cc.xserver117      2015-01-23 23:37:23.000000000 +0000
++++ tigervnc-1.4.2/unix/xserver/hw/vnc/xvnc.cc 2015-02-13 17:35:27.963265774 +0000
+@@ -717,9 +717,9 @@ vfbInstallColormap(ColormapPtr pmap)
+       entries = pmap->pVisual->ColormapEntries;
+       pVisual = pmap->pVisual;
+-      ppix = (Pixel *)xalloc(entries * sizeof(Pixel));
+-      prgb = (xrgb *)xalloc(entries * sizeof(xrgb));
+-      defs = (xColorItem *)xalloc(entries * sizeof(xColorItem));
++      ppix = (Pixel *)malloc(entries * sizeof(Pixel));
++      prgb = (xrgb *)malloc(entries * sizeof(xrgb));
++      defs = (xColorItem *)malloc(entries * sizeof(xColorItem));
+       for (i = 0; i < entries; i++)  ppix[i] = i;
+       /* XXX truecolor */
+@@ -738,9 +738,9 @@ vfbInstallColormap(ColormapPtr pmap)
+       }
+       (*pmap->pScreen->StoreColors)(pmap, entries, defs);
+       
+-      xfree(ppix);
+-      xfree(prgb);
+-      xfree(defs);
++      free(ppix);
++      free(prgb);
++      free(defs);
+     }
+ }
diff --git a/tigervnc-xstartup.patch b/tigervnc-xstartup.patch
new file mode 100644 (file)
index 0000000..610511d
--- /dev/null
@@ -0,0 +1,46 @@
+diff -ur tigervnc-1.3.0.orig/unix/vncserver tigervnc-1.3.0/unix/vncserver
+--- tigervnc-1.3.0.orig/unix/vncserver 2013-07-18 16:37:54.000000000 +0000
++++ tigervnc-1.3.0/unix/vncserver      2013-07-21 21:01:17.590116481 +0000
+@@ -57,27 +57,13 @@
+ $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".
++       "# Uncomment the following two lines for normal desktop:\n\n".
++       "# unset SESSION_MANAGER\n".
++       "# exec /etc/X11/xinit/xinitrc\n\n".
++       "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n".
++       "[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources\n\n".
+        "xsetroot -solid grey\n".
++       "vncconfig -iconic &\n".
+        "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
+        "twm &\n");
+@@ -322,8 +308,6 @@
+ }
+ $ENV{VNCDESKTOP}= $desktopName;
+-system($exedir."vncconfig -iconic >> " . &quotedString($desktopLog) . " 2>&1 &");
+-
+ if ($opt{'-fg'}) {
+     system("$vncUserDir/xstartup >> " . &quotedString($desktopLog) . " 2>&1");
+     if (kill 0, `cat $pidFile`) {
diff --git a/tigervnc.desktop b/tigervnc.desktop
new file mode 100644 (file)
index 0000000..fab46f0
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=TigerVNC Viewer
+Name[fr]=Visionneur TigerVNC
+Comment=Connect to VNC server and display remote desktop
+Comment[fr]=Se connecter à un serveur VNC et afficher le bureau distant
+Exec=/usr/bin/vncviewer
+Icon=tigervnc
+Terminal=false
+Type=Application
+StartupWMClass=TigerVNC Viewer: Connection Details
+Categories=Network;RemoteAccess;
diff --git a/tigervnc.spec b/tigervnc.spec
new file mode 100644 (file)
index 0000000..8342cf3
--- /dev/null
@@ -0,0 +1,356 @@
+%define                xversion        1.16.0
+
+Summary:       A TigerVNC remote display system
+Summary(pl.UTF-8):     System zdalnego dostępu TigerVNC
+Name:          tigervnc
+Version:       1.4.3
+Release:       2
+License:       GPL v2
+Group:         X11/Applications/Networking
+Source0:       https://github.com/TigerVNC/tigervnc/archive/v%{version}.tar.gz?/%{name}-%{version}.tar.gz
+# Source0-md5: 2177ee42fa1a3902b6feeaa7747f1c2a
+Source1:       %{name}.desktop
+Source2:       vncserver.init
+Source3:       vncserver.sysconfig
+Source4:       vncserver.target
+Source5:       vncserver-service-generator
+Patch0:                %{name}-cookie.patch
+Patch1:                %{name}-ldnow.patch
+Patch3:                %{name}-as-needed.patch
+Patch4:                %{name}-ipv6.patch
+Patch5:                %{name}-rh692048.patch
+Patch6:                no-bashizm.patch
+Patch7:                format-security.patch
+Patch8:                tigervnc-xstartup.patch
+Patch9:                xserver.patch
+Patch10:       tigervnc-getmaster.patch
+Patch11:       tigervnc-xserver-1.17.patch
+URL:           http://www.tigervnc.com/
+BuildRequires: ImageMagick
+BuildRequires: ImageMagick-coder-png
+BuildRequires: ImageMagick-coder-svg
+BuildRequires: Mesa-libGL-devel >= 7.8.1
+BuildRequires: cpp
+BuildRequires: fltk-devel
+BuildRequires: gnutls-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: xorg-xserver-server-source >= %{xversion}
+BuildRequires: zlib-devel
+# xserver BRs, should match xorg-xserver-server.spec
+# for glx headers
+BuildRequires: OpenGL-GLX-devel
+BuildRequires: autoconf >= 2.57
+BuildRequires: automake
+BuildRequires: libdrm-devel >= 2.4.5
+BuildRequires: libtool
+BuildRequires: nasm
+BuildRequires: ncurses-devel
+BuildRequires: pam-devel
+BuildRequires: perl-base
+BuildRequires: pixman-devel >= 0.16.0
+BuildRequires: pkgconfig >= 1:0.19
+BuildRequires: rpmbuild(macros) >= 1.647
+BuildRequires: xorg-app-mkfontscale
+BuildRequires: xorg-font-font-util >= 1.1
+BuildRequires: xorg-lib-libX11-devel
+BuildRequires: xorg-lib-libXau-devel
+BuildRequires: xorg-lib-libXaw-devel
+BuildRequires: xorg-lib-libXdamage-devel
+BuildRequires: xorg-lib-libXdmcp-devel
+BuildRequires: xorg-lib-libXext-devel >= 1.0.99.4
+BuildRequires: xorg-lib-libXfont-devel >= 1.4.2
+BuildRequires: xorg-lib-libXi-devel >= 1.2.99.1
+BuildRequires: xorg-lib-libXmu-devel
+BuildRequires: xorg-lib-libXpm-devel
+BuildRequires: xorg-lib-libXrender-devel
+BuildRequires: xorg-lib-libXres-devel
+BuildRequires: xorg-lib-libXt-devel >= 1.0.0
+BuildRequires: xorg-lib-libXtst-devel >= 1.0.99.2
+BuildRequires: xorg-lib-libXv-devel
+BuildRequires: xorg-lib-libXxf86dga-devel
+BuildRequires: xorg-lib-libXxf86misc-devel
+BuildRequires: xorg-lib-libXxf86vm-devel
+BuildRequires: xorg-lib-libfontenc-devel
+BuildRequires: xorg-lib-libpciaccess-devel >= 0.13
+BuildRequires: xorg-lib-libxkbfile-devel
+BuildRequires: xorg-lib-libxkbui-devel >= 1.0.2
+BuildRequires: xorg-lib-libxshmfence-devel >= 1.1
+BuildRequires: xorg-lib-xtrans-devel >= 1.2.2
+BuildRequires: xorg-proto-bigreqsproto-devel >= 1.1.0
+BuildRequires: xorg-proto-damageproto-devel >= 1.1
+BuildRequires: xorg-proto-dri3proto-devel >= 1.0
+BuildRequires: xorg-proto-fixesproto-devel >= 4.1
+BuildRequires: xorg-proto-fontcacheproto-devel
+BuildRequires: xorg-proto-fontsproto-devel
+BuildRequires: xorg-proto-glproto-devel >= 1.4.10
+BuildRequires: xorg-proto-inputproto-devel >= 1.9.99.902
+BuildRequires: xorg-proto-kbproto-devel >= 1.0.3
+BuildRequires: xorg-proto-presentproto-devel >= 1.0
+BuildRequires: xorg-proto-printproto-devel
+BuildRequires: xorg-proto-randrproto-devel >= 1.3
+BuildRequires: xorg-proto-recordproto-devel
+BuildRequires: xorg-proto-renderproto-devel >= 0.11
+BuildRequires: xorg-proto-resourceproto-devel
+BuildRequires: xorg-proto-scrnsaverproto-devel >= 1.1.0
+BuildRequires: xorg-proto-videoproto-devel
+BuildRequires: xorg-proto-xcmiscproto-devel >= 1.2.0
+BuildRequires: xorg-proto-xextproto-devel >= 1:7.0.99.3
+BuildRequires: xorg-proto-xf86bigfontproto-devel >= 1.2.0
+BuildRequires: xorg-proto-xf86dgaproto-devel >= 2.0.99.1
+BuildRequires: xorg-proto-xf86driproto-devel >= 2.1.0
+BuildRequires: xorg-proto-xf86miscproto-devel
+BuildRequires: xorg-proto-xf86vidmodeproto-devel >= 2.2.99.1
+BuildRequires: xorg-proto-xproto-devel >= 7.0.22
+BuildRequires: xorg-util-util-macros >= 1.10
+Requires(post,postun): gtk-update-icon-cache
+Requires(post,postun): hicolor-icon-theme
+Requires:      libjpeg-turbo
+Provides:      vnc-client
+Conflicts:     vnc
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define                _xserverver     %(LC_ALL=C rpm -q --qf '%{V}' xorg-xserver-server-source 2> /dev/null)
+
+%description
+TigerVNC is a suite of VNC servers and clients that have a focus on
+performance and remote display functionality. Originally this software
+was based on the (never released) VNC 4 branch of TightVNC.
+
+%description -l pl.UTF-8
+TigerVNC to zestaw serwerów i klientów VNC, które koncentrują się
+na wydajności i funkcjonalności zdalnego wyświetlania. Pierwotnie
+oprogramowanie oparte było na (nigdy nie wydanej)
+gałęzi VNC 4 TightVNC.
+
+%package server
+Summary:       VNC X server - TigerVNC version
+Summary(pl.UTF-8):     X serwer VNC - wersja TigerVNC
+Group:         X11/Applications/Networking
+Requires(post,preun):  /sbin/chkconfig
+Requires(post,preun,postun):   systemd-units >= 38
+Requires:      xorg-app-rgb
+# for vncpasswd tool
+Requires:      %{name}-utils = %{version}-%{release}
+# for mcookie
+Requires:      util-linux
+Requires:      libjpeg-turbo
+Requires:      systemd-units >= 38
+Requires:      xkeyboard-config
+Requires:      xorg-app-xauth
+Requires:      xorg-app-xkbcomp
+Obsoletes:     vnc-server
+
+%description server
+This package contains VNC X server in TigerVNC version.
+
+%description server -l pl.UTF-8
+Ten pakiet zawiera X serwer VNC w wersji TigerVNC.
+
+%package utils
+Summary:       Additional utilities for TigerVNC
+Summary(pl.UTF-8):     Dodatkowe narzędzia do TigerVNC
+Group:         X11/Applications/Networking
+Obsoletes:     vnc-utils
+
+%description utils
+This package contains additional TigerVNC utilities: vncconfig and
+vncpasswd. vncconfig is used to configure and control a running
+instance of Xvnc, or any other X server with the VNC extension.
+vncpasswd generates password file (both on server and viewer side).
+
+%description utils -l pl.UTF-8
+Ten pakiet zawiera dodatkowe narzędzia do tightvnc: vncconfig i
+vncpasswd. vncconfig służy do konfigurowania i kontroli działającej
+instancji Xvnc lub innego serwera X z rozszerzeniem VNC.
+vncpasswd służy to tworzenia pliku z hasłem (zarówno po
+stronie serwera, jak i przeglądarki).
+
+%package -n xorg-xserver-libvnc
+Summary:       TigerVNC module for X.org server
+Summary(pl.UTF-8):     Moduł TigerVNC dla servera X.org
+Group:         X11/Servers
+%requires_eq_to        xorg-xserver-server xorg-xserver-server-source
+Provides:      xorg-xserver-module(vnc)
+
+%description -n xorg-xserver-libvnc
+This package contains libvnc.so module for X.org server,
+allowing others to access the desktop on your machine.
+
+%description -n xorg-xserver-libvnc -l pl.UTF-8
+Ten pakiet zawiera moduł libvnc.so dla serwera X.org,
+pozwalający na zdalny dostęp do pulpitu.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch3 -p1
+%patch4 -p0
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch10 -p1
+%patch11 -p1
+
+cp -a %{_usrsrc}/xorg-xserver-server-%{_xserverver}/* unix/xserver
+cd unix/xserver
+%patch9 -p1
+
+%build
+%cmake .
+%{__make} -j1
+
+cd unix/xserver
+%{__aclocal} -I m4
+%{__autoconf}
+%{__automake}
+export CXXFLAGS="%{rpmcxxflags} -fpermissive"
+%configure \
+       --with-os-name="PLD/Linux" \
+       --with-os-vendor="PLD/Team" \
+       --disable-config-dbus \
+       --disable-config-hal \
+       --disable-config-udev \
+       --without-xmlto \
+       --without-fop \
+       --without-doxygen \
+       --disable-devel-docs \
+       --with-default-font-path="%{_fontsdir}/misc,%{_fontsdir}/TTF,%{_fontsdir}/OTF,%{_fontsdir}/Type1,%{_fontsdir}/100dpi,%{_fontsdir}/75dpi" \
+       --disable-xorg \
+       --disable-xnest \
+       --disable-xvfb \
+       --disable-dmx \
+       --disable-xwin \
+       --disable-xephyr \
+       --disable-kdrive \
+       --disable-xfbdev \
+       --disable-dri \
+       --enable-dri2 \
+       --enable-dri3 \
+       --with-pic \
+       --disable-static \
+       --disable-xinerama \
+       --disable-composite \
+       --disable-wayland \
+       --disable-xwayland \
+       --enable-glx \
+       --enable-glx-tls \
+       --enable-aiglx \
+       --enable-dga \
+       --enable-glx-tls \
+       --enable-install-libxf86config \
+       --enable-record \
+       --disable-xfake \
+       --enable-secure-rpc \
+       --with-xkb-output=/var/lib/xkb \
+       --disable-unit-tests
+
+%{__make} -j1
+cd -
+
+cd media
+%{__make} -j1
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/{16x16,22x22,24x24,32x32,48x48,scalable}/apps \
+       $RPM_BUILD_ROOT%{_desktopdir}
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+cd unix/xserver/hw/vnc
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+cd -
+
+install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
+
+install media/icons/tigervnc_16.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/16x16/apps/tigervnc.png
+install media/icons/tigervnc_22.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/22x22/apps/tigervnc.png
+install media/icons/tigervnc_24.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/24x24/apps/tigervnc.png
+install media/icons/tigervnc_32.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/32x32/apps/tigervnc.png
+install media/icons/tigervnc_48.png $RPM_BUILD_ROOT%{_iconsdir}/hicolor/48x48/apps/tigervnc.png
+install media/icons/tigervnc.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/tigervnc.svg
+
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/vncserver
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/vncserver
+
+install -d $RPM_BUILD_ROOT{%{systemdunitdir},/lib/systemd/system-generators}
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/vncserver.target
+install -p %{SOURCE5} $RPM_BUILD_ROOT/lib/systemd/system-generators/vncserver-service-generator
+ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/vncserver.service
+
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}
+
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+[ ! -x /usr/bin/update-desktop-database ] || %update_desktop_database_post
+%update_icon_cache hicolor
+
+%postun
+[ ! -x /usr/bin/update-desktop-database ] || %update_desktop_database_postun
+%update_icon_cache hicolor
+
+%post server
+/sbin/chkconfig --add vncserver
+%service vncserver restart "VNC server"
+NORESTART=1
+%systemd_post vncserver.target
+
+%preun server
+if [ "$1" = "0" ]; then
+       %service vncserver stop
+       /sbin/chkconfig --del vncserver
+fi
+%systemd_preun vncserver.target
+
+%postun server
+%systemd_reload
+
+%triggerpostun server -- tigervnc-server < 1.3.0-5
+[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
+[ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && return 1
+export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
+if [ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]vncserver)" != "/etc/rc.d/rc[0-6].d/S[0-9][0-9]vncserver" ]; then
+       /bin/systemctl --quiet enable vncserver.target || :
+fi
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc README.txt doc/*
+%attr(755,root,root) %{_bindir}/vncviewer
+%{_mandir}/man1/vncviewer.1*
+%{_desktopdir}/tigervnc.desktop
+%{_iconsdir}/hicolor/*/apps/tigervnc.*
+
+%files server
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/Xvnc
+%attr(755,root,root) %{_bindir}/vncserver
+%attr(755,root,root) %{_bindir}/x0vncserver
+%attr(754,root,root) /etc/rc.d/init.d/vncserver
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/vncserver
+%attr(755,root,root) /lib/systemd/system-generators/vncserver-service-generator
+%{systemdunitdir}/vncserver.target
+%{systemdunitdir}/vncserver.service
+%{_mandir}/man1/Xvnc.1*
+%{_mandir}/man1/vncserver.1*
+%{_mandir}/man1/x0vncserver.1*
+
+%files utils
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/vncconfig
+%attr(755,root,root) %{_bindir}/vncpasswd
+%{_mandir}/man1/vncconfig.1*
+%{_mandir}/man1/vncpasswd.1*
+
+%files -n xorg-xserver-libvnc
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/xorg/modules/extensions/libvnc.so
diff --git a/vncserver-service-generator b/vncserver-service-generator
new file mode 100755 (executable)
index 0000000..cdb5b42
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+destunitdir=${1:-/tmp}
+
+# Do nothing if vncserver target is disabled
+[ -e /etc/systemd/system/multi-user.target.wants/vncserver.target ] || exit 0
+
+VNCSERVERS=""
+[ -f /etc/sysconfig/vncserver ] && . /etc/sysconfig/vncserver
+
+if [ -d $destunitdir/vncserver.target.wants ]; then
+       rm -f $destunitdir/vncserver.target.wants/vncserver@*.service
+else
+       mkdir -p $destunitdir/vncserver.target.wants
+fi
+
+for display in $VNCSERVERS; do
+       DISP="${display%%:*}"
+       USER="${display##*:}"
+       if [ "x$USER" == "xroot" ]; then
+               echo "-- Do not run vncserver as root!"
+               continue
+       fi
+       VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
+       if [ ! id $USER >/dev/null 2>&1 ]; then
+               echo "-- User $USER does not exists!"
+               continue
+       fi
+       USERHOME=$(eval "echo ~$USER")
+       if [ ! -f "$USERHOME/.vnc/passwd" ]; then
+               echo "-- No password file found for user $USER!"
+               continue
+       fi
+       cat >$destunitdir/vncserver.target.wants/vncserver@$DISP.service <<EOF
+[Unit]
+Description=Remote desktop service (VNC) on display %i
+Requires=vncserver.target
+After=vncserver.target
+PropagateReloadFrom=vncserver.target
+
+[Service]
+Type=simple
+ExecStart=/sbin/runuser -l $USER -c "/usr/bin/vncserver -fg :%i $VNCUSERARGS"
+ExecStop=/sbin/runuser -l $USER -c "/usr/bin/vncserver -kill :%i"
+
+[Install]
+WantedBy=vncserver.target
+EOF
+done
diff --git a/vncserver.init b/vncserver.init
new file mode 100755 (executable)
index 0000000..afa4f23
--- /dev/null
@@ -0,0 +1,122 @@
+#!/bin/sh
+#
+# vncserver    Starts/stop VNC server
+#
+# chkconfig:   345 91 35
+#
+# description: Starts and stops vncserver.
+#              Used to provide remote X administration services.
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+VNCSERVERS=""
+[ -f /etc/sysconfig/vncserver ] && . /etc/sysconfig/vncserver
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down vncserver
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+start() {
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/vncserver ]; then
+               msg_already_running vncserver
+               return
+       fi
+
+       ulimit -S -c 0 >/dev/null 2>&1
+       RETVAL=0
+
+       if [ ! -d /tmp/.X11-unix ]; then
+               mkdir -m 1777 /tmp/.X11-unix || :
+               restorecon /tmp/.X11-unix 2>/dev/null || :
+       fi
+
+       NOSERV=1
+       for display in $VNCSERVERS; do
+               msg_starting "vncserver ($display)"
+               NOSERV=0
+               DISP="${display%%:*}"
+               USER="${display##*:}"
+               if [ "x$USER" == "xroot" ]; then
+                       fail
+                       echo "-- Do not run vncserver as root!"
+                       continue
+               fi
+               VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
+               USEREXISTS=`cat /etc/passwd | awk -F: "{ if (\"$USER\"==\\\$1) print \"yes\" }"`
+               if [ "x$USEREXISTS" != "xyes" ]; then
+                       fail
+                       echo "-- User $USER does not exists!"
+                       continue
+               fi
+               USERHOME=`runuser $USER -c 'echo $HOME'`
+               if [ ! -f "$USERHOME/.vnc/passwd" ]; then
+                       fail
+                       echo "-- No password file found for user $USER!"
+                       continue
+               fi
+               export USER VNCUSERARGS
+               daemon --user ${USER} "vncserver :${DISP} ${VNCUSERARGS}"
+               RETVAL=$?
+               [ "$RETVAL" -eq 0 ] && echo $display >> /var/lock/subsys/vncserver
+       done
+}
+
+stop() {
+       if [ ! -f /var/lock/subsys/vncserver ]; then
+               msg_not_running vncserver
+               return
+       fi
+
+       # Stop daemons.
+       ERRDISP=""
+       for display in `cat /var/lock/subsys/vncserver`
+       do
+               msg_stopping "vncserver ($display)"
+               export USER="${display##*:}"
+               runuser ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
+               RETVAL=$?
+               [ "$RETVAL" -eq 0 ] && ok && continue
+               fail
+               ERRDISP="$ERRDISP $display"
+       done
+       rm -f /var/lock/subsys/vncserver
+       [ "x$ERRDISP" != "x" ] && echo "$ERRDISP" > /var/lock/subsys/vncserver
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       sleep 5
+       start
+       exit $?
+       ;;
+  status)
+       status Xvnc
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|status}"
+       exit 3
+esac
+
+exit $RETVAL
diff --git a/vncserver.sysconfig b/vncserver.sysconfig
new file mode 100644 (file)
index 0000000..af9f9b4
--- /dev/null
@@ -0,0 +1,23 @@
+# The VNCSERVERS variable is a list of display:user pairs.
+#
+# Uncomment the lines below to start a VNC server on display :2
+# as my 'myusername' (adjust this to your own).  You will also
+# need to set a VNC password; run 'man vncpasswd' to see how
+# to do that.
+#
+# DO NOT RUN THIS SERVICE if your local area network is untrusted!
+
+# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
+
+# Use "-localhost" to prevent remote VNC clients connecting except when
+# doing so through a secure tunnel.  See the "-via" option in the
+# 'man vncviewer' manual page.
+
+# On systems running systemd after updating the list below you have to
+# restart systemd to regenerate vncserver@DISPLAY.service services
+# (systemctl --system daemon-reload), stop and start vncserver.target when
+# removing elements from list or restart vncserver.target when only adding
+# elements (systemctl stop vncserver.target / systemctl restart vncserver.target).
+
+# VNCSERVERS="2:myusername"
+# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
diff --git a/vncserver.target b/vncserver.target
new file mode 100644 (file)
index 0000000..340c623
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Start VNC server daemons
+After=network.target
+Wants=network.target
+
+[Install]
+WantedBy=multi-user.target
diff --git a/xserver.patch b/xserver.patch
new file mode 100644 (file)
index 0000000..f418680
--- /dev/null
@@ -0,0 +1,84 @@
+diff -up xserver/configure.ac.vnc xserver/configure.ac
+--- xserver/configure.ac.vnc   2012-08-28 15:35:23.778810954 +0200
++++ xserver/configure.ac       2012-08-28 15:54:46.396743431 +0200
+@@ -73,6 +72,7 @@ dnl forcing an entire recompile.x
+ AC_CONFIG_HEADERS(include/version-config.h)
+ AM_PROG_AS
++AC_PROG_CXX
+ AC_PROG_LN_S
+ AC_LIBTOOL_WIN32_DLL
+ AC_DISABLE_STATIC
+@@ -1561,6 +1561,10 @@ if test "x$XVFB" = xyes; then
+       AC_SUBST([XVFB_SYS_LIBS])
+ fi
++dnl Xvnc DDX
++AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
++AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $PRESENT_LIB $DRI3_LIB"])
++AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
+ dnl Xnest DDX
+@@ -1596,6 +1600,8 @@ if test "x$XORG" = xauto; then
+ fi
+ AC_MSG_RESULT([$XORG])
++AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
++
+ if test "x$XORG" = xyes; then
+       XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
+       XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
+@@ -1815,7 +1821,6 @@ if test "x$XORG" = xyes; then
+       AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
+       AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
+       AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
+-      AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
+       AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
+       AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
+       AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
+@@ -2280,6 +2285,7 @@ hw/dmx/Makefile
+ hw/dmx/man/Makefile
+ hw/vfb/Makefile
+ hw/vfb/man/Makefile
++hw/vnc/Makefile
+ hw/xnest/Makefile
+ hw/xnest/man/Makefile
+ hw/xwin/Makefile
+diff -up xserver/hw/Makefile.am.vnc xserver/hw/Makefile.am
+--- xserver/hw/Makefile.am.vnc 2012-08-28 15:35:23.856810890 +0200
++++ xserver/hw/Makefile.am     2012-08-28 15:35:42.272795917 +0200
+@@ -33,7 +33,8 @@ SUBDIRS =                    \
+       $(DMX_SUBDIRS)          \
+       $(KDRIVE_SUBDIRS)       \
+       $(XQUARTZ_SUBDIRS)      \
+-      $(XWAYLAND_SUBDIRS)
++      $(XWAYLAND_SUBDIRS)     \
++      vnc
+ DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
+diff -up xserver/mi/miinitext.c.vnc xserver/mi/miinitext.c
+--- xserver/mi/miinitext.c.vnc 2012-08-28 15:35:23.000000000 +0200
++++ xserver/mi/miinitext.c     2012-09-05 15:07:40.714953972 +0200
+@@ -112,6 +112,10 @@ SOFTWARE.
+ #include "micmap.h"
+ #include "globals.h"
++#ifdef TIGERVNC
++extern void vncExtensionInit(INITARGS);
++#endif
++
+ /* The following is only a small first step towards run-time
+  * configurable extensions.
+  */
+@@ -299,6 +303,9 @@ static ExtensionModule staticExtensions[
+ #ifdef XSELINUX
+     {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension},
+ #endif
++#ifdef TIGERVNC
++    {vncExtensionInit, "VNC-EXTENSION", NULL},
++#endif
+ };
+ static ExtensionModule *ExtensionModuleList = NULL;