#!/bin/bash # tightvnc.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter for ARMedslack. # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/source/$PKGNAM* export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKCFLAGS="-O2 -march=armv4 -mtune=xscale" ;; powerpc) export SLKCFLAGS="-O2" ;; sparc) export SLKCFLAGS="-O2" ;; hppa) export SLKCFLAGS="-O2" ;; *) export SLKCFLAGS="-O2" ;; esac # Extract source: tar xvvf $CWD/tightvnc-${VERSION}_unixsrc.tar.xz cd vnc_unixsrc slackhousekeeping # Explode the package framework: cd $PKG explodepkg $CWD/_$PKGNAM.tar.gz cd - # Make vncserver use sane pathnames and executable permissions: zcat $CWD/tightvnc.paths-and-perms.diff.gz | patch -p1 --verbose || exit 1 # Use xinit's Xclients script to start the session: cat vnc-xclients.patch | sed -e 's/Red Hat /Slackware /' | patch || exit 1 # ARM patch: patch --verbose -p1 < $PORTCWD/sources/1.3.9-arm.patch || exit 1 patch --verbose -p1 < $PORTCWD/sources/tightvnc-1.3.8-imake-tmpdir.patch || exit 1 patch --verbose -p1 < $PORTCWD/sources/tightvnc-1.3.8-mips.patch || exit 1 xmkmf -a make CDEBUGFLAGS="$SLKCFLAGS" World || exit 1 cd Xvnc LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure make EXTRA_LIBRARIES="-lwrap -lnss_nis" CDEBUGFLAGS="$SLKCFLAGS" \ EXTRA_DEFINES="-DUSE_LIBWRAP=1" cd - # end 'cd Xvnc' # Manually install files: mkdir -p $PKG/usr/bin $PKG/usr/man/man1 ./vncinstall $PKG/usr/bin $PKG/usr/man mkdir -p $PKG/usr/share/tightvnc cp -aR classes $PKG/usr/share/tightvnc/ mkdir $PKG/etc cp -a tightvncserver.conf $PKG/etc/tightvncserver.conf.new # Add documentation: mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION cp -a \ LICENCE.TXT README WhatsNew ChangeLog \ $PKG/usr/doc/$PKGNAM-$VERSION mv $PKG/install/README.1st $PKG/usr/doc/$PKGNAM-$VERSION # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh # /extra has packages in separate dirs: export PKGSERIES=$PKGSERIES/$PKGNAM slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links