2007-05-17 Murray Cumming <murrayc@murrayc.com>
[modest] / scripts / build-packages
index 57fd7dc..93fcf78 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#Time-stamp: <2007-05-04 08:07:31 (djcb)>
+#Time-stamp: <2007-05-16 11:54:34 (djcb)>
 
 # Copyright (c) 2007, Nokia Corporation
 # All rights reserved.
 #
 
 #
-# hackish script to build tinymail/modest packages
-# run *outside* scratchbox; you need to make sure that
-# the paths below are valid both inside/outside scratchbox;
-# you can use symlinks to do so
+# 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 these packages
+# 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"
 MODEST_PROVIDERS_DATA_PATH="$HOME/src/modest-email/modest-providers-data/"
@@ -50,6 +70,8 @@ MODEST_PROVIDERS_DATA_PATH="$HOME/src/modest-email/modest-providers-data/"
 PACKAGER="Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>"
 
 # 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
@@ -113,8 +135,8 @@ if test -n "`ls $PACKAGE_PATH/*tinymail*${TINYMAIL_REVISION}*.deb`"; then
     $SCRATCHBOX "fakeroot dpkg -i ${PACKAGE_PATH}/*${TINYMAIL_REVISION}*.deb"
 else
     cd $TINYMAIL_PATH
-    test -e debian/rules   || ln -s debian/rules.maemo debian/rules
-    test -e debian/control || ln -s debian/control.maemo debian/control
+    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 <<EOF
 tinymail (1.0-svn${TINYMAIL_REVISION}) unstable; urgency=low
@@ -170,7 +192,7 @@ if test -n "`ls $PACKAGE_PATH/*modest_*${MODEST_REVISION}*.deb`"; then
     $SCRATCHBOX "fakeroot dpkg -i ${PACKAGE_PATH}/*${MODEST_REVISION}*.deb"
 else
     cd $MODEST_PATH
-    test -e debian/control || ln -s debian/control.maemo0 debian/control
+    test -e debian/control || ( cd debian; cp control-maemo0 control; cd .. )
     mv -f debian/changelog debian/changelog.bak
     cat > debian/changelog <<EOF
 modest (1.0-svn${MODEST_REVISION}) unstable; urgency=low