12 if [ "$cur_dir" == "/" ]; then
13 echo "$cur_dir`basename \"$1\"`"
15 echo "$cur_dir/`basename \"$1\"`"
21 ## Some configuration variables
22 number_of_processes="-j4"
26 if [ "$platform" == "Darwin" ]; then
27 particular_options=-no-framework
30 ## Check input parameters and process inputs (if needed)
31 if [ "$#" -eq 1 ]; then
32 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
34 for ext in ${valid_extensions[@]}; do
35 if [ `basename $1 $ext` != $1 ]; then
39 if [ "x$actual_ext" == "x" ]; then
40 echo "$0: Invalid file type."
43 canonical_path=`abspath $1`
44 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
45 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
46 echo -n "Cleaning directories... "
50 echo -n "Creating directories... "
54 echo -n "Extracting sources... "
55 if [ "$actual_ext" == "zip" ]; then
56 echo unzip $canonical_path
57 elif [ "$actual_ext" == "tar" ]; then
58 tar xf $canonical_path -C $source_dir --strip-components=1
59 elif [ "$actual_ext" == "tar.gz" ]; then
60 tar xzf $canonical_path -C $source_dir --strip-components=1
61 elif [ "$actual_ext" == "tar.bz2" ]; then
62 tar xjf $canonical_path -C $source_dir --strip-components=1
64 echo "$0: Invalid file type."
68 elif [ "$#" -eq 2 ]; then
69 source_dir=`dirname $1`
70 build_dir=`dirname $2`
72 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir]"
75 echo "Given source dir : \"$source_dir\""
76 echo "Given build dir : \"$build_dir\""
78 echo "Configuring sources... "
80 $source_dir/configure \
81 -prefix ${HOME}/local \
83 -opensource -shared -fast \
88 -nomake demos -nomake examples \
92 echo "Configuring sources... done."
94 echo "Compiling sources..."
96 make $number_of_processes
97 echo "Compiling sources... done."
99 echo "Installing package..."
102 echo "Installing package... done."