3 source "helper-functions.sh"
4 __this_script=`basename $0`
5 __this_script_dir=`dirname $0`
16 __git_clone="$__git clone"
17 __git_pull="$__git pull"
18 __git_clean="$__git clean"
19 __git_repo="git://staff.get-e.org/"
21 # e17 repositories paths
23 __e17_proto="e17/proto"
24 __e17_python_efl="$__e17_proto/python-efl"
25 __e17_python_etk="users/cmarcelo"
28 #__lib_modules="edb eet evas ecore embryo edje efreet epeg epsilon emotion etk ewl e_dbus exml enhance"
29 __lib_modules="eet:evas:ecore:embryo:edje:epsilon:etk:e_dbus"
30 __python_modules="python-evas:python-ecore:python-edje:python-epsilon:python-e_dbus"
31 __python_etk_module="python-etk"
35 __common_build_pkg_options="-rfakeroot -us -uc -D -tc"
36 __build_pkg_options="$__common_build_pkg_options -sa"
37 if [ "x$__arch" = "xarm" ] ; then
38 __build_pkg_options="$__common_build_pkg_options -B"
42 __distro=`$__head -1 /etc/apt/sources.list|cut -d" " -f3`
44 # Packages dirs and log file
45 __today=`$__date +%Y%m%d`
46 __base_pkg_dir="$__this_script_dir/packages_$__today"
47 __pkg_dir="$__base_pkg_dir/$__distro/$__arch"
48 __output_file="$PWD/$__base_pkg_dir/packages_$__today.log"
50 # Scratchbox definitions
51 __scratchbox=/scratchbox
53 # Function definitions
57 Usage: $__this_script [OPTIONS]
59 Build script for EFL debian packages for Maemo.
62 -h Show this usage guide.
63 -s PATH Specify alternate scratchbox path (default: $__scratchbox).
68 function log_to_file() {
73 if [ ! -r $__output_file ]; then
74 error "log_to_file(): Log file does not exist"
77 now=`$__date +%H:%M:%S`
78 echo "$now: $msg" >> $__output_file
81 function start_log() {
85 if [ ! -r $__output_file ]; then
86 msg_begin "Creating log file"
90 echo "" >> $__output_file
94 error "start_log(): Could not create $__output_file file"
97 cat << EOF >> $__output_file
98 *********************************************************
99 * Started $__this_script: $now *
100 *********************************************************
109 function finish_log() {
113 if [ ! -r $__output_file ]; then
114 error "finish_log(): Log file does not exist"
117 cat << EOF >> $__output_file
119 * Finished $__this_script: $now
126 `$__git_clone $repo.git 2>&1>> $__output_file`
131 `$__git_pull 2>&1>> $__output_file`
139 function build_pkg() {
144 function install_pkg() {
149 function uninstall_pkg() {
154 function get_sources() {
157 modules=`echo $1|$__sed -e 's/:/ /g'`
160 for module in $modules; do
161 if [ -d $module/$module/.git ]; then
162 log_to_file "Updating existing repository at $PWD/$module/$module"
164 msg_begin " Updating $module repository"
167 cd - 2>&1 >> /dev/null
168 elif [ -d $module/$module ]; then
169 log_to_file "Removing invalid repository at $PWD/$module/$module"
170 rm -rf $module/$module
173 if [ ! -d $module/$module ]; then
175 msg_begin " Cloning $repo/$module.git"
178 cd - 2>&1 >> /dev/null
179 elif [ ! -d $module ]; then
180 error "Directory $module does not exist."
186 while getopts "hs" opt ; do
204 # Distro variable must not be empty
205 msg_begin "Checking maemo distro"
206 test "x$__distro" != "x"
209 # Check if we're running inside scratchbox
210 msg_begin "Checking for scratchbox environment"
211 test -r /targets/links/scratchbox.config
214 # Create packages dir and log file
215 $__mkdir -p $__pkg_dir
217 log_to_file "Created $__pkg_dir"
219 # Download modules under e17/libs
220 msg "Downloading e17 modules"
221 get_sources $__lib_modules $__git_repo$__e17_libs
223 # Download python modules under proto/python/efl
224 msg "Downloading python modules"
225 get_sources $__python_modules $__git_repo$__e17_python_efl
227 # Download python-etk module
228 get_sources $__python_etk_module $__git_repo$__e17_python_etk
234 # Download user modules (python-etk)
240 # Uninstall all packages