3 ## Check input parameters and process inputs (if needed)
4 if [ "$#" -eq 1 ]; then
5 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
7 for ext in ${valid_extensions[@]}; do
8 if [ `basename $1 $ext` != $1 ]; then
12 if [ "x$actual_ext" == "x" ]; then
13 echo "$0: Invalid file type."
16 canonical_path=`readlink -e $1`
17 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
18 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
19 echo -n "Cleaning directories... "
23 echo -n "Creating directories... "
27 echo -n "Extracting sources... "
28 if [ "$actual_ext" == "zip" ]; then
29 echo unzip $canonical_path
30 elif [ "$actual_ext" == "tar" ]; then
31 tar xf $canonical_path -C $source_dir --strip-components=1
32 elif [ "$actual_ext" == "tar.gz" ]; then
33 tar xzf $canonical_path -C $source_dir --strip-components=1
34 elif [ "$actual_ext" == "tar.bz2" ]; then
35 tar xjf $canonical_path -C $source_dir --strip-components=1
37 echo "$0: Invalid file type."
41 elif [ "$#" -eq 2 ]; then
42 source_dir=`dirname $1`
43 build_dir=`dirname $2`
45 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir]"
48 echo "Given source dir : \"$source_dir\""
49 echo "Given build dir : \"$build_dir\""
51 echo "Configuring sources... "
53 $source_dir/configure \
54 -prefix ${HOME}/local \
55 -release -opensource -shared -fast -no-webkit \
56 -optimized-qmake -no-framework \
58 echo "Configuring sources... done."
60 echo "Compiling sources..."
63 echo "Compiling sources... done."
65 echo "Installing package..."
68 echo "Installing package... done."