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"
25 if [ "$platform" == "Darwin" ]; then
26 particular_options=-no-framework
29 ## Check input parameters and process inputs (if needed)
30 if [ "$#" -eq 2 ]; then
31 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
33 for ext in ${valid_extensions[@]}; do
34 if [ `basename $1 $ext` != $1 ]; then
38 if [ "x$actual_ext" == "x" ]; then
39 echo "$0: Invalid file type."
42 canonical_path=`abspath $1`
43 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
44 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
45 echo -n "Cleaning directories... "
49 echo -n "Creating directories... "
53 echo -n "Extracting sources... "
54 if [ "$actual_ext" == "zip" ]; then
55 echo unzip $canonical_path
56 elif [ "$actual_ext" == "tar" ]; then
57 tar xf $canonical_path -C $source_dir --strip-components=1
58 elif [ "$actual_ext" == "tar.gz" ]; then
59 tar xzf $canonical_path -C $source_dir --strip-components=1
60 elif [ "$actual_ext" == "tar.bz2" ]; then
61 tar xjf $canonical_path -C $source_dir --strip-components=1
63 echo "$0: Invalid file type."
68 elif [ "$#" -eq 3 ]; then
69 source_dir=`dirname $1`
70 build_dir=`dirname $2`
73 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir] [build_type]"
76 echo "Given source dir : \"$source_dir\""
77 echo "Given build dir : \"$build_dir\""
79 echo "Configuring sources... "
81 $source_dir/configure \
82 -prefix ${HOME}/local \
84 -opensource -shared -fast \
89 -nomake demos -nomake examples \
93 echo "Configuring sources... done."
95 echo "Compiling sources..."
97 make $number_of_processes
98 echo "Compiling sources... done."
100 echo "Installing package..."
103 echo "Installing package... done."