blob: 41b09944fb404b61f5e9069b04c38993e52af5b0 [file] [log] [blame]
Brad Bishopce086742015-10-27 17:12:45 -04001SUMMARY = "Phosphor DBUS Object Manager"
2DESCRIPTION = "Phosphor DBUS object manager."
3HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr"
4PR = "r1"
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
7
Matthew Barthe9972912016-10-05 16:20:54 -05008inherit autotools pkgconfig
Matthew Barth67cb5a52016-11-16 10:17:02 -06009inherit obmc-phosphor-python-autotools
Brad Bishopce086742015-10-27 17:12:45 -040010inherit obmc-phosphor-dbus-service
11inherit obmc-phosphor-systemd
Brad Bishopf8a7cd12017-07-09 23:41:49 -040012inherit phosphor-mapperdir
Brad Bishopce086742015-10-27 17:12:45 -040013
Brad Bishop48b19612016-08-07 23:18:32 -040014DEPENDS += "systemd"
Matthew Barthe9972912016-10-05 16:20:54 -050015DEPENDS += "autoconf-archive-native"
Matt Spinler1b556ae2017-06-08 12:35:36 -050016DEPENDS += "sdbusplus"
17DEPENDS += "phosphor-logging"
Brad Bishopf8a7cd12017-07-09 23:41:49 -040018DEPENDS += "${PN}-config-native"
Rick Altherrc38aae02016-08-01 14:20:50 -070019
Brad Bishop7476cd12016-11-02 15:21:22 -040020DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service"
Adriana Kobylak545f8742017-04-11 11:06:59 -050021SYSTEMD_SERVICE_${PN} += " \
22 mapper-wait@.service \
23 mapper-subtree-remove@.service \
24 "
Matthew Barthe9972912016-10-05 16:20:54 -050025RDEPENDS_libmapper += "libsystemd"
Brad Bishopce086742015-10-27 17:12:45 -040026RDEPENDS_${PN} += " \
Brad Bishopf8a7cd12017-07-09 23:41:49 -040027 python-argparse \
Brad Bishopce086742015-10-27 17:12:45 -040028 python-xml \
29 python-dbus \
30 python-pygobject \
Patrick Williamsfee25822017-03-03 12:52:30 -060031 pyphosphor-dbus \
Patrick Venturebe3afaa2017-07-31 10:52:27 -070032 pyphosphor-utils \
Matt Spinler1b556ae2017-06-08 12:35:36 -050033 sdbusplus \
34 phosphor-logging \
Brad Bishopce086742015-10-27 17:12:45 -040035 "
Chris Austen350def12015-12-02 22:32:06 -060036SRC_URI += "git://github.com/openbmc/phosphor-objmgr"
Brad Bishopce086742015-10-27 17:12:45 -040037
Andrew Geisslerc0631c12017-11-16 21:35:06 +000038SRCREV = "b270adc1835b7ccdc21ecaa5996e0574c088154d"
Brad Bishopce086742015-10-27 17:12:45 -040039
40S = "${WORKDIR}/git"
Brad Bishop9a701b42016-07-26 15:52:01 -040041
Brad Bishop9a701b42016-07-26 15:52:01 -040042python populate_packages_prepend () {
43 mapperlibdir = d.getVar("libdir", True)
44 do_split_packages(d, mapperlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Phosphor mapper %s library', extra_depends='', allow_links=True)
45}
46PACKAGES_DYNAMIC += "^libmapper.*"
47FILES_${PN}_remove = "${libdir}/lib*.so.* ${libdir}/*"
Brad Bishopf8a7cd12017-07-09 23:41:49 -040048
49# Construct a systemd environment file with mapper commandline
50# from the native sysroot /usr/share/phosphor-mapper filesystem.
51python do_emit_env() {
52 path = d.getVar('STAGING_DIR_NATIVE', True) + \
53 d.getVar('namespace_dir', True)
54 paths = []
55 for p in os.listdir(path):
Brad Bishopb4eea302017-08-03 15:56:09 -040056 paths.append(os.sep.join(p.split('-')))
Brad Bishopf8a7cd12017-07-09 23:41:49 -040057
58 path = d.getVar('STAGING_DIR_NATIVE', True) + \
59 d.getVar('interface_dir', True)
60 interfaces = []
61 for i in os.listdir(path):
62 interfaces.append('.'.join(i.split('-')))
63
64 path = d.getVar('STAGING_DIR_NATIVE', True) + \
65 d.getVar('blacklist_dir', True)
66 blacklists = []
67 for b in os.listdir(path):
68 blacklists.append(os.sep + os.sep.join(b.split('-')))
69
70 path = d.getVar('STAGING_DIR_NATIVE', True) + \
71 d.getVar('interfaceblacklist_dir', True)
72 interface_blacklists = []
73 for ib in os.listdir(path):
74 interface_blacklists.append('.'.join(ib.split('-')))
75
76 path = [d.getVar('D', True) + d.getVar('envfiledir', True)]
77 path.append('obmc')
78 path.append('mapper')
79 parent = os.path.join(*path[:-1])
80 path = os.path.join(*path)
81
82 if not os.path.exists(parent):
83 os.makedirs(parent)
84 with open(path, 'w+') as fd:
85 fd.write('MAPPER_NAMESPACES="{}"'.format(' '.join(paths)))
86 fd.write('\n')
87 fd.write('MAPPER_INTERFACES="{}"'.format(' '.join(interfaces)))
88 fd.write('\n')
89 fd.write('MAPPER_BLACKLISTS="{}"'.format(' '.join(blacklists)))
90 fd.write('\n')
91 fd.write('MAPPER_INTERFACEBLACKLISTS="{}"'.format(' '.join(interface_blacklists)))
92 fd.write('\n')
93}
94
95do_install[postfuncs] += "do_emit_env"
96do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACES"