Building guh snappy package

Simon Stürz timonmailinglist at gmail.com
Wed Sep 23 15:14:49 UTC 2015


Hello everyone!

I'm trying to build a snappy package for our IoT server guh 
(https://github.com/guh/guh/wiki). A couple of months ago I had a 
working snappy package.
Now I tried to update the whole package and tested it on the new release.
It seems some things have changed and I have many questions where I 
haven't found any answers yet (please tell me if this is to much for one 
thread).

Short summery:
The guh snappy provides the server guhd (written in Qt), the libguh and 
the plugins (plugins are libs which will be loaded dynamically to extend 
the system
with new device support), the command line interface guh-cli (written in 
python) and the guh-webinterface (a static folder containing the JS 
webinterface).

In order to cross compile the Qt server/libs/plugins I used the Ubuntu 
Click SDK which worked perfectly. For the dependencies I wrote a script 
(based on ldd) which copies
all dependencies to a folder.
For the guh-cli I used cy_freeze to make a python standalone. It worked 
also using just the scripts (without providing the python libs),
but I have no idea if python will always be provided by the system?? 
...so I put them in the package just to be sure.

Questions:
1. For starting the service guhd I wrote a little script, which does all 
the export stuff for me:

#!/bin/sh

export QT_PLUGIN_PATH=$SNAPP_APP_PATH/usr/lib/qt5/plugins
export LD_LIBRARY_PATH=$SNAPP_APP_PATH/usr/lib:$LD_LIBRARY_PATH
$SNAPP_APP_PATH/usr/bin/guhd -n

Since the last update, the env $SNAPP_APP_PATH does not exist any more. 
Is there a new (maybe better) way to get the app directory? Or a better 
way to add the lib path?
Currently this is the most important question for me. I really have no 
idea how to continue from here. If each snappy package can bring it's 
own libs, is there a mechanism which allows the binary to find those libs?

2. In the deb package of guh, there is also a config file which normally 
is placed in /etc/guh/guhd.conf. For the snappy app I placed this config 
file in $SNAPP_APP_PATH/config. Is there a convention where service 
settings should be placed?

3. guhd provides also a logging system, which creates a sqlite database. 
Is /var/log/guhd.log still the right place for that?

4. How can I make a snappy package for multiple architectures? Since I 
already have debian packages of guh for armhf, i386 and amd64 (vivid) is 
there a possibility to use these builds? Where do I have to place the 
different arch libs in the snappy environment and where the binaries?

I hope you guys can help me! :) I'm thankful for any suggestions!

Cheers,
Simon






More information about the snappy-app-devel mailing list