###########################################################
# Maemo-efl building script
# Build script
-#
###########################################################
-source "./scripts/helper-functions.sh"
+source "./scripts/message-functions.sh"
source "./scripts/var-definitions.sh"
source "./scripts/log-functions.sh"
source "./scripts/repository-functions.sh"
# Parse comand line options
-while getopts "anchs:t:p:" opt ; do
+
+usage () {
+ cat << EOF
+Usage: $__this_script [OPTIONS]
+Build script for Maemo EFL debian packages.
+Options:
+ -n Don't sign packages.
+ -c Don't update source repositories.
+ -h Show this usage guide.
+ -s PATH Specify alternate scratchbox path (default: $__sbox_path).
+ -r Remove module sub-directories (not the high level debian dir)
+ and then exit.
+ -t A:B:Z Specify scratchbox building targets
+ (default: all targets installed).
+ -u svn_rev Update the latest revision number to "svn_rev" and exit. This
+ only works on revision numbers that has the svn label on
+ the version part (e.g 0.9.9.043+svn32000-maemo1) Also,
+ this option will not create a new entry on the changelog
+ file, it will only change its first line. If you want to
+ update to the latest repository revision number, just use
+ HEAD as parameter.
+ -p P1:P2:PN Specify packges to build (default: build all packages available).
+
+EOF
+}
+
+while getopts "anchre:s:t:u:p:" opt ; do
case "$opt" in
p)
- __python_etk_module=""
- __python_efl_utils_module=""
- __lib_modules=""
- __python_modules=""
- __lib_modules_temp=""
- __python_modules_temp=""
- __not_all_pkgs=1
- __parameters=`echo $OPTARG | $__sed -e 's/:/ /g'`
- for i in $__parameters; do
- __i_temp=`echo $i | grep python`
- if [ -z $__i_temp ]; then
- __lib_modules_temp=$i:$__lib_modules_temp
- else
- if [ $__i_temp == "python-etk" ]; then
- __python_etk_module="python-etk"
- elif [ $__i_temp == "python-efl_utils" ]; then
- __python_efl_utils_module="python-efl_utils"
- else
- __python_modules_temp=$i:$__python_modules_temp
- fi
- fi
- done
- __lib_modules=`echo $__lib_modules_temp | tr "[:upper:]" "[:lower:]"`
- __python_modules=`echo $__python_modules_temp | tr "[:upper:]" "[:lower:]"`
- ;;
- c)
+ __lib_modules_temp=""
+ __python_modules_temp=""
+ __python_efl_utils_module_temp=""
+ __python_dispatcher_module_temp=""
+ __virtual_packages_temp=""
+ __not_all_pkgs=1
+ __parameters=`echo "$OPTARG" | $__sed -e 's/:/ /g'`
+ for i in $__parameters; do
+ for module in `echo "$__lib_modules"|$__sed -e 's/:/ /g'`; do
+ if [ x$module == x$i ]; then
+ __lib_modules_temp=$__lib_modules_temp:$i
+ continue
+ fi
+ done
+
+ for module in `echo "$__python_modules"|$__sed -e 's/:/ /g'`; do
+ if [ x$module == x$i ]; then
+ __python_modules_temp=$__python_modules_temp:$i
+ fi
+ done
+
+ for module in `echo "$__python_efl_utils_module"|$__sed -e 's/:/ /g'`; do
+ if [ x$module == x$i ]; then
+ __python_efl_utils_module_temp=$__python_efl_utils_module_temp:$i
+ continue
+ fi
+ done
+
+ for module in `echo "$__python_dispatcher_module" |$__sed -e 's/:/ /g'`; do
+ if [ x$module == x$i ]; then
+ __python_dispatcher_module_temp=$__python_dispatcher_module_temp:$i
+ continue
+ fi
+ done
+
+ for module in `echo "$__virtual_packages" |$__sed -e 's/:/ /g'`; do
+ if [ x$module == x$i ]; then
+ __virtual_packages_temp=$__virtual_packages_temp:$i
+ continue
+ fi
+ done
+
+ done
+ __lib_modules_temp=`echo "$__lib_modules_temp" | tr "[:upper:]" "[:lower:]"`
+ __python_modules_temp=`echo "$__python_modules_temp" | tr "[:upper:]" "[:lower:]"`
+ __python_efl_utils_module_temp=`echo "$__python_efl_utils_module_temp" | tr "[:upper:]" "[:lower:]"`
+ __python_dispatcher_module_temp=`echo "$__python_dispatcher_module_temp" | tr "[:upper:]" "[:lower:]"`
+ __virtual_packages_temp=`echo "$__virtual_packages_temp" | tr "[:upper:]" "[:lower:]"`
+ ;;
+ c)
__update_repositories=0
- ;;
+ ;;
+ e)
+ __export_dir=$OPTARG
+ if [ "x$__sbox_path" = "x" ] || [ ! -d $__sbox_path ]; then
+ error "Invalid export path: $__export_dir"
+ exit 1
+ fi
+ ;;
h)
usage
exit 0
- ;;
+ ;;
+ r)
+ __force_remove=1
+ ;;
s)
__sbox_path=$OPTARG
if [ "x$__sbox_path" = "x" ] || [ ! -d $__sbox_path ]; then
error "Invalid scratchbox path: $__sbox_path"
- exit 1
+ exit 1
fi
- ;;
- n)
- __no_signing=1
- ;;
- t)
- __sbox_targets_temp=`echo $OPTARG | tr "[:lower:]" "[:upper:]"`
- ;;
+ ;;
+ n)
+ __no_signing=1
+ ;;
+ t)
+ __sbox_targets_temp=`echo $OPTARG | tr "[:lower:]" "[:upper:]"`
+ ;;
+ u)
+ __changelog_update=$OPTARG
+ ;;
?)
usage
exit 1
- ;;
+ ;;
esac
done
-
############################
# Initial checks #
###########################
-# Removing generated hash
-rm -f $__tmp_hash
-# Check if we're running inside scratchbox
-if [ -r /targets/links/scratchbox.config ]; then
- error "You should run this script outside the scratchbox environment."
-fi
+update_all_modules
+init_checks
-# Create base packages dir
-if [ ! -d $__base_pkg_dir ]; then
- msg_begin "Creating base packages dir $__base_pkg_dir"
- $__mkdir -p $__base_pkg_dir
- msg_end $?
+# Remove modules subdirectories and exit
+if [ $__force_remove -eq 1 ]; then
+ clean_modules
+ exit 0
fi
-# Create tmp dir
-if [ ! -d $__tmp_dir ]; then
- msg_begin "Creating tmp dir $__tmp_dir"
- $__mkdir -p $__tmp_dir
- msg_end $?
+# Modify debian changelog
+if [ -n "$__changelog_update" ]; then
+ update_changelog $__changelog_update
+ exit 0
fi
-# Create versions dir
-if [ ! -d $__versions_dir ]; then
- msg_begin "Creating versions dir $__versions_dir"
- $__mkdir -p $__versions_dir
- msg_end $?
+setup_dirs
+
+generate_versions
+
+if [ $__not_all_pkgs -eq 1 ]; then
+ __lib_modules=$__lib_modules_temp
+ __python_modules=$__python_modules_temp
+ __python_efl_utils_module=$__python_efl_utils_module_temp
+ __python_dispatcher_module=$__python_dispatcher_module_temp
+ __virtual_packages=$__virtual_packages_temp
+
+ update_all_modules
+
fi
# Create log file
create_log_file
start_log
-# Download modules under e17/libs
-if [ ! -z $__lib_modules ];then
- msg "Downloading e17 modules"
- get_sources $__lib_modules $__git_repo$__e17_libs
-fi
-
-# Download python modules under proto/python/efl
-if [ ! -z $__python_modules ];then
- msg "Downloading python modules"
- get_sources $__python_modules $__git_repo$__e17_python_efl
-fi
-
-# Download python-etk module
-if [ ! -z $__python_etk_module ];then
- get_sources $__python_etk_module $__git_repo$__e17_python_etk
-fi
-# Download python-efl-utils module
-if [ ! -z $__python_efl_utils_module ];then
- get_sources $__python_efl_utils_module $__git_repo$__e17_python_efl_utils
-fi
-# Download python-dispatcher module
-#get_sources $__python_dispatcher_module $__git_repo$__e17_python_dispatcher
+generate_versions
+# update modules
+download_modules
# Setup scratchbox variables
setup_sbox
msg_end $?
# For each module
- for module in `echo $__lib_modules:$__python_modules:$__python_etk_module|$__sed -e 's/:/ /g'`; do
+ for module in `echo $__lib_modules:$__python_modules|$__sed -e 's/:/ /g'`; do
msg " Building $module packages for $__distro $__arch"
- if [ -d ./$module/$module/debian ]; then
- msg_begin " Removing existing debian directory"
- rm -rf ./$module/$module/debian
- msg_end $?
- fi
-
- msg_begin " Copying specific debian directory"
- if [ -d ./$module/debian ]; then
- cp -r ./$module/debian ./$module/$module/
-
- if [ -d ./$module/debian_$__distro ]; then
- cp -r ./$module/debian_$__distro/* ./$module/$module/debian/
- fi
- else
- if [ -d ./$module/debian_$__distro ]; then
- cp -r ./$module/debian_$__distro ./$module/$module/debian
- else
- echo ""
- warn "Missing debian directory for $module. Ignoring"
- continue
- fi
- fi
- msg_end $?
+ update_debian_dir $module
if [ -d $__tmp_dir/$module/$module ]; then
msg_begin " Removing temporary $module"
fi
msg_begin " Copying $module dir to $__tmp_dir"
- cp -f -u -r $module $__tmp_dir
+ $__tar c --exclude=.svn --exclude=.git $module | $__tar x --directory $__tmp_dir
msg_end $?
- msg_begin " Cleaning $module repository"
- clean_repository $module/$module
- msg_end $?
+# msg_begin " Cleaning $module repository"
+# git_clean_repository $module/$module
+# msg_end $?
msg_begin " Building $module packages"
build_pkg $__tmp_dir/$module
msg_end $?
- if [ -z $__no_signing ]; then
+ if [ -z $__no_signing ]; then
msg_begin " Signing $module packages"
sign_pkgs $__tmp_dir/$module
msg_end $?
- fi
+ fi
msg_begin " Installing $module packages"
install_pkgs $__tmp_dir/$module
msg_end $?
msg_begin " Copying $module packages"
- if [ "x$__arch" != "xarm" ]; then
+ if [ "x$__arch" != "xarmel" ]; then
mv $__tmp_dir/$module/*.dsc $__tmp_dir/$module/*.tar.gz $__pkg_dir
fi
mv $__tmp_dir/$module/*.deb $__tmp_dir/$module/*.changes $__pkg_dir
msg_end $?
done
-exit 0
###########################################################
# ARCHITECTURE INDEPENDENT MODULES
###########################################################
msg " Architecture..: $__arch"
msg " Build Options.: $__build_pkg_options"
- if [ "x$__arch" = "xarm" ]; then
+ if [ "x$__arch" = "xarmel" ]; then
warn "Skipping target $target for architecture independent packages"
continue
fi
msg_end $?
# For each module
- for module in $__python_efl_utils_module; do
+ for module in `echo $__python_efl_utils_module|$__sed -e 's/:/ /g'`; do
+
msg " Building $module packages for $__distro $__arch"
+ update_debian_dir $module
+
if [ ! -d $__tmp_dir/$module ]; then
mkdir $__tmp_dir/$module
msg_end $?
fi
- msg_begin " Copying specific debian directory"
- if [ -d ./$module/debian ]; then
- cp -r ./$module/debian ./$module/$module/
-
- if [ -d ./$module/debian_$__distro ]; then
- cp -r ./$module/debian_$__distro/* ./$module/$module/debian/
- fi
- else
- echo ""
- warn " Missing debian directory for $module. Ignoring"
- continue
- fi
- msg_end $?
msg_begin " Copying $module dir to $__tmp_dir"
- cp -f -u -r $module $__tmp_dir
+ $__tar c --exclude=.svn --exclude=.git $module | $__tar x --directory $__tmp_dir
+ #cp -f -u -r $module $__tmp_dir
msg_end $?
- msg_begin " Cleaning $module repository"
- clean_repository $module/$module
- msg_end $?
+# msg_begin " Cleaning $module repository"
+# git_clean_repository $module/$module
+# msg_end $?
msg_begin " Building $module packages"
build_pkg $__tmp_dir/$module
msg_begin " Signing $module packages"
sign_pkgs $__tmp_dir/$module
msg_end $?
- fi
+ fi
msg_begin " Installing $module packages"
install_pkgs $__tmp_dir/$module
msg " Architecture..: $__arch"
msg " Build Options.: $__build_pkg_options"
- if [ "x$__arch" = "xarm" ]; then
+ if [ "x$__arch" = "xarmel" ]; then
warn "Skipping target $target for architecture independent packages"
continue
fi
msg_end $?
# For each module
- for module in $__virtual_packages; do
+ for module in `echo $__virtual_packages|$__sed -e 's/:/ /g'`; do
msg " Building $module packages for $__distro $__arch"
+ update_debian_dir $module
+
if [ ! -d $__tmp_dir/$module ]; then
mkdir $__tmp_dir/$module
fi
fi
msg_begin " Copying $module dir to $__tmp_dir"
- cp -f -u -r $module $__tmp_dir/$module
+ $__tar c --exclude=.svn --exclude=.git $module | $__tar x --directory $__tmp_dir
+ #cp -f -u -r $module $__tmp_dir/$module
msg_end $?
msg_begin " Building $module packages"
build_pkg $__tmp_dir/$module
msg_end $?
- if [ -z $__no_signing ]; then
+ if [ -z $__no_signing ]; then
msg_begin " Signing $module packages"
sign_pkgs $__tmp_dir/$module
msg_end $?
- fi
+ fi
msg_begin " Installing $module packages"
install_pkgs $__tmp_dir/$module
# END
finish_log
-