3 ## Some configuration variables
4 number_of_processes="-j4"
5 comp_type=-debug-and-release
6 # particular_options=-no-framework
8 ## Check input parameters and process inputs (if needed)
9 if [ "$#" -eq 1 ]; then
10 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
12 for ext in ${valid_extensions[@]}; do
13 if [ `basename $1 $ext` != $1 ]; then
17 if [ "x$actual_ext" == "x" ]; then
18 echo "$0: Invalid file type."
21 canonical_path=`readlink -e $1`
22 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
23 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
24 echo -n "Cleaning directories... "
28 echo -n "Creating directories... "
32 echo -n "Extracting sources... "
33 if [ "$actual_ext" == "zip" ]; then
34 echo unzip $canonical_path
35 elif [ "$actual_ext" == "tar" ]; then
36 tar xf $canonical_path -C $source_dir --strip-components=1
37 elif [ "$actual_ext" == "tar.gz" ]; then
38 tar xzf $canonical_path -C $source_dir --strip-components=1
39 elif [ "$actual_ext" == "tar.bz2" ]; then
40 tar xjf $canonical_path -C $source_dir --strip-components=1
42 echo "$0: Invalid file type."
46 elif [ "$#" -eq 2 ]; then
47 source_dir=`dirname $1`
48 build_dir=`dirname $2`
50 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir]"
53 echo "Given source dir : \"$source_dir\""
54 echo "Given build dir : \"$build_dir\""
56 echo "Configuring sources... "
58 $source_dir/configure \
59 -prefix ${HOME}/local \
61 -opensource -shared -fast \
66 -nomake demos -nomake examples \
70 echo "Configuring sources... done."
72 echo "Compiling sources..."
74 make $number_of_processes
75 echo "Compiling sources... done."
77 echo "Installing package..."
80 echo "Installing package... done."