# Description: enhanced version of the VNC client/server protocol
# URL: http://www.tightvnc.org
# Maintainer: Jose V Beneyto, sepen at crux dot nu
# Packager: sten, nick dot steeves at shaw dot ca
# Depends on: libjpeg-turbo xorg-libxaw xorg-gccmakedep,xorg-imake

name=tightvnc
version=1.3.10
release=2
source=(http://download.sourceforge.net/vnc-tight/$name-${version}_unixsrc.tar.bz2 \
        $name-config.patch)

build() {
  cd vnc_unixsrc
  patch -p0 -i $SRC/$name-config.patch
  
  xmkmf -a
  
  make Makefiles
  find . -name "Makefile" -exec sed -i -e 's/-lXp$//g' '{}' \;
  make depend
  make all
  
  cd Xvnc
  
  ./configure
  make -j1
  
  cd ..
  
  mkdir -p $PKG/usr/man/man1 $PKG/usr/bin $PKG/usr/share/vnc/classes
  cp Xvnc/programs/Xserver/Xvnc vncviewer/vncviewer vncpasswd/vncpasswd \
     vncconnect/vncconnect vncserver $PKG/usr/bin
  cp classes/* $PKG/usr/share/vnc/classes
  cp Xvnc/programs/Xserver/Xvnc.man $PKG/usr/man/man1/Xvnc.1
  cp vncserver.man $PKG/usr/man/man1/vncserver.1
  cp vncviewer/vncviewer.man $PKG/usr/man/man1/vncviewer.1
  cp vncpasswd/vncpasswd.man $PKG/usr/man/man1/vncpasswd.1
  cp vncconnect/vncconnect.man $PKG/usr/man/man1/vncconnect.1
}