#!/bin/sh #Time-stamp: <2007-05-19 20:12:52 (djcb)> # Copyright (c) 2007, Nokia Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the Nokia Corporation nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER # OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # This is a hackish script to build tinymail/modest packages. # # It must be run *outside* scratchbox. You need to make sure that # the paths below are valid both inside and outside scratchbox. # You can use symlinks to do so. # You must also create the packages/ directory inside the src/ directory. # You will probably also need to correct the SCRATCHBOX variable. # # # config # # Change these to the actual paths to source code of these packages, # in scratchbox. # Use a symlink to create the same path outside of scratchbox. For instance: # ln -s /scratchbox/users/murrayc/home/murrayc/src /home/murrayc/src # # You probably don't have your modest and tinymail packages at the same level, # as required by this script, so you may want to create some symlinks inside # src/, such as: # ln -s /scratchbox/users/murrayc/home/murrayc/svn/modest-private/modest-email /home/murrayc/src/modest-email # ln -s /scratchbox/users/murrayc/home/murrayc/svn/ /home/murrayc/src/tinymail # # On Maemo, you will also need to make some changes to tinymail's debian files: # In tinymail/debian # you should: # cp control.maemo control # cp rules.maemo rules # (I think the script should instead just do this on every run. murrayc) TINYMAIL_PATH="$HOME/src/tinymail" MODEST_PATH="$HOME/src/modest-email/modest/trunk" MAEMO_PROVIDERS_DATA_PATH="$HOME/src/modest-email/maemo-providers-data/" # the packager PACKAGER="Dirk-Jan C. Binnema " # path to the scratchbox executable # On most systems this will actually be # SCRATCHBOX="/usr/bin/scratchbox" SCRATCHBOX="/chroot/usr/bin/scratchbox" # path where the package files end up PACKAGE_PATH="$HOME/src/packages" ################################################### NOW=`date -R` echo "*** Building Tinymail/Modest packages" echo "*** Packager: $PACKAGER" echo "*** Time : ${NOW}" echo # where is scratchbox if test -x $SCRATCHBOX; then echo "+ found scratchbox ($SCRATCHBOX)" else echo "- cannot find find scratchbox" exit 1 fi # checking paths echo echo "*** checking paths" for p in "$TINYMAIL_PATH" "$MODEST_PATH" "$MAEMO_PROVIDERS_DATA_PATH" "$PACKAGE_PATH"; do if test -d $p; then echo "+ found '$p'" else echo "- cannot find '$p'" exit 1 fi if $SCRATCHBOX "test -d $p"; then echo "+ found $p inside scratchbox environment" else echo "- cannot find $p inside scratchbox" exit 1 fi done echo # check svn version; this needs to happen outside scratchbox, because # the scratcbox svn is too old cd $TINYMAIL_PATH TINYMAIL_REVISION="`svn info | grep '^Revision:' | sed 's/Revision: //'`" echo "* tinymail revision: $TINYMAIL_REVISION" cd $MAEMO_PROVIDERS_DATA_PATH MAEMO_PROVIDERS_DATA_REVISION="`svn info | grep '^Revision:' | sed 's/Revision: //'`" echo "* maemo-providers-data revision: $MAEMO_PROVIDERS_DATA_REVISION" cd $MODEST_PATH MODEST_REVISION="`svn info | grep '^Revision:' | sed 's/Revision: //'`" echo "* modest revision: $MODEST_REVISION" echo # build tinymail if test -n "`ls $PACKAGE_PATH/*tinymail*${TINYMAIL_REVISION}*.deb`"; then echo "* tinymail seems already built, skipping (but still installing pkgs)" $SCRATCHBOX "fakeroot dpkg -i ${PACKAGE_PATH}/*${TINYMAIL_REVISION}*.deb" else cd $TINYMAIL_PATH test -e debian/rules || cp debian/rules.maemo debian/rules test -e debian/control || cp debian/control.maemo debian/control mv -f debian/changelog debian/changelog.bak cat > debian/changelog < debian/changelog < debian/changelog < ${PACKAGE_PATH}/Packages.gz" # # echo... and ftp them... # echo "*** done! now, check $PACKAGE_PATH to find your packages" cd $PACKAGE_PATH