summaryrefslogtreecommitdiffstats
path: root/recipes-demo-hmi/navigation/navigation_git.bb
blob: d4e69b566cda7d5ab1fb27ba520a2383dee857bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
SUMMARY     = "AGL Reference Navigation application."
DESCRIPTION = "This application provides the function of Navigation to AGL. "
HOMEPAGE    = "http://agl.wismobi.com/"
SECTION     = "apps"

LICENSE="GPLv2"
LIC_FILES_CHKSUM="file://LICENSE;md5=3595e9c703a847d990664d2b396a9df0 \
                  file://COPYING;md5=947b2d60ca3872e172034438e9801200"

DEPENDS = " \
          glib-2.0 freetype sqlite3 wayland zlib expat openssl virtual/libgles2 virtual/libgl virtual/egl \
          wayland libdbus-c++ af-main af-binder libwindowmanager libhomescreen \
          "

RDEPENDS_${PN} = " flite openjtalk glib-2.0 freetype sqlite3 wayland zlib expat openssl \
                   wayland libdbus-c++ af-main "

RDEPENDS_${PN} += " agl-service-navigation "


SRCREV="2d83844150cce0e245a3d90af67f43385604b569"
SRC_URI="git://github.com/AGLExport/gpsnavi.git;branch=agl \
         file://download_mapdata_jp.sh \
         file://download_mapdata_uk.sh \
         file://org.agl.naviapi.conf \
"

RPROVIDES_${PN} = "virtual/navigation"

# To avoid C++ library link failure
SECURITY_CFLAGS = ""

inherit autotools pkgconfig
inherit aglwgt

S = "${WORKDIR}/git"

do_install_append() {
# mapdata install scripts
   install -d ${D}/usr/AGL/apps
   install -m 0755 ${WORKDIR}/download_mapdata_jp.sh ${D}/usr/AGL/apps/
   install -m 0755 ${WORKDIR}/download_mapdata_uk.sh ${D}/usr/AGL/apps/

   install -d ${D}/etc/dbus-1/session.d/
   install -m 0644 ${WORKDIR}/org.agl.naviapi.conf ${D}/etc/dbus-1/session.d/

   install -d ${D}/var/mapdata
}

FILES_${PN} += " /usr/AGL/apps/*.sh /var/mapdata "
les; + std::string line; + std::ifstream templateRulesFile(path); + + if (!templateRulesFile.is_open()) { + LogError("Cannot open rules template file: " << path); + ThrowMsg(SmackException::FileError, "Cannot open rules template file: " << path); + } + + while (std::getline(templateRulesFile, line)) { + templateRules.push_back(line); + } + + if (templateRulesFile.bad()) { + LogError("Error reading template file: " << APP_RULES_TEMPLATE_FILE_PATH); + ThrowMsg(SmackException::FileError, "Error reading template file: " << APP_RULES_TEMPLATE_FILE_PATH); + } + + addFromTemplate(templateRules, appId, pkgId); +} void SmackRules::addFromTemplateFile(const std::string &appId, const std::string &pkgId) @@ -223,7 +246,28 @@ std::string SmackRules::getApplicationRulesFilePath(const std::string &appId) std::string path(tzplatform_mkpath3(TZ_SYS_SMACK, "accesses.d", ("app_" + appId).c_str())); return path; } +void SmackRules::installApplicationPrivilegesRules(const std::string &appId, const std::string &pkgId, + const std::vector<std::string> &pkgContents, const std::vector<std::string> &privileges) +{ + SmackRules smackRules; + std::string appPath = getApplicationRulesFilePath(appId); + smackRules.loadFromFile(appPath); + struct stat buffer; + for (auto privilege : privileges) { + if (privilege.empty()) + continue; + std::string fprivilege ( privilege + "-template.smack"); + std::string path(tzplatform_mkpath4(TZ_SYS_SHARE, "security-manager", "policy", fprivilege.c_str())); + if( stat(path.c_str(), &buffer) == 0) + smackRules.addFromTemplateFile(appId, pkgId, path); + } + + if (smack_smackfs_path() != NULL) + smackRules.apply(); + smackRules.saveToFile(appPath); + updatePackageRules(pkgId, pkgContents); +} void SmackRules::installApplicationRules(const std::string &appId, const std::string &pkgId, const std::vector<std::string> &pkgContents) { -- 2.1.0