summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-31 13:25:51 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-09-06 14:44:12 +0300
commitff075f6ee795a590b244d70a90cc312ba1f2d83d (patch)
treea617790bdbfdeef960665ba0242e1f0c93e5301a /meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb
parent3e4da38c127bb7e7641adc2fc41f4c33744cb918 (diff)
downloadopenbmc-ff075f6ee795a590b244d70a90cc312ba1f2d83d.tar.xz
meta-phosphor: Move layer content from common/
Adopt a more conventional directory hierarchy. meta-phosphor is still a _long_ way from suitable for hosting on yoctoproject.org but things like this don't help. (From meta-phosphor rev: 471cfcefa74b8c7ceb704cb670e6d915cf27c63b) Change-Id: I3f106b2f6cdc6cec734be28a6090800546f362eb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb')
-rw-r--r--meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb96
1 files changed, 96 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb
new file mode 100644
index 0000000000..ed7d4bb558
--- /dev/null
+++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb
@@ -0,0 +1,96 @@
+SUMMARY = "Phosphor DBUS Object Manager"
+DESCRIPTION = "Phosphor DBUS object manager."
+HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
+
+inherit autotools pkgconfig
+inherit obmc-phosphor-python-autotools
+inherit obmc-phosphor-dbus-service
+inherit obmc-phosphor-systemd
+inherit phosphor-mapperdir
+
+DEPENDS += "systemd"
+DEPENDS += "autoconf-archive-native"
+DEPENDS += "sdbusplus"
+DEPENDS += "phosphor-logging"
+DEPENDS += "${PN}-config-native"
+
+DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service"
+SYSTEMD_SERVICE_${PN} += " \
+ mapper-wait@.service \
+ mapper-subtree-remove@.service \
+ "
+RDEPENDS_libmapper += "libsystemd"
+RDEPENDS_${PN} += " \
+ python-argparse \
+ python-xml \
+ python-dbus \
+ python-pygobject \
+ pyphosphor-dbus \
+ pyphosphor-utils \
+ sdbusplus \
+ phosphor-logging \
+ "
+SRC_URI += "git://github.com/openbmc/phosphor-objmgr"
+
+SRCREV = "d6729ea39d443bf62a27bbf64ef6bc7a123125c8"
+
+S = "${WORKDIR}/git"
+
+python populate_packages_prepend () {
+ mapperlibdir = d.getVar("libdir", True)
+ do_split_packages(d, mapperlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Phosphor mapper %s library', extra_depends='', allow_links=True)
+}
+PACKAGES_DYNAMIC += "^libmapper.*"
+FILES_${PN}_remove = "${libdir}/lib*.so.* ${libdir}/*"
+
+# Construct a systemd environment file with mapper commandline
+# from the native sysroot /usr/share/phosphor-mapper filesystem.
+python do_emit_env() {
+ path = d.getVar('STAGING_DIR_NATIVE', True) + \
+ d.getVar('namespace_dir', True)
+ paths = []
+ for p in os.listdir(path):
+ paths.append(os.sep.join(p.split('-')))
+
+ path = d.getVar('STAGING_DIR_NATIVE', True) + \
+ d.getVar('interface_dir', True)
+ interfaces = []
+ for i in os.listdir(path):
+ interfaces.append('.'.join(i.split('-')))
+
+ path = d.getVar('STAGING_DIR_NATIVE', True) + \
+ d.getVar('blacklist_dir', True)
+ blacklists = []
+ for b in os.listdir(path):
+ blacklists.append(os.sep + os.sep.join(b.split('-')))
+
+ path = d.getVar('STAGING_DIR_NATIVE', True) + \
+ d.getVar('interfaceblacklist_dir', True)
+ interface_blacklists = []
+ for ib in os.listdir(path):
+ interface_blacklists.append('.'.join(ib.split('-')))
+
+ path = [d.getVar('D', True) + d.getVar('envfiledir', True)]
+ path.append('obmc')
+ path.append('mapper')
+ parent = os.path.join(*path[:-1])
+ path = os.path.join(*path)
+
+ if not os.path.exists(parent):
+ os.makedirs(parent)
+ with open(path, 'w+') as fd:
+ fd.write('MAPPER_NAMESPACES="{}"'.format(' '.join(paths)))
+ fd.write('\n')
+ fd.write('MAPPER_INTERFACES="{}"'.format(' '.join(interfaces)))
+ fd.write('\n')
+ fd.write('MAPPER_BLACKLISTS="{}"'.format(' '.join(blacklists)))
+ fd.write('\n')
+ fd.write('MAPPER_INTERFACEBLACKLISTS="{}"'.format(' '.join(interface_blacklists)))
+ fd.write('\n')
+}
+
+do_install[postfuncs] += "do_emit_env"
+do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACES"