[oe-commits] Paul Eggleton : shopper: install data file to palmtopdir/ share instead of homedir

GIT User account git at amethyst.openembedded.net
Mon Nov 17 22:32:17 UTC 2008


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 9e342538db7de945070b103130b42ebe68c4ffb9
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=9e342538db7de945070b103130b42ebe68c4ffb9

Author: Paul Eggleton <bluelightning at bluelightning.org>
Date:   Mon Nov 17 22:30:00 2008 +0000

shopper: install data file to palmtopdir/share instead of homedir

---

 packages/shopper/shopper-1.2.1/path_fix.patch |   23 +++++++++++++++++++++++
 packages/shopper/shopper_1.2.1.bb             |   19 ++++++++++---------
 2 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/packages/shopper/shopper-1.2.1/path_fix.patch b/packages/shopper/shopper-1.2.1/path_fix.patch
new file mode 100644
index 0000000..d8142c7
--- /dev/null
+++ b/packages/shopper/shopper-1.2.1/path_fix.patch
@@ -0,0 +1,23 @@
+--- Shopper/shoplist.cpp	2008-11-17 21:09:26.000000000 +0000
++++ Shopper/shoplist.cpp	2008-11-17 22:21:12.000000000 +0000
+@@ -38,6 +38,7 @@
+ #include <qmessagebox.h>
+ #include <qregexp.h>
+ 
++#include <stdlib.h>
+ 
+ // TODO: Somewhere it should say:
+ //  if (mode == ShoppingItem::Left && nothing_left) {
+@@ -229,6 +230,12 @@
+   QString fileName = Global::applicationFileName("ShoppingListQt", "shoppinglist.xml");
+ 
+   QFile file( fileName );
++  if ( ! file.exists() ) {
++    // Ugly hack
++    QString cmd = QString("cp " SHOPPER_DATADIR "/shoppinglist.xml ") + fileName;
++    system(cmd);
++  }
++
+   _startCategory = static_cast<CategoryItem*>(_showAllAction);
+   // If there's a file - read it. If not then we drop through to do
+   // other initialisation.
diff --git a/packages/shopper/shopper_1.2.1.bb b/packages/shopper/shopper_1.2.1.bb
index 8f6eab4..d84af43 100644
--- a/packages/shopper/shopper_1.2.1.bb
+++ b/packages/shopper/shopper_1.2.1.bb
@@ -3,18 +3,19 @@ SECTION = "opie/applications"
 PRIORITY = "optional"
 LICENSE = "GPL"
 
+PR = "r1"
+
 SRC_URI = "${SOURCEFORGE_MIRROR}/zaurus-shopper/Shopper-${PV}.tar.gz \
-           file://gcc3.patch;patch=1"
+           file://gcc3.patch;patch=1 \
+           file://path_fix.patch;patch=1"
 S = "${WORKDIR}/Shopper"
 
 inherit palmtop
 
-QMAKE_PROFILES = "Shopper.pro"
+SHOPPER_DATADIR = "${palmtopdir}/share/shopper"
+CXXFLAGS_append += " -DSHOPPER_DATADIR='"${SHOPPER_DATADIR}"' "
 
-pkg_preinst() {
-	cp /root/Applications/ShoppingListQt/shoppinglist.xml /root/Applications/ShoppingListQt/shoppinglist.xml.safe 2>/dev/null
-	true
-}
+QMAKE_PROFILES = "Shopper.pro"
 
 pkg_postinst() {
 	/opt/QtPalmtop/bin/qcop QPE/System "linkChanged(QString)" 2>/dev/null
@@ -25,11 +26,11 @@ do_install() {
         install -d ${D}${palmtopdir}/bin \
         	   ${D}${palmtopdir}/apps/Applications \
         	   ${D}${palmtopdir}/pics \
-        	   ${D}${palmtopdir}/help/html
+        	   ${D}${palmtopdir}/help/html \
+               ${D}${SHOPPER_DATADIR}
         install -m 0755 ${S}/Shopper ${D}${palmtopdir}/bin/
         install -m 0644 ${S}/Shopper.desktop ${D}${palmtopdir}/apps/Applications/
         install -m 0644 ${S}/Shopper.png ${D}${palmtopdir}/pics/
         install -m 0644 ${S}/Shopper.html ${D}${palmtopdir}/help/html/
-# BAD BAD BAD: packages never install into home directories. ever. --CL
-#        install -m 0644 ${S}/shoppinglist.xml ${D}root/Applications/ShoppingListQt/shoppinglist.xml.new
+        install -m 0644 ${S}/shoppinglist.xml ${D}${SHOPPER_DATADIR}/shoppinglist.xml
 }





More information about the Openembedded-commits mailing list