Skip to content
Browse files

build is now called package

  • Loading branch information...
1 parent 9eebba5 commit d3c93c2f3ebc6e7f1a3bc53cd7b181f76c460a67 @wayneeseguin wayneeseguin committed Mar 29, 2011
Showing with 80 additions and 73 deletions.
  1. +0 −72 modules/bash/build/functions
  2. +0 −1 modules/bash/build/initialize
  3. +72 −0 modules/bash/package/functions
  4. +8 −0 modules/bash/package/initialize
View
72 modules/bash/build/functions
@@ -1,72 +0,0 @@
-#!/usr/bin/env bash
-
-fetch_src()
-{
- curl -L "${1}" -o "${1##*\/}"
-}
-
-extract_src()
-{
- case "$1" in
- *.tar.gz|*.tgz)
- tar zxf "${1}"
- ;;
- *.tar.bz2)
- tar jxf "${1}"
- ;;
- *.zip)
- unzip "${1}"
- ;;
- *)
- fail "Unknown archive format for ${1}"
- ;;
- esac
-}
-
-configure_src()
-{
- if [[ ${#configure_flags[@]} -gt 0 ]] ; then
- ./configure ${configure_flags[@]}
- else
- ./configure
- fi
-}
-
-make_src()
-{
- # TODO: make this robust
- make
-}
-
-install_src()
-{
- # TODO: make this robust
- make install
-}
-
-build_src()
-{
- # Ensure that default values are set.
- true \
- "${source_path:=/usr/local/src}" \
- "${archive_format:=tar.gz}"
-
- package_file="${package}-${package_version}.${archive_format}"
-
- ensure_paths_exist "$source_path"
-
- enter "$source_path"
-
- fetch_src "${package_url}"
-
- extract_src "${package_file}"
-
- enter "${package}-${package_version}"
-
- configure_src
-
- make_src
-
- install_src
-}
-
View
1 modules/bash/build/initialize
@@ -1 +0,0 @@
-#!/usr/bin/env bash
View
72 modules/bash/package/functions
@@ -0,0 +1,72 @@
+#!/usr/bin/env bash
+
+fetch_package_md5()
+{
+ true ${md5_url:=${1}.md5}
+ curl \
+ -L "${md5_url}/${package_file}.md5" \
+ -o "${md5_url##*\/}"
+}
+
+fetch_package()
+{
+ true ${url:=$1}
+ curl \
+ -L "${url}/${package_file}" \
+ -o "${url##*\/}"
+}
+
+extract_package()
+{
+ case "$1" in
+ *.tar.gz|*.tgz|*.xz)
+ tar zxf "${1}"
+ ;;
+ *.tar.bz2)
+ tar jxf "${1}"
+ ;;
+ *.zip)
+ unzip "${1}" -C ${source_path}
+ ;;
+ *)
+ fail "Unknown archive format for ${1}"
+ ;;
+ esac
+}
+
+configure_package()
+{
+ ./configure ${configure_flags[@]:-}
+}
+
+make_package()
+{
+ # TODO: make this robust, -j4 for example.
+ make
+}
+
+install_package()
+{
+ # TODO: make this robust
+ make install
+}
+
+build_package()
+{
+ ensure_paths_exist "${source_path}"
+
+ enter "${source_path}"
+
+ fetch_package
+
+ extract_package
+
+ enter "${package}-${package_version}"
+
+ configure_package
+
+ make_package
+
+ install_package
+}
+
View
8 modules/bash/package/initialize
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+# Ensure that default values are set.
+true \
+ "${source_path:=/usr/local/src}" \
+ "${archive_format:=tar.gz}" \
+ "${package_file:="${package}-${package_version}.${archive_format}"}"
+

0 comments on commit d3c93c2

Please sign in to comment.
Something went wrong with that request. Please try again.