#!/bin/sh
#
# Checkinstall - perform preinstallation install checks.
#
# This is a modified version of a script written by mark@metalab.unc.edu .
# The original is at http://metalab.unc.edu/pub/packages/solaris/sparc/html/creating.solaris.packages.html .
#
# $Id: checkinstall.in 34996 2010-11-21 19:03:17Z wmeier $
#

PKG_CONFIG=/usr/bin/pkg-config

gtk_version_needed="2.0"
expected_platform="i686"

platform=`uname -p`

if [ ${platform} != ${expected_platform} ]
then
  echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
  echo "\tAborting installation.\n\n\n"
  exit 1
fi

if [ ! -x "$PKG_CONFIG" ]
then
	# We couldn't find GTK in the location that was used to build
	# Wireshark.
	# Punt!
	# If gtk-config is in the $PATH then wireshark should install fine.
	# Some modifications to $LD_LIBRARY_PATH (or non Solaris equivalent)
	# may be required by the user.  Should there be a warning here?
	PKG_CONFIG=pkg-config
fi

$PKG_CONFIG gtk+-2.0 --atleast-version=$gtk_version_needed
if [ $? != 0 ]
then
	echo "\n\n\n\tThis package requires gtk+-2 version >= $gtk_version_needed installed in `dirname /usr/bin/pkg-config`."
	echo "\tAborting installation.\n\n\n"
	exit 1
fi

exit 0
