summaryrefslogtreecommitdiff
path: root/dist.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dist.sh')
-rwxr-xr-xdist.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/dist.sh b/dist.sh
new file mode 100755
index 0000000..4121b0a
--- /dev/null
+++ b/dist.sh
@@ -0,0 +1,42 @@
+#!/scratchbox/tools/bin/bash
+
+DBUS_VERSION_MAJOR=$(pkg-config dbus-1 --modversion | awk '{split($$1,t,/\./) ; print t[1]}')
+DBUS_VERSION_MINOR=$(pkg-config dbus-1 --modversion | awk '{split($$1,t,/\./) ; print t[2]}')
+
+HILDON_VERSION_MAJOR=$(pkg-config hildon-1 --modversion | awk '{split($$1,t,/\./) ; print t[1]}')
+HILDON_VERSION_MINOR=$(pkg-config hildon-1 --modversion | awk '{split($$1,t,/\./) ; print t[2]}')
+
+MAEMO_VERSION="1"
+if [ $DBUS_VERSION_MINOR -gt 23 ]; then
+ MAEMO_VERSION="2"
+fi
+
+if [ $HILDON_VERSION_MAJOR -eq 1 ]; then
+MAEMO_VERSION="4"
+fi
+
+echo "Maemo version: $MAEMO_VERSION Hildon version: $HILDON_VERSION_MAJOR.$HILDON_VERSION_MINOR"
+
+rm -rf *~
+
+# Build binary package
+make clean
+rm -rf debian/nethack
+rm -f debian
+ln -s debian-maemo${MAEMO_VERSION} debian
+dpkg-buildpackage -rfakeroot -b
+
+# Build source package
+make clean
+rm -rf debian/nethack
+rm -f debian
+rm -rf nethack-3.4.3
+rm -rf nethack_maemo
+mkdir nethack_maemo
+cp -r * nethack_maemo
+rm -rf nethack_maemo/nethack-343-src.tgz
+rm -rf nethack_maemo/nethack_maemo
+rm -rf nethack_maemo/debian/nethack
+tar czvf nethack_maemo.tar.gz nethack_maemo
+mv -f nethack_maemo.tar.gz ..
+rm -rf nethack_maemo