0eac4bf65b69b9bbfe75e6ba06e2596345044119
[maemo-efl] / trunk / scripts / build.sh
1 #!/bin/sh
2
3 components=$*
4 [ -z "$components" ] && components="eet evas ecore embryo edje python-evas python-ecore python-edje"
5
6 export SBOX_DEFAULT_AUTOMAKE=1.8
7
8 for build_variant in n770 n8x0 ; do
9         echo "===== building packages for $build_variant ====="
10         for component in $components ; do
11                 echo "===== $component: preparing sources ====="
12                 rm -rf ./$component
13                 svn export https://garage.maemo.org/svn/maemo-efl/trunk/$component
14
15                 # Unpacking original tarball
16                 cd $component
17                 tar -zxf ../${component}_*.orig.tar.gz --strip-path 1 || exit
18
19                 # if this patch exists we have to patch here
20                 if [ -f debian/patches/01_dont_overwrite_changelog ] ; then
21                         QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null push -a -f || exit
22                         if [ -f configure.in ] ; then
23                                 automake
24                                 autoconf
25                         fi
26                 fi
27
28                 # set build_variant suffix
29                 PKG_VER=`dpkg-parsechangelog | sed -n 's/Version: //p'`
30                 NEW_VER=`echo $PKG_VER | sed "s/\($PKG_VER\)/\1.$build_variant/"`
31                 sed -ie "s/$PKG_VER.*)/$NEW_VER)/" debian/changelog
32                 rm -f debian/changelog
33
34                 echo "===== $component: building for $build_variant ====="
35
36                 # FIXME: install build dependencies here
37                 DEB_BUILD_OPTIONS=$build_variant dpkg-buildpackage -rfakeroot -us -uc -sa -d || exit
38
39                 # install results
40                 srcname=`grep Source: debian/control |cut -f2 -d' '`
41                 grep '^ [a-f0-9]\+ [0-9]\+ [a-z]\+ [a-z]\+ .\+.deb' \
42                         ../${srcname}_${NEW_VER}_*.changes | cut -f6 -d' '|sed -e 's/^/..\//' \
43                                 | xargs fakeroot dpkg -i || exit
44         done
45         cd ..
46 done
47