3 E_BASE_REPO="http://svn.enlightenment.org/svn/e"
4 E_TRUNK_REPO="$E_BASE_REPO/trunk"
5 E_PYTHON_SUFIX="BINDINGS/python"
6 E_PYTHON_REPO="$E_TRUNK_REPO/$E_PYTHON_SUFIX"
7 E_PROTO_REPO="$E_TRUNK_REPO/PROTO"
9 [ -z $E_SVN_REV ] && E_SVN_REV="44144"
11 TMP_DIR="maemo-efl-deb-src-$E_SVN_REV"
12 VERSIONS_DIR="$TMP_DIR/versions"
30 ALL_MODULES+=("python-evas"
40 MAEMO_REPO="extras-devel"
42 MAEMO_EFL_BASE_REPO="https://garage.maemo.org/svn/maemo-efl/trunk/"
45 echo " ERROR" && exit 1
49 if [ -d $TMP_DIR ]; then
50 echo -n "Cleaning up ..."
51 rm -rf $TMP_DIR || exit_error
55 echo -n "Creating build dir ..."
56 mkdir -p $TMP_DIR || exit_error
60 checkout_repositories(){
61 echo "Checking out repositories ..."
62 for module in ${ALL_MODULES[@]};do
67 REPO="$E_BASE_REPO/TMP/st"
73 cp -r $module $TMP_DIR > /dev/null 2>&1 && echo " ... OK" || exit_error
87 svn co $REV $REPO/$module $TMP_DIR/$module > /dev/null 2>&1 || exit_error
89 rm -rf $TMP_DIR/$module/debian
91 cp -r $module/debian $TMP_DIR/$module/debian > /dev/null 2>&1 || exit_error
95 echo -n "Cleaning up repositories ..."
96 rm -rf `find $TMP_DIR -name .svn -type d`
97 rm -rf `find $TMP_DIR -name .git -type d`
102 echo "Updating changelogs ..."
103 for module in ${ALL_MODULES[@]};do
104 echo -n " $module .."
108 VERSION=`grep AC_INIT $TMP_DIR/evas/configure.ac | cut -d[ -f3 | cut -d] -f1 || exit_error`
111 VERSION=`grep version $TMP_DIR/$module/setup.py | cut -d\' -f2 || exit_error`
114 VERSION=`grep AC_INIT $TMP_DIR/$module/configure.ac | cut -d[ -f3 | cut -d] -f1 || exit_error`
119 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
120 echo " `head -n1 $TMP_DIR/$module/debian/changelog`"
125 if [ ! -d $VERSIONS_DIR ]; then
126 echo -n "Creating versions dir $VERSIONS_DIR ..."
127 mkdir -p $VERSIONS_DIR || exit_error
131 echo "Generating version files ..."
132 for module in ${ALL_MODULES[@]};do
133 VERSION=`dpkg-parsechangelog -l$TMP_DIR/$module/debian/changelog | grep Version: | cut -d" " -f2 || exit_error`
134 echo " $module ... $VERSION"
135 echo "$VERSION" > $VERSIONS_DIR/"$module"_version
140 echo "Generating control files ..."
141 for module in ${ALL_MODULES[@]}; do
142 echo -n " $module ..."
143 if [ -e $TMP_DIR/$module/debian/control.in ]; then
144 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`
145 cp $TMP_DIR/$module/debian/control.in $TMP_DIR/$module/debian/control.temp
147 for replacement in $TO_REPLACE; do
148 replacement_lowercase=`echo $replacement | tr "[:upper:]" "[:lower:]"`
149 version_file=$VERSIONS_DIR/$replacement_lowercase
150 if [ ! -e $version_file ]; then
151 echo -n " Could not find a replacement for $replacement" && exit_error
153 version_number=`cat $version_file`
154 echo -n " $replacement: $version_number"
155 sed -i s/@$replacement@/$version_number/g $TMP_DIR/$module/debian/control.temp
158 mv $TMP_DIR/$module/debian/control.temp $TMP_DIR/$module/debian/control
166 echo "Generating source packages ..."
167 for module in ${ALL_MODULES[@]}; do
169 cd $TMP_DIR/$module || exit_error
171 dpkg-buildpackage -rfakeroot -us -uc -sa -d -S -I.git -I.gitignore -I.svn -I.svnignore -ICVS -I.cvsignore > /dev/null 2>&1|| exit_error
173 cd - > /dev/null 2>&1 || exit_error
179 checkout_repositories
184 echo "All done. Packages in $TMP_DIR"