3 E_BASE_REPO="http://svn.enlightenment.org/svn/e/trunk"
4 E_PYTHON_REPO="$E_BASE_REPO/BINDINGS/python"
7 TMP_DIR="maemo-efl-deb-src-$E_SVN_REV"
8 VERSIONS_DIR="$TMP_DIR/versions"
10 ALL_MODULES="eina eet evas ecore embryo edje epsilon etk e_dbus efl-core python-evas python-ecore python-edje python-epsilon python-etk python-e_dbus python-efl_utils python-efl-core"
13 MAEMO_REPO="extras-devel"
15 MAEMO_EFL_BASE_REPO="https://garage.maemo.org/svn/maemo-efl/trunk/"
18 echo " ERROR" && exit 1
22 if [ -d $TMP_DIR ]; then
23 echo -n "Cleaning up ..."
24 rm -rf $TMP_DIR || exit_error
28 echo -n "Creating build dir ..."
29 mkdir -p $TMP_DIR || exit_error
33 checkout_repositories(){
34 echo "Checking out repositories ..."
35 for module in $ALL_MODULES;do
40 echo -n $module | grep python > /dev/null 2>&1 && REPO=$E_PYTHON_REPO
41 echo -n $module | grep efl-core > /dev/null 2>&1 && cp -r $module $TMP_DIR && echo " ... OK" && continue
44 svn co $REV $REPO/$module $TMP_DIR/$module > /dev/null 2>&1 || exit_error
46 rm -rf $TMP_DIR/$module/debian
48 cp -r $module/debian $TMP_DIR/$module/debian > /dev/null 2>&1 || exit_error
52 echo -n "Cleaning up repositories ..."
53 rm -rf `find $TMP_DIR -name .svn -type d`
54 rm -rf `find $TMP_DIR -name .git -type d`
59 echo "Updating changelogs ..."
60 for module in $ALL_MODULES;do
63 echo -n $module | grep -v python | grep -v efl-core > /dev/null 2>&1 && VERSION=`grep AC_INIT $TMP_DIR/$module/configure.ac | cut -d[ -f3 | cut -d] -f1 || exit_error`
65 echo -n $module | grep python | grep -v efl-core > /dev/null 2>&1 && VERSION=`grep version $TMP_DIR/$module/setup.py | cut -d\' -f2 || exit_error`
67 echo -n $module | grep efl-core > /dev/null 2>&1 && VERSION=`grep AC_INIT $TMP_DIR/evas/configure.ac | cut -d[ -f3 | cut -d] -f1 || exit_error`
70 dch --force-distribution -b -c $TMP_DIR/$module/debian/changelog -v $VERSION+svn$E_SVN_REV-$MAEMO_REV -D $MAEMO_REPO "SVN snapshot release $E_SVN_REV" > /dev/null 2>&1 || exit_error
71 echo " `head -n1 $TMP_DIR/$module/debian/changelog`"
76 if [ ! -d $VERSIONS_DIR ]; then
77 echo -n "Creating versions dir $VERSIONS_DIR ..."
78 mkdir -p $VERSIONS_DIR || exit_error
82 echo "Generating version files ..."
83 for module in $ALL_MODULES;do
84 VERSION=`dpkg-parsechangelog -l$TMP_DIR/$module/debian/changelog | grep Version: | cut -d" " -f2 || exit_error`
85 echo " $module ... $VERSION"
86 echo "$VERSION" > $VERSIONS_DIR/"$module"_version
91 echo "Generating control files ..."
92 for module in $ALL_MODULES; do
93 echo -n " $module ..."
94 if [ -e $TMP_DIR/$module/debian/control.in ]; then
95 TO_REPLACE=`grep -o -E '@([A-Z]|[0-9])+((-|_)*([A-Z]|[0-9]))*_VERSION@' $TMP_DIR/$module/debian/control.in | cut -d @ -f 2 | sort -u`
96 cp $TMP_DIR/$module/debian/control.in $TMP_DIR/$module/debian/control.temp
98 for replacement in $TO_REPLACE; do
99 replacement_lowercase=`echo $replacement | tr "[:upper:]" "[:lower:]"`
100 version_file=$VERSIONS_DIR/$replacement_lowercase
101 if [ ! -e $version_file ]; then
102 echo -n " Could not find a replacement for $replacement" && exit_error
104 version_number=`cat $version_file`
105 echo -n " $replacement: $version_number"
106 sed -i s/@$replacement@/$version_number/g $TMP_DIR/$module/debian/control.temp
109 mv $TMP_DIR/$module/debian/control.temp $TMP_DIR/$module/debian/control
117 echo "Generating source packages ..."
118 for module in $ALL_MODULES; do
120 cd $TMP_DIR/$module || exit_error
122 dpkg-buildpackage -rfakeroot -us -uc -D -sa -S -I.git -I.gitignore -I.svn -I.svnignore -ICVS -I.cvsignore > /dev/null 2>&1|| exit_error
124 cd - > /dev/null 2>&1 || exit_error
130 checkout_repositories
135 echo "All done. Packages in $TMP_DIR"