maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to call a dependency from Ovi Store? (https://talk.maemo.org/showthread.php?t=85735)

flotron 2012-07-27 19:27

How to call a dependency from Ovi Store?
 
I made a theme package, that must be activate it with this app in ovi store called "theme settings"
So i would like to know how can i make the dependency call from my theme package when the file is installing.
I tried modifying the control file adding:
Code:

Depends: meegotouchtheme-settings
But when installing it says that couldn't find the dependency.
So i don't know how to point my app installer to installs "theme settings" before it installs itselfs.

Any idea how can i do this?

rainisto 2012-07-27 21:24

Re: How to call a dependency from Ovi Store?
 
There is no such package in Harmattan repositories, so the error is correct. So what are you really trying to install?

Edit: ah now I figured out what you are trying to do. You cannot add depency to packages that are in ovi store. You can only add depencies to Harmattan repo. So your out of luck, you cannot add depency in deb package, if you really want to kludge around, then your have to add some checking into your application if depency has been installed and if not then open the url to ovi store to download the depency.

flotron 2012-07-27 21:36

Re: How to call a dependency from Ovi Store?
 
It is a must-need app for my theme package, called "theme settings" (http://store.ovi.com/content/300721)
Maybe i express myself wrong and maybe its not called dependency, it is an app that must be installed in the phone to apply my theme deb package.(http://talk.maemo.org/showthread.php?t=85554)

What i want is that the installer first install "theme settings" from ovi store before installs my theme.

rainisto 2012-07-27 21:42

Re: How to call a dependency from Ovi Store?
 
yep there is no way to do that. Only way is to kludge your application to check missing depency and open url to download page.

munozferna 2012-07-27 22:22

Re: How to call a dependency from Ovi Store?
 
Since there is no real "app", this is just a theme, what would be the best way to check this? post install script or something?

flotron 2012-07-27 23:30

Re: How to call a dependency from Ovi Store?
 
Quote:

Originally Posted by rainisto (Post 1243938)
yep there is no way to do that. Only way is to kludge your application to check missing depency and open url to download page.

That is what i want. Check if "theme settings" is installed, so if not installed, it takes the user to the install page in the store or automatically installs

Schturman 2012-07-27 23:41

Re: How to call a dependency from Ovi Store?
 
flotron, you can do something like this:
1. Download Theme settings and put this app to your package, for example: /home/user/MyDocs/Downloads
2. Create a small script with something like this:
Code:

#!/bin/sh

if [ ! -f /path/where is/theme-setting-app/need to be installed ]; then
  echo "Theme setting not installed, trying to install..."
  echo "" | dpkg -i /home/user/MyDocs/Downloads/themesetting.deb || echo "failed to install theme setting"
fi

if [ -f /path/where is/theme-setting-app/need to be installed ]
then /path/where is/theme-setting-app/need to be installed
else
    echo "theme-setting-app not installed. exiting..."
    sleep 2
    exit 0
fi

Put this script also to /home/user/MyDocs/Downloads
3. In your postinst script add command to run this script:
Code:

sh /home/user/MyDocs/Downloads/my-script.sh
Maybe it will work for you..

flotron 2012-07-27 23:56

Re: How to call a dependency from Ovi Store?
 
Thank you for your help Schturman but the main idea is to start publishing harmattan themes in Ovi Store and keep themes separated from the "theme runner" that its not developed by me. And for respect to the original developer.

The developer send me an example theme that make this job but i don't understand it, here is the source and de deb file.

This example theme do the job that i want, but i don't know how to apply it to my theme

Code:

#include <MMessageBox>
#include <QFile>
#include <QDBusConnection>
#include <QDBusInterface>
#include "checkerapplication.h"

CheckerApplication::CheckerApplication(int &argc, char **argv) :
    MApplication(argc, argv)
{
    new CheckerApplicationAdaptor(this);
    QDBusConnection connection = QDBusConnection::sessionBus();
    if (!connection.registerService("com.jormas.vesuri.meegotouchtheme-settings-checker")) {
        qWarning("Unable to register D-Bus service com.jormas.vesuri.meegotouchtheme-settings-checker");
    }
    if (!connection.registerObject("/", this)) {
        qWarning("Unable to register D-Bus object at /");
    }

    if (!QFile::exists("/usr/lib/duicontrolpanel/applets/libmeegotouchtheme-settings.so")) {
        MMessageBox *messageBox = new MMessageBox("To take the theme into use, Theme settings needs to be installed from the Store. Would you like to go to the Store now?", M::YesButton | M::NoButton);
        connect(messageBox, SIGNAL(finished(int)), this, SLOT(openStoreIfAccepted(int)));
        messageBox->setSystem(true);
        messageBox->appear(MSceneWindow::DestroyWhenDone);
    } else {
        exit();
    }
}

CheckerApplication::~CheckerApplication()
{
}

void CheckerApplication::openStoreIfAccepted(int dialogResult)
{
    if (dialogResult == MDialog::Accepted) {
        QDBusInterface("com.nokia.OviStoreClient", "/", "com.nokia.OviStoreClient", QDBusConnection::sessionBus()).call("LaunchWithLink", QStringList() << "http://store.ovi.com/content/300721");
    }
    exit();
}


qwazix 2012-07-28 00:29

Re: How to call a dependency from Ovi Store?
 
How do you package your themes? Scratchbox?

If yes, untar the sample theme, replace the theme folder with your theme, edit the control and changelog file with your info and then dpkg-buildpackage -rfakeroot

flotron 2012-07-28 00:39

Re: How to call a dependency from Ovi Store?
 
i package with this script

Code:

#!/bin/sh

#create .deb files for packages (fremantle&harmattan)

if [ ! $1 ];then
 echo Create .deb files for fremantle and harmattan devices
 echo Usage: make-deb /path/to/package
 exit 0
fi

#step in package directory
chdir "$1"

#versionnumber and packagename from control file
packagename=`grep "Package: " DEBIAN/control | cut -d ' ' -f 2`
versionnumber=`grep "Version: " DEBIAN/control | cut -d ' ' -f 2`

#remove old md5 and digsig sums
rm -f DEBIAN/md5sums 2>/dev/null
rm -f DEBIAN/digsigsums 2>/dev/null

#list all folders except DEBIAN
find | grep -v "./DEBIAN" > ../md5

#get md5 and digsig sums to DEBIAN/
while read line
do
 if [ -f "$line" ]; then
  #cut "./" from beginning
  line=`echo "$line" | cut -c 3-`

  #get md5
  md5sum "$line" >> DEBIAN/md5sums

  #get sha1 for digital signatures
  echo S 15 com.nokia.maemo H 40 `sha1sum "$line" | cut -c -40` R `expr length "$line"` $line >> DEBIAN/digsigsums
 fi
done < "../md5"

#remove temp file list
rm -f ../md5

#package control.tar.gz and data.tar.gz
tar -cvzf ../control.tar.gz -C DEBIAN/ . >/dev/null
tar -cvzf ../data.tar.gz . --exclude=DEBIAN >/dev/null
echo 2.0>../debian-binary

#step outside package folder
cd ..

#create debian archive "package_version.deb"
ar -rcv $packagename"_"$versionnumber.deb debian-binary control.tar.gz data.tar.gz >/dev/null

#remove packaged files
rm -f debian-binary control.tar.gz data.tar.gz 2>/dev/null

I take a look there inside the tar and it seems to be compiled with QT Creator. What happens if i open that folder with QT Creator and modify the name and insert there my theme folder and the compile it? possible?
Sorry if i'm saying silly things here but im trying to learn something:confused:


All times are GMT. The time now is 23:46.

vBulletin® Version 3.8.8