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 *
Line 
1#!/bin/bash -e
2#
3# Should be run as: sudo ./fink-selfupdate-orange.sh [/path/to/fink/root]
4#
5
6# Default is /sw
7FINK_ROOT=${1:-/sw}
8
9MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
10
11# Sets error handler
12trap "echo \"Script failed\"" ERR
13
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
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/*
29
30# Gets current (daily) info files from SVN
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
35
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
44fi
45
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
51# Adds our binary repository to local Fink (APT) configuration if on Mac OS X versions we provide binary packages for
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
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
60    echo "Adding biolab Fink binary packages repository to Fink configuration."
61    echo "deb http://orange.biolab.si/fink 10.$MAC_VERSION main" >> $FINK_ROOT/etc/apt/sources.list
62fi
63
64# Refreshes packages lists
65fink --yes scanpackages
66fink --yes index
67
68cat <<-EOMSG
69   
70    Information about biolab packages have been updated. You can now update installed
71    packages using:
72   
73        fink update-all
74   
75    You can list available biolab packages using commands like:
76   
77        fink list --tab orange
78   
79    and you can install them using commands like:
80   
81        fink install orange-gui-svn-py27
82EOMSG
83
84if ! grep '^Trees:' $FINK_ROOT/etc/fink.conf | grep -q 'unstable/main' || grep '^SelfUpdateMethod:' $FINK_ROOT/etc/fink.conf | grep -q 'point'; then
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
89                 happen that some package on which biolab packages depend will not be
90                 found or possible to install. In this case please configure Fink to
91                 use unstable tree using:
92                 
93                     fink selfupdate-rsync
94                     fink configure
95                 
96                 and after that update Fink:
97                 
98                     fink scanpackages
99                     fink selfupdate
100                     fink update-all
101                 
102                 and run this script again:
103                 
104                     sudo ./fink-selfupdate-orange.sh
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
123                 could happen that some package on which biolab packages depend will fail
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
132                 biolab packages depend will fail to run or compile. In this case
133                 please install it from your Mac OS X installation disk or from:
134                 
135                     http://xquartz.macosforge.org/trac/wiki
136    EOMSG
137fi
Note: See TracBrowser for help on using the repository browser.