source: orange/install-scripts/mac/build-mpkg.sh @ 10681:7fbcfe90f7cf

Revision 10681:7fbcfe90f7cf, 880 bytes checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Added build-mpkg.sh script.

Line 
1#!/bin/bash -ev
2#
3# Build mpkg package from a source distribution
4#
5# $1 source (.tar.gz) distribution path
6# $2 work dir
7# $3 distribution dir (where packages will be stored and rotated
8# $4 force
9#
10# Example ./build-mpkg.sh http://pypi.python.org/packages/source/O/Orange/Orange-2.5a4.tar.gz /private/tmp /Volumes/download
11#
12
13SOURCE=$1
14WORK_DIR=$2
15DIST_DIR=$3
16FORCE=$4
17
18SOURCE_BASENAME=`basename $SOURCE`
19
20# Could check other standard extensions (zip, tgz, ...)
21DIST_NAME=${SOURCE_BASENAME%.tar.gz}
22
23echo $DIST_NAME
24
25if [ ! -e $WORK_DIR ]; then
26    mkdir -p $WORK_DIR
27fi
28
29if [ ! -e $DIST_DIR ]; then
30    mkdir -p $DIST_DIR
31fi
32
33curl --silent $SOURCE | tar -xz -C $WORK_DIR
34
35cd $WORK_DIR/$DIST_NAME
36
37# Use the system python
38/usr/bin/python setup.py bdist_mpkg --dist-dir=$DIST_DIR
39
40# Rotate the packages
41/usr/bin/python setup.py rotate --match=.mpkg --dist-dir=$DIST_DIR --keep=20
42
43true
Note: See TracBrowser for help on using the repository browser.