source: orange/install-scripts/mac/fink-selfupdate-orange.sh @ 9175:c84b9ed8636f

Revision 9175:c84b9ed8636f, 5.1 KB checked in by ales_erjavec <ales.erjavec@…>, 2 years ago (diff)

Minor changes to the instructions for enabling the unstable tree in Fink (fixes #1003).

  • Property exe set to *
RevLine 
[5462]1#!/bin/bash -e
2#
[5471]3# Should be run as: sudo ./fink-selfupdate-orange.sh [/path/to/fink/root]
[5462]4#
5
6# Default is /sw
7FINK_ROOT=${1:-/sw}
8
9MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
10
[6054]11# Sets error handler
12trap "echo \"Script failed\"" ERR
13
[5462]14((`id -u` == 0)) || { echo "Must run as root user (use sudo)."; exit 1; }
15
16test -r $FINK_ROOT/bin/init.sh || { echo "Fink cannot be found." exit 2; }
17
18# Configures environment for Fink
19. $FINK_ROOT/bin/init.sh
20
[7662]21if [ -e $FINK_ROOT/fink/dists/ailab/ ]; then
22    echo "Removing obsolete local ailab Fink info files repository."
23    rm -rf "$FINK_ROOT/fink/dists/ailab/"
24fi
25
26echo "Preparing local biolab Fink info files repository."
27mkdir -p $FINK_ROOT/fink/dists/biolab/main/finkinfo/
28rm -f $FINK_ROOT/fink/dists/biolab/main/finkinfo/*
[5462]29
30# Gets current (daily) info files from SVN
[7662]31echo "Updating local biolab Fink info files repository."
32curl "http://orange.biolab.si/fink/dists/10.$MAC_VERSION/main/finkinfo/all.tgz" --output $FINK_ROOT/fink/dists/biolab/main/finkinfo/all.tgz
33tar -xzf $FINK_ROOT/fink/dists/biolab/main/finkinfo/all.tgz -C $FINK_ROOT/fink/dists/biolab/main/finkinfo/
34rm -f $FINK_ROOT/fink/dists/biolab/main/finkinfo/all.tgz
[5462]35
[7662]36if grep '^Trees:' $FINK_ROOT/etc/fink.conf | grep -q 'ailab/main'; then
37    echo "Removing obsolete local ailab Fink info files repository from Fink configuration."
38    perl -p -i -l -e 's| ?ailab/main||g if /^Trees/' $FINK_ROOT/etc/fink.conf   
39fi
40
41if ! grep '^Trees:' $FINK_ROOT/etc/fink.conf | grep -q 'biolab/main'; then
42    echo "Adding local biolab Fink info files repository to Fink configuration."
43    perl -p -i -l -e '$_ = "$_ biolab/main" if /^Trees/' $FINK_ROOT/etc/fink.conf
[5462]44fi
45
[6523]46if ! grep -q '^UseBinaryDist:.*true' $FINK_ROOT/etc/fink.conf; then
47    echo "Enabling Fink binary packages repositories."
48    perl -p -i -l -e 's/^UseBinaryDist:.*false/UseBinaryDist: true/' $FINK_ROOT/etc/fink.conf
49fi
50
[6515]51# Adds our binary repository to local Fink (APT) configuration if on Mac OS X versions we provide binary packages for
[7662]52if grep -q "ailab" $FINK_ROOT/etc/apt/sources.list; then
53    echo "Removing obsolete ailab Fink binary packages repository from Fink configuration."
54    grep -v "ailab" $FINK_ROOT/etc/apt/sources.list > $FINK_ROOT/etc/apt/sources.list.new
55    mv $FINK_ROOT/etc/apt/sources.list.new $FINK_ROOT/etc/apt/sources.list
56    apt-get update
57fi
58
[7181]59if [[ "$MAC_VERSION" -eq 5 || "$MAC_VERSION" -eq 6 ]] && ! grep -q "deb http://orange.biolab.si/fink 10.$MAC_VERSION main" $FINK_ROOT/etc/apt/sources.list; then
[7662]60    echo "Adding biolab Fink binary packages repository to Fink configuration."
[7181]61    echo "deb http://orange.biolab.si/fink 10.$MAC_VERSION main" >> $FINK_ROOT/etc/apt/sources.list
[5462]62fi
63
64# Refreshes packages lists
65fink --yes scanpackages
66fink --yes index
67
68cat <<-EOMSG
69   
[7662]70    Information about biolab packages have been updated. You can now update installed
[5462]71    packages using:
72   
73        fink update-all
74   
[7662]75    You can list available biolab packages using commands like:
[5462]76   
77        fink list --tab orange
78   
79    and you can install them using commands like:
80   
[9153]81        fink install orange-gui-svn-py27
[5462]82EOMSG
83
[6514]84if ! grep '^Trees:' $FINK_ROOT/etc/fink.conf | grep -q 'unstable/main' || grep '^SelfUpdateMethod:' $FINK_ROOT/etc/fink.conf | grep -q 'point'; then
[5462]85    cat <<-EOMSG
86       
87        WARNING: Your local Fink installation does not seem to use unstable Fink
88                 packages tree with rsync or CVS updating. This means that it could
[7662]89                 happen that some package on which biolab packages depend will not be
[5462]90                 found or possible to install. In this case please configure Fink to
91                 use unstable tree using:
92                 
[9175]93                     fink selfupdate-rsync
[5462]94                     fink configure
95                 
[9175]96                 and after that update Fink:
[5462]97                 
98                     fink scanpackages
99                     fink selfupdate
100                     fink update-all
[9175]101                 
102                 and run this script again:
103                 
104                     sudo ./fink-selfupdate-orange.sh
[5462]105    EOMSG
106   
107    if [ ! -x /usr/bin/xcodebuild ]; then
108        cat <<-EOMSG
109                     
110                     You will need Xcode installed on a system for above commands to work
111                     correctly as it is a requirement for unstable Fink packages tree. You
112                     can install it from your Mac OS X installation disk or from:
113                     
114                         http://developer.apple.com/technology/xcode.html
115        EOMSG
116    fi
117fi
118
119if [ $MAC_VERSION -lt "5" ] && [ ! -x /usr/X11/bin/X ]; then
120    cat <<-EOMSG
121       
122        WARNING: It seems you do not have X11 installed on a system. This means that it
[7662]123                 could happen that some package on which biolab packages depend will fail
[5462]124                 to run or compile. In this case please install it from your Mac OS X
125                 installation disk.
126    EOMSG
127elif [ $MAC_VERSION -ge "5" ] && [ ! "`/usr/X11/bin/X -version 2>&1 | grep '^X.Org X Server' | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+' | cut -d '.' -f 2`" -gt "3" ]; then
128    cat <<-EOMSG
129       
130        WARNING: It seems you do not have X11 version 2.3.0 or later installed on a
131                 system. This means that it could happen that some package on which
[7662]132                 biolab packages depend will fail to run or compile. In this case
[6512]133                 please install it from your Mac OS X installation disk or from:
[5462]134                 
[6192]135                     http://xquartz.macosforge.org/trac/wiki
[5462]136    EOMSG
137fi
Note: See TracBrowser for help on using the repository browser.