]> source.dussan.org Git - tigervnc.git/commitdiff
Modify Mac packaging to accommodate VeNCrypt-enabled builds or other customizations...
authorDRC <dcommander@users.sourceforge.net>
Wed, 9 Feb 2011 03:10:44 +0000 (03:10 +0000)
committerDRC <dcommander@users.sourceforge.net>
Wed, 9 Feb 2011 03:10:44 +0000 (03:10 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4265 3789f03b-4d11-0410-bbf8-ca57d06f2519

Makefile.am
configure.ac
release/BUILDING.txt
release/makemacpkg [deleted file]
release/makemacpkg.in [new file with mode: 0644]

index 5d26f4c3bb43e9991fa9599f70693025ea262d59..ea947a51941e7c717f7f80b544e53f58f26011fd 100644 (file)
@@ -11,13 +11,12 @@ ACLOCAL_AMFLAGS = -I m4
 if X86_64
 
 udmg: all
-       sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
-               ${srcdir} universal
+       sh makemacpkg universal ${BUILDDIR32}
 
 endif
 
 dmg: all
-       sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} ${srcdir}
+       sh makemacpkg
 
 EXTRA_DIST = CMakeLists.txt cmakescripts/getdate.bat LICENCE.TXT \
        doc java media release config.h.cmake.in
index d13ecbdde79596ec3c990f12f8666de79ab647ef..80d36e3fdafc89bb5f9ef8df598c03804cf44d14 100644 (file)
@@ -223,6 +223,8 @@ AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64"])
 
 AC_SUBST(BUILD)
 
+AC_CONFIG_FILES([makemacpkg:release/makemacpkg.in])
+
 AC_OUTPUT([
 Makefile
 common/Makefile
index 6c08bc31dd1cc5cd7da0992f15799cec6d04d9bc..3f580815b1653f2fe2700554a76ea102db001988 100644 (file)
@@ -37,6 +37,9 @@ Build Requirements
    * zlib v1.2 or later
    * OpenSSL v0.9.7 or later
 
+-- If building VeNCrypt support:
+   * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
+
 
 ==================
 Out-of-Tree Builds
@@ -58,8 +61,8 @@ Building TigerVNC
 
 The following procedure will build the TigerVNC viewer on Linux and Unix
 systems.  On 64-bit systems, this may build a 32-bit version of TigerVNC,
-depending on the default compiler configuration for your system.  See below for
-specific build instructions for 64-bit systems.
+depending on the default autotools configuration for your system.  See below
+for specific build instructions for 64-bit systems.
 
   cd {source_directory}
   autoreconf -fiv
@@ -110,9 +113,9 @@ will clean both the Xvnc and vncviewer builds without destroying any of the
 build configuration or module dependencies.
 
 
-==================================
-Build Recipes for Specific Systems
-==================================
+==================
+Unix Build Recipes
+==================
 
 
 32-bit Build on 64-bit Linux
@@ -178,27 +181,39 @@ Add
 to the configure command line.  The OS X 10.4 SDK must be installed.
 
 
-Building VeNCrypt support on OS X
----------------------------------
-
-VeNCrypt requires GnuTLS, which is not available on OS X systems by default.
-However, it can be obtained from MacPorts (http://www.macports.org/).  The
-easiest way to build TigerVNC using this version of GnuTLS is simply to
-modify the CPATH and LIBRARY_PATH environment variables to include /opt/local,
-i.e.:
-
-export CPATH=/opt/local/include
-export LIBRARY_PATH=/opt/local/lib
-
-and then build TigerVNC as you would normally.  However, this produces run-time
-dependencies on the .dylib files in /opt/local/lib.  To statically link with
-GnuTLS, add the following monstrosity to the configure command line:
+Building VeNCrypt support
+-------------------------
 
-  GNUTLS_CFLAGS=-I/opt/local/include \
-    GNUTLS_LDFLAGS='/opt/local/lib/libgnutls.a /opt/local/lib/libgcrypt.a \
-    /opt/local/lib/libgpg-error.a /opt/local/lib/libz.a \
-    /opt/local/lib/libtasn1.a /opt/local/lib/libiconv.a \
-    /opt/local/lib/libintl.a -framework CoreFoundation'
+Building VeNCrypt (the TigerVNC security and authentication extensions)
+requires GnuTLS, which is not pre-installed on all platforms.  In general, if
+you are building on a Unix-ish platform that has the GnuTLS libraries and
+include files installed in the standard system locations, then the TigerVNC
+build system should detect the system version of GnuTLS automatically and link
+against it.  However, this produces a version of TigerVNC that depends on the
+GnuTLS dynamic libraries, and thus the binaries are not portable.
+
+To build a fully portable, cross-compatible version of TigerVNC with VeNCrypt
+support, it is necessary to link against the GnuTLS static library (as well
+as the static libraries of its dependencies.)  If you are lucky enough, your
+O/S distribution may include pre-packaged versions of both the static and
+dynamic libraries for GnuTLS and its dependencies.  Otherwise, it will probably
+be necessary to build GnuTLS, libgcrypt, libtasn1, and libgpg-error from
+source.
+
+You can manipulate the GNUTLS_CFLAGS and GNUTLS_LDFLAGS configure variables to
+accommodate a custom build of GnuTLS that is installed in a non-system
+directory.  For instance, adding
+
+  GNUTLS_CFLAGS=-I/opt/gnutls/include \
+    GNUTLS_LDFLAGS='/opt/gnutls/lib/libgnutls.a /opt/gnutls/lib/libgcrypt.a \
+    /opt/gnutls/lib/libgpg-error.a /opt/gnutls/lib/libtasn1.a' \
+    --with-included-zlib
+
+to the configure or build-xorg command line will cause TigerVNC to be
+statically linked against a custom installation of GnuTLS that resides under
+/opt/gnutls.  GnuTLS depends on zlib, so specifying --with-included-zlib will
+satisfy that depency using TigerVNC's in-source version of zlib, which
+eliminates another dynamic library dependency.
 
 
 *******************************************************************************
@@ -251,6 +266,9 @@ Build Requirements
    C:\Program Files\Inno Setup 5) to the system or user PATH environment
    variable prior to building TigerVNC.
 
+-- If building VeNCrypt support:
+   * GnuTLS and its dependencies (libgcrypt, libtasn1, libgpg-error)
+
 
 ==================
 Out-of-Tree Builds
@@ -337,9 +355,9 @@ If you don't specify CMAKE_INSTALL_PREFIX, then the default is
 c:\Program Files\TigerVNC.
 
 
-=============
-Build Recipes
-=============
+=====================
+Windows Build Recipes
+=====================
 
 
 64-bit MinGW Build on Cygwin
@@ -420,14 +438,17 @@ make dmg
   Create Macintosh package/disk image.  This requires the PackageMaker
   application, which must be installed in /Developer/Applications/Utilities.
 
-make udmg
-
-  On 64-bit OS X (10.5 "Leopard") and later, this creates a version of the
-  Macintosh package/disk image which contains universal i386/x86-64 binaries.
-  The 32-bit fork of these binaries is backward compatible with OS X 10.4 and
-  later (OS X 10.4 compatibility SDK required.)  If building on OS X 10.6
-  ("Snow Leopard") or later, the 64-bit fork can be made backward compatible
-  with 10.5 by using the instructions in the "Build Recipes" section.
+make udmg [BUILDDIR32={32-bit build directory}]
+
+  On 64-bit OS X systems, this creates a version of the Macintosh package and
+  disk image which contains universal i386/x86-64 binaries.  You should first
+  configure a 32-bit out-of-tree build of TigerVNC, then configure a 64-bit
+  out-of-tree build, then run 'make udmg' from the 64-bit build directory.  The
+  build system will look for the 32-bit build under {source_directory}/osxx86
+  by default, but you can override this by setting the BUILDDIR32 variable on
+  the make command line as shown above.  Either the 64-bit or 32-bit build can
+  be configured to be backward-compatible by using the instructions in the
+  "Unix Build Recipes" section.
 
 
 Windows
diff --git a/release/makemacpkg b/release/makemacpkg
deleted file mode 100644 (file)
index da6a21c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-
-set -u
-set -e
-trap onexit INT
-trap onexit TERM
-trap onexit EXIT
-
-TMPDIR=
-
-onexit()
-{
-       if [ ! "$TMPDIR" = "" ]; then
-               sudo rm -rf $TMPDIR
-       fi
-}
-
-usage()
-{
-       echo "$0 <package name> <version> <build> <source dir.> [universal]"
-       exit 1
-}
-
-UNIVERSAL=0
-
-if [ $# -lt 4 ]; then usage $0; fi
-PACKAGE_NAME=$1
-VERSION=$2
-BUILD=$3
-SRCDIR=$4
-if [ $# -gt 4 ]; then
-       if [ "$5" = "universal" ]; then UNIVERSAL=1; fi
-fi
-PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
-
-if [ -f $PACKAGE_NAME.dmg ]; then
-       rm -f $PACKAGE_NAME.dmg
-fi
-
-umask 022
-TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
-PKGROOT=$TMPDIR/pkg/Package_Root
-mkdir -p $PKGROOT/opt/$PACKAGE_NAME/bin
-mkdir -p $PKGROOT/opt/$PACKAGE_NAME/man/man1
-
-install -m 755 unix/vncviewer/vncviewer $PKGROOT/opt/$PACKAGE_NAME/bin/
-
-if [ $UNIVERSAL = 1 ]; then
-       if [ ! -d $SRCDIR/osxx86 ]; then
-               mkdir -p $SRCDIR/osxx86
-       fi
-       pushd $SRCDIR/osxx86
-       sh $SRCDIR/configure \
-               CC=gcc-4.0 CXX=g++-4.0 \
-               CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
-               CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
-               LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -m32'
-       make
-       popd
-       lipo -create -arch i386 $SRCDIR/osxx86/unix/vncviewer/vncviewer -arch x86_64 \
-               $PKGROOT/opt/$PACKAGE_NAME/bin/vncviewer \
-               -output $PKGROOT/opt/$PACKAGE_NAME/bin/vncviewer
-fi
-
-mkdir -p $PKGROOT/Library/Documentation/$PACKAGE_NAME
-chmod 1775 $PKGROOT/Library
-chmod 775 $PKGROOT/Library/Documentation 
-mkdir -p $TMPDIR/pkg/Resources 
-
-(cat $SRCDIR/release/Description.plist.tmpl | sed s/{__VERSION}/$VERSION/g \
-       | sed s/{__APPNAME}/$PACKAGE_NAME/g \
-       > $TMPDIR/pkg/Description.plist) 
-(cat $SRCDIR/release/Info.plist.tmpl | sed s/{__VERSION}/$VERSION/g    \
-       | sed s/{__BUILD}/$BUILD/g > $TMPDIR/pkg/Info.plist) 
-(cat $SRCDIR/release/uninstall.sh.tmpl \
-       | sed s/{__APPNAME}/$PACKAGE_NAME/g \
-       > $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall) 
-chmod 755 $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall
-
-install -m 644 $SRCDIR/unix/vncviewer/vncviewer.man $PKGROOT/opt/$PACKAGE_NAME/man/man1/vncviewer.1
-install -m 644 $SRCDIR/LICENCE.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/
-
-sudo chown -R root:admin $PKGROOT 
-cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.rtf $TMPDIR/pkg/Resources/ 
-
-mkdir $TMPDIR/dmg
-$PACKAGEMAKER -build -v -p $TMPDIR/dmg/$PACKAGE_NAME.pkg \
-       -f $PKGROOT -r $TMPDIR/pkg/Resources \
-       -i $TMPDIR/pkg/Info.plist -d $TMPDIR/pkg/Description.plist 
-install -m 644 $SRCDIR/release/uninstall.applescript $TMPDIR 
-sudo osacompile -t APPL -o "$TMPDIR/dmg/Uninstall.app" $TMPDIR/uninstall.applescript 
-sudo chown -R $USER "$TMPDIR/dmg/Uninstall.app" 
-hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \
-       -srcfolder "$TMPDIR/dmg" \
-       $TMPDIR/$PACKAGE_NAME.dmg 
-cp $TMPDIR/$PACKAGE_NAME.dmg . 
-
-exit
diff --git a/release/makemacpkg.in b/release/makemacpkg.in
new file mode 100644 (file)
index 0000000..7b806f2
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+set -u
+set -e
+trap onexit INT
+trap onexit TERM
+trap onexit EXIT
+
+TMPDIR=
+
+onexit()
+{
+       if [ ! "$TMPDIR" = "" ]; then
+               sudo rm -rf $TMPDIR
+       fi
+}
+
+usage()
+{
+       echo "$0 [universal [32-bit build dir]]"
+       exit 1
+}
+
+UNIVERSAL=0
+
+PACKAGE_NAME=@PACKAGE_NAME@
+VERSION=@VERSION@
+BUILD=@BUILD@
+SRCDIR=@srcdir@
+BUILDDIR32=@srcdir@/osxx86
+if [ $# -gt 0 ]; then
+       if [ "$1" = "universal" ]; then
+               UNIVERSAL=1
+               if [ $# -gt 1 ]; then BUILDDIR32=$2; fi
+       fi
+fi
+PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+
+if [ -f $PACKAGE_NAME.dmg ]; then
+       rm -f $PACKAGE_NAME.dmg
+fi
+
+umask 022
+TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
+PKGROOT=$TMPDIR/pkg/Package_Root
+mkdir -p $PKGROOT/opt/$PACKAGE_NAME/bin
+mkdir -p $PKGROOT/opt/$PACKAGE_NAME/man/man1
+
+install -m 755 unix/vncviewer/vncviewer $PKGROOT/opt/$PACKAGE_NAME/bin/
+
+if [ $UNIVERSAL = 1 ]; then
+       if [ ! -d $BUILDDIR32 ]; then
+               echo ERROR: 32-bit build directory $BUILDDIR32 does not exist
+               exit 1
+       fi
+       if [ ! -f $BUILDDIR32/Makefile ]; then
+               echo ERROR: 32-bit build directory $BUILDDIR32 is not configured
+               exit 1
+       fi
+       pushd $BUILDDIR32
+       make
+       popd
+       lipo -create -arch i386 $BUILDDIR32/unix/vncviewer/vncviewer -arch x86_64 \
+               $PKGROOT/opt/$PACKAGE_NAME/bin/vncviewer \
+               -output $PKGROOT/opt/$PACKAGE_NAME/bin/vncviewer
+fi
+
+mkdir -p $PKGROOT/Library/Documentation/$PACKAGE_NAME
+chmod 1775 $PKGROOT/Library
+chmod 775 $PKGROOT/Library/Documentation 
+mkdir -p $TMPDIR/pkg/Resources 
+
+(cat $SRCDIR/release/Description.plist.tmpl | sed s/{__VERSION}/$VERSION/g \
+       | sed s/{__APPNAME}/$PACKAGE_NAME/g \
+       > $TMPDIR/pkg/Description.plist) 
+(cat $SRCDIR/release/Info.plist.tmpl | sed s/{__VERSION}/$VERSION/g    \
+       | sed s/{__BUILD}/$BUILD/g > $TMPDIR/pkg/Info.plist) 
+(cat $SRCDIR/release/uninstall.sh.tmpl \
+       | sed s/{__APPNAME}/$PACKAGE_NAME/g \
+       > $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall) 
+chmod 755 $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall
+
+install -m 644 $SRCDIR/unix/vncviewer/vncviewer.man $PKGROOT/opt/$PACKAGE_NAME/man/man1/vncviewer.1
+install -m 644 $SRCDIR/LICENCE.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/
+
+sudo chown -R root:admin $PKGROOT 
+cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.rtf $TMPDIR/pkg/Resources/ 
+
+mkdir $TMPDIR/dmg
+$PACKAGEMAKER -build -v -p $TMPDIR/dmg/$PACKAGE_NAME.pkg \
+       -f $PKGROOT -r $TMPDIR/pkg/Resources \
+       -i $TMPDIR/pkg/Info.plist -d $TMPDIR/pkg/Description.plist 
+install -m 644 $SRCDIR/release/uninstall.applescript $TMPDIR 
+sudo osacompile -t APPL -o "$TMPDIR/dmg/Uninstall.app" $TMPDIR/uninstall.applescript 
+sudo chown -R $USER "$TMPDIR/dmg/Uninstall.app" 
+hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \
+       -srcfolder "$TMPDIR/dmg" \
+       $TMPDIR/$PACKAGE_NAME.dmg 
+cp $TMPDIR/$PACKAGE_NAME.dmg . 
+
+exit