Skip to content

Commit

Permalink
Updated build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopadilha committed Feb 19, 2015
1 parent aa1baf3 commit 5ed4326
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
### Build directory tree ###
download/*
target/*
origin/*
logfile*
*.tgz
origin/*

### proftpd-admin ###
www

### Linux ###
*~
Expand Down
28 changes: 27 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ export LDFLAGS="${LDFLAGS:-} -Wl,-rpath,${DEST}/lib -L${DEST}/lib"
alias make="make -j8 V=1 VERBOSE=1"

### support functions ###
# Download a TAR file and unpack it, removing old files.
# $1: file
# $2: url
# $3: folder
_download_tar() {
[[ ! -d "download" ]] && mkdir -p "download"
[[ ! -d "target" ]] && mkdir -p "target"
[[ ! -f "download/${1}" ]] && wget -O "download/${1}" "${2}"
[[ -d "target/${3}" ]] && rm -vfr "target/${3}"
[[ ! -d "target/${3}" ]] && tar -xvf "download/${1}" -C target
return 0
}

# Download a TGZ file and unpack it, removing old files.
# $1: file
# $2: url
Expand All @@ -46,7 +59,20 @@ _download_tgz() {
return 0
}

# Download a TGZ file and unpack it, removing old files.
# Download a BZ2 file and unpack it, removing old files.
# $1: file
# $2: url
# $3: folder
_download_bz2() {
[[ ! -d "download" ]] && mkdir -p "download"
[[ ! -d "target" ]] && mkdir -p "target"
[[ ! -f "download/${1}" ]] && wget -O "download/${1}" "${2}"
[[ -d "target/${3}" ]] && rm -vfr "target/${3}"
[[ ! -d "target/${3}" ]] && tar -jxvf "download/${1}" -C target
return 0
}

# Download a XZ file and unpack it, removing old files.
# $1: file
# $2: url
# $3: folder
Expand Down

0 comments on commit 5ed4326

Please sign in to comment.