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 $OUTPUT_FILE ] && OUTPUT_FILE="/dev/null"
10 [ -z $E_SVN_REV ] && E_SVN_REV="50928"
12 TMP_DIR="maemo-efl-deb-src-$E_SVN_REV"
13 VERSIONS_DIR="$TMP_DIR/versions"
31 ALL_MODULES+=("python-evas"
41 MAEMO_REPO="extras-devel"
43 function exit_error(){
44 echo " ERROR" && exit 1
48 if [ -d $TMP_DIR ]; then
49 echo -n "Cleaning up ..."
50 rm -rf $TMP_DIR || exit_error
54 echo -n "Creating build dir ..."
55 mkdir -p $TMP_DIR || exit_error
59 function checkout_repositories(){
60 echo "Checking out repositories ..."
61 for module in ${ALL_MODULES[@]};do
66 REPO="$E_TRUNK_REPO/TMP/st"
72 cp -r $module $TMP_DIR >> $OUTPUT_FILE 2>&1 && echo " ... OK" || exit_error
86 svn co $REV $REPO/$module $TMP_DIR/$module >> $OUTPUT_FILE 2>&1 || exit_error
88 rm -rf $TMP_DIR/$module/debian
90 cp -r $module/debian $TMP_DIR/$module/debian >> $OUTPUT_FILE 2>&1 || exit_error
94 echo -n "Cleaning up repositories ..."
95 rm -rf `find $TMP_DIR -name .svn -type d`
96 rm -rf `find $TMP_DIR -name .git -type d`
100 function c_module_version() {
103 [ -z $mod ] && exit_error
105 VERSION=`grep AC_INIT $TMP_DIR/$mod/configure.ac | cut -d[ -f3 | cut -d] -f1 || exit_error`
106 if [ $VERSION = "v_ver" ]; then
107 MAJOR=`grep v_maj $TMP_DIR/$mod/configure.ac | xargs | cut -d[ -f3 | cut -d] -f1 || exit_error`
108 MINOR=`grep v_min $TMP_DIR/$mod/configure.ac | xargs | cut -d[ -f3 | cut -d] -f1 || exit_error`
109 MICRO=`grep v_mic $TMP_DIR/$mod/configure.ac | xargs | cut -d[ -f3 | cut -d] -f1 || exit_error`
110 if [ -z $MAJOR ] || [ -z $MINOR ] || [ -z $MICRO ]; then
114 VERSION=$MAJOR.$MINOR.$MICRO
118 function update_changelogs(){
119 echo "Updating changelogs ..."
120 for module in ${ALL_MODULES[@]};do
125 c_module_version "evas"
128 VERSION=`grep version $TMP_DIR/$module/setup.py | cut -d\' -f2 || exit_error`
131 c_module_version "$module"
136 if [ -z $VERSION ] || [ $VERSION = "v_ver" ]; then
141 dch --force-distribution -b -c $TMP_DIR/$module/debian/changelog -v $VERSION.$E_SVN_REV-$MAEMO_REV -D $MAEMO_REPO "SVN snapshot release $E_SVN_REV" >> $OUTPUT_FILE 2>&1 || exit_error
142 echo " `head -n1 $TMP_DIR/$module/debian/changelog`"
146 function gen_versions(){
147 if [ ! -d $VERSIONS_DIR ]; then
148 echo -n "Creating versions dir $VERSIONS_DIR ..."
149 mkdir -p $VERSIONS_DIR || exit_error
153 echo "Generating version files ..."
154 for module in ${ALL_MODULES[@]};do
155 VERSION=`dpkg-parsechangelog -l$TMP_DIR/$module/debian/changelog | grep Version: | cut -d" " -f2 || exit_error`
156 echo " $module ... $VERSION"
157 echo "$VERSION" > $VERSIONS_DIR/"$module"_version
162 echo "Generating control files ..."
163 for module in ${ALL_MODULES[@]}; do
164 echo -n " $module ..."
165 if [ -e $TMP_DIR/$module/debian/control.in ]; then
166 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`
167 cp $TMP_DIR/$module/debian/control.in $TMP_DIR/$module/debian/control.temp
169 for replacement in $TO_REPLACE; do
170 replacement_lowercase=`echo $replacement | tr "[:upper:]" "[:lower:]"`
171 version_file=$VERSIONS_DIR/$replacement_lowercase
172 if [ ! -e $version_file ]; then
173 echo -n " Could not find a replacement for $replacement" && exit_error
175 version_number=`cat $version_file`
176 echo -n " $replacement: $version_number"
177 sed -i s/@$replacement@/$version_number/g $TMP_DIR/$module/debian/control.temp
180 mv $TMP_DIR/$module/debian/control.temp $TMP_DIR/$module/debian/control
188 echo "Generating source packages ..."
189 for module in ${ALL_MODULES[@]}; do
191 cd $TMP_DIR/$module || exit_error
193 dpkg-buildpackage -rfakeroot -us -uc -sa -d -S -I.git -I.gitignore -I.svn -I.svnignore -ICVS -I.cvsignore >> $OUTPUT_FILE 2>&1|| exit_error
195 cd - >> $OUTPUT_FILE 2>&1 || exit_error
201 checkout_repositories
206 echo "All done. Packages in $TMP_DIR"