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"
29 ALL_MODULES+=("elementary"
33 MAEMO_REPO="extras-devel"
35 MAEMO_EFL_BASE_REPO="https://garage.maemo.org/svn/maemo-efl/trunk/"
38 echo " ERROR" && exit 1
42 if [ -d $TMP_DIR ]; then
43 echo -n "Cleaning up ..."
44 rm -rf $TMP_DIR || exit_error
48 echo -n "Creating build dir ..."
49 mkdir -p $TMP_DIR || exit_error
53 checkout_repositories(){
54 echo "Checking out repositories ..."
55 for module in ${ALL_MODULES[@]};do
60 echo -n $module | grep elementary > /dev/null 2>&1 && REPO="$E_BASE_REPO/TMP/st"
61 echo -n $module | grep ethumb > /dev/null 2>&1 && REPO="$E_BASE_REPO/PROTO"
62 echo -n $module | grep python > /dev/null 2>&1 && REPO=$E_PYTHON_REPO
63 echo -n $module | grep efl-core > /dev/null 2>&1 && cp -r $module $TMP_DIR && echo " ... OK" && continue
66 svn co $REV $REPO/$module $TMP_DIR/$module > /dev/null 2>&1 || exit_error
68 rm -rf $TMP_DIR/$module/debian
70 cp -r $module/debian $TMP_DIR/$module/debian > /dev/null 2>&1 || exit_error
74 echo -n "Cleaning up repositories ..."
75 rm -rf `find $TMP_DIR -name .svn -type d`
76 rm -rf `find $TMP_DIR -name .git -type d`
81 echo "Updating changelogs ..."
82 for module in ${ALL_MODULES[@]};do
85 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`
87 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`
89 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`
92 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
93 echo " `head -n1 $TMP_DIR/$module/debian/changelog`"
98 if [ ! -d $VERSIONS_DIR ]; then
99 echo -n "Creating versions dir $VERSIONS_DIR ..."
100 mkdir -p $VERSIONS_DIR || exit_error
104 echo "Generating version files ..."
105 for module in ${ALL_MODULES[@]};do
106 VERSION=`dpkg-parsechangelog -l$TMP_DIR/$module/debian/changelog | grep Version: | cut -d" " -f2 || exit_error`
107 echo " $module ... $VERSION"
108 echo "$VERSION" > $VERSIONS_DIR/"$module"_version
113 echo "Generating control files ..."
114 for module in ${ALL_MODULES[@]}; do
115 echo -n " $module ..."
116 if [ -e $TMP_DIR/$module/debian/control.in ]; then
117 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`
118 cp $TMP_DIR/$module/debian/control.in $TMP_DIR/$module/debian/control.temp
120 for replacement in $TO_REPLACE; do
121 replacement_lowercase=`echo $replacement | tr "[:upper:]" "[:lower:]"`
122 version_file=$VERSIONS_DIR/$replacement_lowercase
123 if [ ! -e $version_file ]; then
124 echo -n " Could not find a replacement for $replacement" && exit_error
126 version_number=`cat $version_file`
127 echo -n " $replacement: $version_number"
128 sed -i s/@$replacement@/$version_number/g $TMP_DIR/$module/debian/control.temp
131 mv $TMP_DIR/$module/debian/control.temp $TMP_DIR/$module/debian/control
139 echo "Generating source packages ..."
140 for module in ${ALL_MODULES[@]}; do
142 cd $TMP_DIR/$module || exit_error
144 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
146 cd - > /dev/null 2>&1 || exit_error
152 checkout_repositories
157 echo "All done. Packages in $TMP_DIR"