From f713544958c0fd3573204b62f8b4ff48c315164f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 10 Jul 2015 18:56:58 +0200 Subject: [PATCH] add packLibs fix guhd.conf port --- guh.pro | 16 ++++++++++++++-- libguh/guhsettings.cpp | 1 + meta/create_snap.sh | 3 --- meta/packLibs.sh | 26 ++++++++++++++++++++++++++ meta/package.yaml | 1 + 5 files changed, 42 insertions(+), 5 deletions(-) delete mode 100755 meta/create_snap.sh create mode 100755 meta/packLibs.sh diff --git a/guh.pro b/guh.pro index c5acc823..0eb46673 100644 --- a/guh.pro +++ b/guh.pro @@ -79,7 +79,8 @@ contains(DEFINES, SNAPPY){ meta.files = meta/package.yaml \ meta/readme.md \ meta/guh-logo.svg \ - meta/license.txt + meta/license.txt \ + meta/packLibs.sh meta.path = /meta/ wrapper.files = meta/guhd-wrapper.sh @@ -100,5 +101,16 @@ contains(DEFINES, SNAPPY){ sqlplugin.files = /usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers/libqsqlite.so sqlplugin.path = /usr/lib/qt5/plugins/sqldrivers/ - INSTALLS += meta wrapper qtlibs sqlplugin + # install guhd.conf + guhdconf.files = data/config/guhd.conf + guhdconf.path = /config/ + + INSTALLS += meta wrapper qtlibs sqlplugin guhdconf + + # command to pack libs for snappy package + packlibs.depends = libguh server + packlibs.commands = $$top_srcdir/meta/packLibs.sh $$top_srcdir + + QMAKE_EXTRA_TARGETS += packlibs + } diff --git a/libguh/guhsettings.cpp b/libguh/guhsettings.cpp index c4830f63..8cd17289 100644 --- a/libguh/guhsettings.cpp +++ b/libguh/guhsettings.cpp @@ -190,6 +190,7 @@ QString GuhSettings::logPath() logPath = QDir::homePath() + "/.config/" + organisationName + "/guhd.sqlite"; } #endif // SNAPPY + return logPath; } diff --git a/meta/create_snap.sh b/meta/create_snap.sh deleted file mode 100755 index 7a693aac..00000000 --- a/meta/create_snap.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - - diff --git a/meta/packLibs.sh b/meta/packLibs.sh new file mode 100755 index 00000000..873c384e --- /dev/null +++ b/meta/packLibs.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +function packLib() +{ +echo -e "\nCopy dependencies for ${1}" +deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1 ~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/') + +#Copy the deps +for dep in $deps +do + cp -v "$dep" "$2" +done +} + +################################################# +if [ -d ./dependencies ]; then + echo "Clean dependency folder" + rm -rf ./dependencies/* +else + mkdir -v ./dependencies +fi + +packLib libguh/libguh.so ./dependencies +packLib server/guhd ./dependencies + +# TODO: pack qt plugin sqlite driver lib diff --git a/meta/package.yaml b/meta/package.yaml index 64f7dba4..498ad346 100644 --- a/meta/package.yaml +++ b/meta/package.yaml @@ -13,3 +13,4 @@ services: caps: - networking - network-service +