3 ###########################################################
4 # Maemo-efl building script
5 # Enviroment setup functions definitions
7 # Note: var-definitions.sh, log-functions.sh
8 # and helper-functions.sh needed.
9 ###########################################################
11 function setup_distro() {
13 local sources_list_file
14 local target_conf_file
17 sources_list_file=$__sbox_path/users/$USER/targets/$target/etc/apt/sources.list
18 target_conf_file=$__sbox_path/users/$USER/targets/$target.config
21 log_to_file "setup_distro(): Target $target"
22 log_to_file "setup_distro(): sources.list file : $sources_list_file"
23 log_to_file "setup_distro(): config file: $target_conf_file"
25 if [ "x$target" != "x" ] && [ -r $sources_list_file ] && [ -r $target_conf_file ]; then
26 # XXX: FIXME Figure out a better way to get the distro string
27 __distro=`$__head -1 $sources_list_file | cut -d" " -f3`
28 __arch=`$__grep SBOX_CPU= $target_conf_file | cut -d= -f2`
29 __pkg_dir="$__base_pkg_dir/$__distro/$__arch"
30 if [ "x$__arch" = "xarm" ] ; then
31 __build_pkg_options="$__common_build_pkg_options -B"
33 __build_pkg_options="$__common_build_pkg_options -I.svn -I.git -I.gitignore -I.cvsignore -sa"
38 if [ $ret -eq 0 ]; then
39 log_to_file "setup_distro(): Configuration:"
40 log_to_file "setup_distro(): distro...........: $__distro"
41 log_to_file "setup_distro(): arch.............: $__arch"
42 log_to_file "setup_distro(): build options....: $__build_pkg_options"
43 log_to_file "setup_distro(): pkg_dir..........: $__pkg_dir"
49 function setup_sbox() {
50 if [ ! -d $__sbox_path ]; then
51 error "Invalid scratchbox path: $__sbox_path"
54 __sbox="$__sbox_path/login"
55 __sbox_tools_bin_path="$__sbox_path/tools/bin"
56 __sbox_sb_conf="$__sbox_tools_bin_path/sb-conf"
58 __sbox_maemo3_debian_bin_path="/scratchbox/devkits/maemo3-debian/bin"
59 __sbox_dpkg="$__sbox_maemo3_debian_bin_path/dpkg"
60 __sbox_dpkg_buildpackage="$__sbox_dpkg-buildpackage"
61 __sbox_dpkg_parsechangelog="$__sbox_dpkg-parsechangelog"
62 __sbox_dpkg_checkbuilddeps="$__sbox_dpkg-checkbuilddeps"
64 __sbox_debian_sarge_bin_path="/scratchbox/devkits/debian-sarge/bin"
65 __sbox_dch="$__sbox_debian_sarge_bin_path/dch"
67 __sbox_targets=`$__sbox_sb_conf list --targets`
70 function change_sbox_target() {
74 $__sbox_sb_conf select $target >> $__output_file 2>&1