source: orange/install-scripts/mac/fink-update-local.sh @ 10448:d421fcc9a817

Revision 10448:d421fcc9a817, 3.2 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Fixed fink-update-local script.

  • Property exe set to *
Line 
1#!/bin/bash -e
2#
3# Update the local/main tree with the latest packages
4# from hg (needs write priviliges in FINK_ROOT/fink/dists/local/main/finkinfo
5#
6# Should be run as: sudo ./fink-updata-local.sh /work/dir /sources/dir
7#
8# $1 Work dir (where repositories will be coned and source packages will be build)
9# $2 Sources (where source packages will be copied and retrieved by fink).
10
11if [[ ! $1 || ! $2 ]]; then
12    echo "Need two args"
13    exit 1
14fi
15
16WORK_DIR=$1
17SOURCES_DIR=$2
18
19# First build all the source packages
20./build-source.sh https://bitbucket.org/biolab/orange orange tip $WORK_DIR Orange
21./build-source.sh https://bitbucket.org/biolab/orange-addon-bioinformatics bioinformatics tip $WORK_DIR Orange-Bioinformatics
22./build-source.sh https://bitbucket.org/biolab/orange-addon-text text tip $WORK_DIR Orange-Text-Mining
23
24# Get versions from PKG-INFO files
25ORANGE_VERSION=`grep "^Version:" $WORK_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2`
26BIOINFORMATICS_VERSION=`grep "^Version:" $WORK_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2`
27TEXT_VERSION=`grep "^Version:" $WORK_DIR/Orange_Text_Mining.egg-info/PKG-INFO | cut -d " " -f 2`
28
29
30# Source filenames
31ORANGE_SOURCE="Orange-${ORANGE_VERSION}.tar.gz"
32BIOINFORMATICS_SOURCE="Orange-Bioinformatics-${BIOINFORMATICS_VERSION}.tar.gz"
33TEXT_SOURCE="Orange-Text-Mining-${TEXT_VERSION}.tar.gz"
34
35
36# Get source packages md5 checksum
37ORANGE_SOURCE_MD5=`md5 -q $WORK_DIR/$ORANGE_SOURCE`
38BIOINFORMATICS_SOURCE_MD5=`md5 -q $WORK_DIR/$BIOINFORMATICS_SOURCE`
39TEXT_SOURCE_MD5=`md5 -q $WORK_DIR/$TEXT_SOURCE`
40
41
42# Publish sources
43
44if [ ! -e $SOURCES_DIR ]; then
45    mkdir -p $SOURCES_DIR
46fi
47
48if [ ! -e $SOURCES_DIR/$ORANGE_SOURCE ]; then
49    cp $WORK_DIR/$ORANGE_SOURCE $SOURCES_DIR/$ORANGE_SOURCE
50    NEW_ORANGE=1
51fi
52
53if [ ! -e $SOURCES_DIR/BIOINFORMATICS_SOURCE ]; then
54    cp $WORK_DIR/$BIOINFORMATICS_SOURCE $SOURCES_DIR/$BIOINFORMATICS_SOURCE
55    NEW_BIOINFORMATICS=1
56fi
57
58if [ ! -e $SOURCES_DIR/TEXT_SOURCE ]; then
59    cp $WORK_DIR/$TEXT_SOURCE $SOURCES_DIR/$TEXT_SOURCE
60    NEW_TEXT=1
61fi
62
63FINK_ROOT=/sw
64
65# Update the local/main finkinfo files
66FINKINFO_DIR="$FINK_ROOT/fink/dists/local/main/finkinfo"
67
68if [ ! -e $FINFINFO_DIR ]; then
69    mkdir -p $FINKINFO_DIR
70fi
71
72# Directory where fink .info templates are
73#FINK_TEMPLATES=fink
74FINK_TEMPLATES=$WORK_DIR/orange/install-scripts/mac/fink
75BASE_URL="file://$SOURCES_DIR"
76
77if [[ $NEW_ORANGE || $FORCE ]]; then
78    FINK_ORANGE_SOURCE_TEMPLATE="Orange-%v.tar.gz"
79    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-hg-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINKINFO_DIR/orange-gui-hg-py.info
80fi
81
82if [[ $NEW_BIOINFORMATICS || $FORCE ]]; then
83    FINK_BIOINFORMATICS_SOURCE_TEMPLATE="Orange-Bioinformatics-%v.tar.gz"
84    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-hg-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINKINFO_DIR/orange-bioinformatics-gui-hg-py.info
85fi
86
87if [[ $NEW_TEXT || $FORCE ]]; then
88    FINK_TEXT_SOURCE_TEMPLATE="Orange-Text-Mining-%v.tar.gz"
89    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-hg-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINKINFO_DIR/orange-text-gui-hg-py.info
90fi
91
92# Index the new packages
93fink index
94
Note: See TracBrowser for help on using the repository browser.