source: orange/install-scripts/mac/dailyrun-finkonly.sh @ 10910:010f67b2461b

Revision 10910:010f67b2461b, 5.3 KB checked in by Ales Erjavec <ales.erjavec@…>, 23 months ago (diff)

Updated the Orange-Text hg repo url and package name in the build scripts.

  • Property exe set to *
Line 
1#!/bin/bash
2#
3# $1 workdir
4# $2 force
5# $3 local
6
7WORK_DIR=${1:-"/private/tmp"}
8FORCE=$2
9LOCAL=$3
10
11test -r /sw/bin/init.sh && . /sw/bin/init.sh
12
13export PATH=$HOME/bin:$PATH
14
15if [ $LOCAL ]; then
16    PUBLISH_DIR=$WORK_DIR/download
17    LOG_DIR=$WORK_DIR/logs
18    mkdir -p $PUBLISH_DIR
19    mkdir -p $LOG_DIR
20else
21    PUBLISH_DIR=/Volumes/download
22    LOG_DIR=/Volumes/download/buildLogs/osx
23fi
24
25
26if [ ! -e $WORK_DIR ]; then
27    mkdir -p $WORK_DIR
28fi
29
30
31if [ ! $LOCAL ]; then
32    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
33fi
34
35SOURCES_DIR=$PUBLISH_DIR/sources
36
37# Get versions from PKG-INFO files (these are updated by dailyrun-sources.sh)
38ORANGE_VERSION=`grep "^Version:" $SOURCES_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2`
39BIOINFORMATICS_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2`
40TEXT_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Text.egg-info/PKG-INFO | cut -d " " -f 2`
41
42
43# Source filenames
44ORANGE_SOURCE="Orange-${ORANGE_VERSION}.tar.gz"
45BIOINFORMATICS_SOURCE="Orange-Bioinformatics-${BIOINFORMATICS_VERSION}.tar.gz"
46TEXT_SOURCE="Orange-Text-${TEXT_VERSION}.tar.gz"
47
48
49# Get source packages md5 checksum
50ORANGE_SOURCE_MD5=`md5 -q $SOURCES_DIR/$ORANGE_SOURCE`
51BIOINFORMATICS_SOURCE_MD5=`md5 -q $SOURCES_DIR/$BIOINFORMATICS_SOURCE`
52TEXT_SOURCE_MD5=`md5 -q $SOURCES_DIR/$TEXT_SOURCE`
53
54MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
55ARCH=`perl -MFink::FinkVersion -e 'print Fink::FinkVersion::get_arch'`
56
57
58FINK_ROOT=/sw
59
60if [ ! $LOCAL ]; then
61    # Compare with the published info files
62    BASE="http://orange.biolab.si/fink/dists/10.$MAC_VERSION/main/finkinfo"
63else
64    # Compare with the local info files
65    BASE="file://$FINK_ROOT/fink/dists/local/main/finkinfo"
66fi
67
68OLD_ORANGE_VERSION=`curl --silent $BASE/orange-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
69OLD_BIOINFORMATICS_VERSION=`curl --silent $BASE/orange-bioinformatics-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
70OLD_TEXT_VERSION=`curl --silent $BASE/orange-text-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
71
72if [[ $OLD_ORANGE_VERSION < ORANGE_VERSION ]]; then
73    NEW_ORANGE=1
74fi
75
76if [[ $OLD_BIOINFORMATICS_VERSION < BIOINFORMATICS_VERSION ]]; then
77    NEW_BIOINFORMATICS=1
78fi
79
80if [[ $OLD_TEXT_VERSION < TEXT_VERSION ]]; then
81    NEW_TEXT=1
82fi
83
84# Base url for sources in fink .info files
85if [ $LOCAL ]; then
86    BASE_URL="file://$PUBLISH_DIR/sources"
87else
88    BASE_URL="http://orange.biolab.si/download/sources"
89fi
90
91# Update the local finkinfo
92# Local info files will be moved to biolab/main/finkinfo in fink-daily-build-packages.sh
93FINK_INFO_DIR="$FINK_ROOT/fink/dists/local/main/finkinfo"
94
95if [ ! -e $FINK_INFO_DIR ]; then
96    mkdir -p $FINK_INFO_DIR
97fi
98
99# Remove any old remaining local .info files
100rm -f $FINK_INFO_DIR/orange-*.info
101
102# Directory where fink .info templates are stored
103FINK_TEMPLATES=$WORK_DIR/fink
104
105if [ ! -e $FINK_TEMPLATES ]; then
106    mkdir -p $FINK_TEMPLATES
107fi
108
109FINK_LOG=$WORK_DIR/fink-daily-build.log
110
111echo "" > $FINK_LOG
112
113if [[ $NEW_ORANGE || $FORCE ]]; then
114    FINK_ORANGE_SOURCE_TEMPLATE="Orange-%v.tar.gz"
115    curl --silent -o $FINK_TEMPLATES/orange-gui-dev-py.info https://bitbucket.org/biolab/orange/raw/tip/install-scripts/mac/fink/orange-gui-dev-py.info
116    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-dev-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINK_INFO_DIR/orange-gui-dev-py.info >> $FINK_LOG 2>&1
117    FINK_ORANGE_INFO_EXIT_VALUE=$?
118fi
119
120if [[ $NEW_BIOINFORMATICS || $FORCE ]]; then
121    FINK_BIOINFORMATICS_SOURCE_TEMPLATE="Orange-Bioinformatics-%v.tar.gz"
122    curl --silent -o $FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info https://bitbucket.org/biolab/orange/raw/tip/install-scripts/mac/fink/orange-bioinformatics-gui-dev-py.info
123    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINK_INFO_DIR/orange-bioinformatics-gui-dev-py.info >> $FINK_LOG 2>&1
124    FINK_BIOINFORMATICS_INFO_EXIT_VALUE=$?
125fi
126
127if [[ $NEW_TEXT || $FORCE ]]; then
128    FINK_TEXT_SOURCE_TEMPLATE="Orange-Text-%v.tar.gz"
129    curl --silent -o $FINK_TEMPLATES/orange-text-gui-dev-py.info https://bitbucket.org/biolab/orange/raw/tip/install-scripts/mac/fink/orange-text-gui-dev-py.info
130    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-dev-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINK_INFO_DIR/orange-text-gui-dev-py.info >> $FINK_LOG 2>&1
131    FINK_TEXT_INFO_EXIT_VALUE=$?
132fi
133
134if [ ! $LOCAL ]; then
135    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
136fi
137
138EXIT_VALUE=$(($FINK_ORANGE_INFO_EXIT_VALUE + $FINK_BIOINFORMATICS_INFO_EXIT_VALUE + $FINK_TEXT_INFO_EXIT_VALUE))
139if (($EXIT_VALUE)); then
140    echo "Running fink-register-info.sh failed"
141    rm -f $FINK_INFO_DIR/orange-*.info
142fi
143
144## daily fink build
145if [ ! $LOCAL ]; then
146    ./fink-daily-build-packages.sh &> $WORK_DIR/fink-daily-build-packages.log
147    EXIT_VALUE=$?
148fi
149
150if [ ! $LOCAL ]; then
151    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
152fi
153
154echo "Orange (fink $MAC_VERSION $ARCH) [$EXIT_VALUE]" > "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
155date >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
156cat $WORK_DIR/fink-daily-build-packages.log >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
157(($EXIT_VALUE)) && echo "Running fink-daily-build-packages.sh failed"
158
159# Zero exit value
160true
Note: See TracBrowser for help on using the repository browser.