diff --git a/build-2.7.3.sh b/build-2.7.3.sh index 21afe9b..65be590 100755 --- a/build-2.7.3.sh +++ b/build-2.7.3.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Usage: $ build.sh SOURCE_TARBALL='http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2' curl $SOURCE_TARBALL | tar jx diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..93713f7 --- /dev/null +++ b/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# Usage: $ build.sh -f -p [-x ] + +# Syntax sugar. +indent() { + RE="s/^/ /" + [ $(uname) == "Darwin" ] && sed -l "$RE" || sed -u "$RE" +} + +function puts-step (){ + echo "-----> $@" +} + + +# Argument parsing. +while getopts ":f:x:p:" opt; do + case $opt in + f) + FORMULA=$OPTARG + echo "Using formula: $FORMULA" >&2 + # echo "-f was triggered, Parameter: $OPTARG" >&2 + ;; + p) + # echo "-p was triggered, Parameter: $OPTARG" >&2 + mkdir -p $OPTARG + PREFIX_PATH=`cd "$OPTARG"; pwd` + echo "Using prefix: $PREFIX_PATH" >&2 + ;; + x) + ARCHIVE=$OPTARG + echo "Using archive: $OPTARG" >&2 + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +if [ ! "$FORMULA" ]; then + echo "Please specify a valid formula with -f." >&2 + exit 1; +fi + +if [ ! "$PREFIX_PATH" ]; then + echo "Please specify a valid prefix with -p." >&2 + exit 1; +fi + + +echo "------> Building Formula $FORMULA" +FORMULA_PATH=$(pwd)/formula/$FORMULA + +if [ ! -f $FORMULA_PATH ]; then + echo "Formula '$FORMULA' does not exist." >&2 + exit 1; +fi + +$(pwd)/formula/$FORMULA $PREFIX_PATH | indent + +if [ "$ARCHIVE" ]; then + tar cjf $ARCHIVE $PREFIX_PATH/ +fi \ No newline at end of file diff --git a/formula/python-2.7.3 b/formula/python-2.7.3 new file mode 100755 index 0000000..6f15851 --- /dev/null +++ b/formula/python-2.7.3 @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Options: + +OUT_PREFIX=$1 + +echo "Building SQLite..." +./parts/sqlite $OUT_PREFIX + +SOURCE_TARBALL='http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2' +curl $SOURCE_TARBALL | tar jx +mv Python-2.7.3 src +cd src + +./configure --prefix=$OUT_PREFIX +make +make install \ No newline at end of file diff --git a/formula/todo/python-2.6.0 b/formula/todo/python-2.6.0 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.6.1 b/formula/todo/python-2.6.1 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.6.2 b/formula/todo/python-2.6.2 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.6.3 b/formula/todo/python-2.6.3 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.6.4 b/formula/todo/python-2.6.4 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.6.5 b/formula/todo/python-2.6.5 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.7.0 b/formula/todo/python-2.7.0 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.7.1 b/formula/todo/python-2.7.1 new file mode 100644 index 0000000..e69de29 diff --git a/formula/todo/python-2.7.2 b/formula/todo/python-2.7.2 new file mode 100644 index 0000000..e69de29 diff --git a/parts/sqlite b/parts/sqlite new file mode 100755 index 0000000..e61a6be --- /dev/null +++ b/parts/sqlite @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Usage: $ build.sh + +OUT_PREFIX=$1 +SOURCE_TARBALL='http://www.sqlite.org/sqlite-autoconf-3070900.tar.gz' + +curl -O $SOURCE_TARBALL +tar xvvf sqlite-autoconf-3070900.tar.gz +mv sqlite-autoconf-3070900 sqlite + +cd sqlite +./configure --prefix=$OUT_PREFIX +make +make install \ No newline at end of file