blob: 6797af632d240c031a8ccfb0a1617232aa853a8c [file] [log] [blame]
Brad Bishop83254dc2015-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 Barth11381c42016-10-05 16:20:54 -05008inherit autotools pkgconfig
Matthew Barth730ecb82016-11-16 10:17:02 -06009inherit obmc-phosphor-python-autotools
Brad Bishop83254dc2015-10-27 17:12:45 -040010inherit obmc-phosphor-dbus-service
11inherit obmc-phosphor-systemd
Brad Bishop2ad7ce32017-07-09 23:41:49 -040012inherit phosphor-mapperdir
Brad Bishop83254dc2015-10-27 17:12:45 -040013
Brad Bishop5f077512016-08-07 23:18:32 -040014DEPENDS += "systemd"
Matthew Barth11381c42016-10-05 16:20:54 -050015DEPENDS += "autoconf-archive-native"
Matt Spinlera469b142017-06-08 12:35:36 -050016DEPENDS += "sdbusplus"
17DEPENDS += "phosphor-logging"
Brad Bishop2ad7ce32017-07-09 23:41:49 -040018DEPENDS += "${PN}-config-native"
Rick Altherr68aa1402016-08-01 14:20:50 -070019
Brad Bishop59fc7e32016-11-02 15:21:22 -040020DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service"
Adriana Kobylakfcaf72e2017-04-11 11:06:59 -050021SYSTEMD_SERVICE_${PN} += " \
22 mapper-wait@.service \
23 mapper-subtree-remove@.service \
24 "
Matthew Barth11381c42016-10-05 16:20:54 -050025RDEPENDS_libmapper += "libsystemd"
Brad Bishop83254dc2015-10-27 17:12:45 -040026RDEPENDS_${PN} += " \
Brad Bishop2ad7ce32017-07-09 23:41:49 -040027 python-argparse \
Brad Bishop83254dc2015-10-27 17:12:45 -040028 python-xml \
29 python-dbus \
30 python-pygobject \
Patrick Williams73f46432017-03-03 12:52:30 -060031 pyphosphor-dbus \
Matt Spinlera469b142017-06-08 12:35:36 -050032 sdbusplus \
33 phosphor-logging \
Brad Bishop83254dc2015-10-27 17:12:45 -040034 "
Chris Austenb70cb7e2015-12-02 22:32:06 -060035SRC_URI += "git://github.com/openbmc/phosphor-objmgr"
Brad Bishop83254dc2015-10-27 17:12:45 -040036
Patrick Williamsdd5e9562017-08-02 05:50:08 -050037SRCREV = "aeac98bdca848875bc8420999cfd928f08f98013"
Brad Bishop83254dc2015-10-27 17:12:45 -040038
39S = "${WORKDIR}/git"
Brad Bishopea4022a2016-07-26 15:52:01 -040040
Brad Bishopea4022a2016-07-26 15:52:01 -040041python populate_packages_prepend () {
42 mapperlibdir = d.getVar("libdir", True)
43 do_split_packages(d, mapperlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Phosphor mapper %s library', extra_depends='', allow_links=True)
44}
45PACKAGES_DYNAMIC += "^libmapper.*"
46FILES_${PN}_remove = "${libdir}/lib*.so.* ${libdir}/*"
Brad Bishop2ad7ce32017-07-09 23:41:49 -040047
48# Construct a systemd environment file with mapper commandline
49# from the native sysroot /usr/share/phosphor-mapper filesystem.
50python do_emit_env() {
51 path = d.getVar('STAGING_DIR_NATIVE', True) + \
52 d.getVar('namespace_dir', True)
53 paths = []
54 for p in os.listdir(path):
Brad Bishop9b3beee2017-08-03 15:56:09 -040055 paths.append(os.sep.join(p.split('-')))
Brad Bishop2ad7ce32017-07-09 23:41:49 -040056
57 path = d.getVar('STAGING_DIR_NATIVE', True) + \
58 d.getVar('interface_dir', True)
59 interfaces = []
60 for i in os.listdir(path):
61 interfaces.append('.'.join(i.split('-')))
62
63 path = d.getVar('STAGING_DIR_NATIVE', True) + \
64 d.getVar('blacklist_dir', True)
65 blacklists = []
66 for b in os.listdir(path):
67 blacklists.append(os.sep + os.sep.join(b.split('-')))
68
69 path = d.getVar('STAGING_DIR_NATIVE', True) + \
70 d.getVar('interfaceblacklist_dir', True)
71 interface_blacklists = []
72 for ib in os.listdir(path):
73 interface_blacklists.append('.'.join(ib.split('-')))
74
75 path = [d.getVar('D', True) + d.getVar('envfiledir', True)]
76 path.append('obmc')
77 path.append('mapper')
78 parent = os.path.join(*path[:-1])
79 path = os.path.join(*path)
80
81 if not os.path.exists(parent):
82 os.makedirs(parent)
83 with open(path, 'w+') as fd:
84 fd.write('MAPPER_NAMESPACES="{}"'.format(' '.join(paths)))
85 fd.write('\n')
86 fd.write('MAPPER_INTERFACES="{}"'.format(' '.join(interfaces)))
87 fd.write('\n')
88 fd.write('MAPPER_BLACKLISTS="{}"'.format(' '.join(blacklists)))
89 fd.write('\n')
90 fd.write('MAPPER_INTERFACEBLACKLISTS="{}"'.format(' '.join(interface_blacklists)))
91 fd.write('\n')
92}
93
94do_install[postfuncs] += "do_emit_env"
95do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACES"