aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/svr4/checkinstall.in
blob: d753fa8f084b553669c6b4c84132c4575147aa53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/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 .

GTK_CONFIG=@GTK_CONFIG@

gtk_major_needed="1"
gtk_minor_needed="2"

host_cpu="@host_cpu@"
host_os="@host_os@"

release=`uname -r`
platform=`uname -p`

expected_platform="@host_cpu@"

if [ -x $GTK_CONFIG ] ; then
  # First try the GTK location that was used to build ethereal.  This
  # is probably the safest bet.
  gtk_installed=`$GTK_CONFIG --version`
  gtk_major_installed=`echo $gtk_installed | cut -f1 -d.`
  gtk_minor_installed=`echo $gtk_installed | cut -f2 -d.`
elif gtk_installed=`gtk-config --version 2>&-`; then
  # Punt! 
  # If gtk-config is in the $PATH then ethereal 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?
  gtk_major_installed=`echo $gtk_installed | cut -f1 -d.`
  gtk_minor_installed=`echo $gtk_installed | cut -f2 -d.`
else
  gtk_major_installed="0"
  gtk_minor_installed="0"
fi

#
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 [ ${release} != ${expected_release} ]; then
#     echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n"
#     echo "\tAborting installation.\n\n\n"
#     exit 1
# fi

if [ "$gtk_major_installed" -lt "$gtk_major_needed" -a \
     "$gtk_minor_installed" -lt "$gtk_minor_needed" ] ; then
  echo "\n\n\n\tThis package requires gtk+ version >= $gtk_major_needed.$gtk_minor_needed installed in `dirname ${GTK_CONFIG}`."
  echo "\tAborting installation.\n\n\n"
  exit 1
fi

exit 0