File: install.macos

package info (click to toggle)
odin 2.0.5-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,196 kB
  • sloc: cpp: 62,638; sh: 4,541; makefile: 779
file content (111 lines) | stat: -rwxr-xr-x 2,941 bytes parent folder | download | duplicates (8)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash

# wrapper script to install ODIN on MacOS X

command="`basename $0`"
usage="usage: $command [-d] <Qt-directory> <installation-prefix>"

EXTRA_CONFIG_OPTS=""

continue="yes"
while [ $continue = "yes" ] ; do
  case "$1" in
    -d) EXTRA_CONFIG_OPTS="--enable-debug" ; shift 1 ;;
    *) continue="no" ;;
  esac
done

case $# in
 2) QTDIR="$1"; INSTALLDIR="$2";;
 *) echo $usage; exit;;
esac

if [ ! -f configure ] ; then
  if ! ./bootstrap
  then
    exit -1
  fi
fi


if test -z $(which g++-4.2) ; then
  # Tiger -> Optimization does not work
  MCXX="g++"
  MCXXFLAGS="-O0"
else
  # Leopard -> Optimization only works with GCC4.2
  MCXX="g++-4.2"
  MCXXFLAGS=""
fi


if [ ! -f Makefile ] ; then
  if ! LDFLAGS="-Wl,-multiply_defined,suppress" \
       CXX="$MCXX" CXXFLAGS="$MCXXFLAGS" \
       ./configure $EXTRA_CONFIG_OPTS --with-qt-dir=$QTDIR --prefix=$INSTALLDIR \
       --with-extra-include-base=$INSTALLDIR/include \
       --with-extra-build-ldflags="-Wl,-F${QTDIR}/lib -Wl,-framework,QtGui,-framework,QtCore,-framework,vecLib"
  then
    exit -1
  fi
fi


if ! make install ; then
  exit -1
fi



# Creating bundles for GUI applications

for APPLICATION in odin pulsar geoedit miview; do

  if test -f $INSTALLDIR/bin/$APPLICATION ; then

    echo -n "Creating bundle for $APPLICATION ..."

    APPDIR=$INSTALLDIR/bin/$APPLICATION.app

    mkdir -p $APPDIR
    echo "APPL????" > $APPDIR/PkgInfo

    mkdir -p $APPDIR/Contents

    INFO_PLIST_FILE=$APPDIR/Contents/Info.plist

    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $INFO_PLIST_FILE
    echo "<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">" >> $INFO_PLIST_FILE
    echo "<plist version=\"0.9\">" >> $INFO_PLIST_FILE
    echo "<dict>" >> $INFO_PLIST_FILE
    echo "	<key>CFBundleIconFile</key>" >> $INFO_PLIST_FILE
    echo "	<string></string>" >> $INFO_PLIST_FILE
    echo "	<key>CFBundlePackageType</key>" >> $INFO_PLIST_FILE
    echo "	<string>APPL</string>" >> $INFO_PLIST_FILE
    echo "	<key>CFBundleGetInfoString</key>" >> $INFO_PLIST_FILE
    echo "	<string>Created by ODIN</string>" >> $INFO_PLIST_FILE
    echo "	<key>CFBundleSignature</key>" >> $INFO_PLIST_FILE
    echo "	<string>????</string>" >> $INFO_PLIST_FILE
    echo "	<key>CFBundleExecutable</key>" >> $INFO_PLIST_FILE
    echo "	<string>$APPLICATION</string>" >> $INFO_PLIST_FILE
    echo "	<key>NOTE</key>" >> $INFO_PLIST_FILE
    echo "	<string>Please, do NOT change this file -- It was generated by ODIN</string>" >> $INFO_PLIST_FILE
    echo "</dict>" >> $INFO_PLIST_FILE
    echo "</plist>" >> $INFO_PLIST_FILE


    mkdir -p $APPDIR/Contents/MacOS
    mv $INSTALLDIR/bin/$APPLICATION $APPDIR/Contents/MacOS

    START_SCRIPT=$INSTALLDIR/bin/$APPLICATION
    echo "#!/bin/sh" > $START_SCRIPT
    echo "\`dirname \$0\`/$APPLICATION.app/Contents/MacOS/$APPLICATION \$*" >> $START_SCRIPT
    chmod 755 $START_SCRIPT

    echo "done"

  fi

done