blob: 7b793ec9b28892b3079c6af227c9c4eb7e3ad4bc [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"
Patrick Venture90b2a3f2018-10-05 15:08:31 -07005PV = "1.0+git${SRCPV}"
Brad Bishopce086742015-10-27 17:12:45 -04006LICENSE = "Apache-2.0"
7LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
8
Matthew Barthe9972912016-10-05 16:20:54 -05009inherit autotools pkgconfig
Matthew Barth67cb5a52016-11-16 10:17:02 -060010inherit obmc-phosphor-python-autotools
Brad Bishopce086742015-10-27 17:12:45 -040011inherit obmc-phosphor-dbus-service
12inherit obmc-phosphor-systemd
Brad Bishopf8a7cd12017-07-09 23:41:49 -040013inherit phosphor-mapperdir
Brad Bishopce086742015-10-27 17:12:45 -040014
Brad Bishop48b19612016-08-07 23:18:32 -040015DEPENDS += "systemd"
Matthew Barthe9972912016-10-05 16:20:54 -050016DEPENDS += "autoconf-archive-native"
Andrew Geissler9ece75f2018-10-02 20:40:17 +000017DEPENDS += "boost"
18DEPENDS += "libtinyxml2"
Matt Spinler1b556ae2017-06-08 12:35:36 -050019DEPENDS += "sdbusplus"
20DEPENDS += "phosphor-logging"
Brad Bishopf8a7cd12017-07-09 23:41:49 -040021DEPENDS += "${PN}-config-native"
Rick Altherrc38aae02016-08-01 14:20:50 -070022
Brad Bishop7476cd12016-11-02 15:21:22 -040023DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service"
Adriana Kobylak545f8742017-04-11 11:06:59 -050024SYSTEMD_SERVICE_${PN} += " \
25 mapper-wait@.service \
26 mapper-subtree-remove@.service \
27 "
Matthew Barthe9972912016-10-05 16:20:54 -050028RDEPENDS_libmapper += "libsystemd"
Brad Bishopce086742015-10-27 17:12:45 -040029RDEPENDS_${PN} += " \
Brad Bishopf8a7cd12017-07-09 23:41:49 -040030 python-argparse \
Brad Bishopce086742015-10-27 17:12:45 -040031 python-xml \
32 python-dbus \
33 python-pygobject \
Patrick Williamsfee25822017-03-03 12:52:30 -060034 pyphosphor-dbus \
Patrick Venturebe3afaa2017-07-31 10:52:27 -070035 pyphosphor-utils \
Matt Spinler1b556ae2017-06-08 12:35:36 -050036 sdbusplus \
37 phosphor-logging \
Brad Bishopce086742015-10-27 17:12:45 -040038 "
Chris Austen350def12015-12-02 22:32:06 -060039SRC_URI += "git://github.com/openbmc/phosphor-objmgr"
Brad Bishopce086742015-10-27 17:12:45 -040040
Andrew Geisslerfa4e1eb2018-10-26 14:50:18 +000041SRCREV = "0570c6940cd193e7106b584984de8fd5f1643bfa"
Brad Bishopce086742015-10-27 17:12:45 -040042
43S = "${WORKDIR}/git"
Brad Bishop9a701b42016-07-26 15:52:01 -040044
Brad Bishop9a701b42016-07-26 15:52:01 -040045python populate_packages_prepend () {
46 mapperlibdir = d.getVar("libdir", True)
47 do_split_packages(d, mapperlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Phosphor mapper %s library', extra_depends='', allow_links=True)
48}
49PACKAGES_DYNAMIC += "^libmapper.*"
50FILES_${PN}_remove = "${libdir}/lib*.so.* ${libdir}/*"
Brad Bishopf8a7cd12017-07-09 23:41:49 -040051
52# Construct a systemd environment file with mapper commandline
53# from the native sysroot /usr/share/phosphor-mapper filesystem.
54python do_emit_env() {
55 path = d.getVar('STAGING_DIR_NATIVE', True) + \
56 d.getVar('namespace_dir', True)
57 paths = []
58 for p in os.listdir(path):
Brad Bishopb4eea302017-08-03 15:56:09 -040059 paths.append(os.sep.join(p.split('-')))
Brad Bishopf8a7cd12017-07-09 23:41:49 -040060
61 path = d.getVar('STAGING_DIR_NATIVE', True) + \
Brad Bishop385c63f2018-10-22 20:48:49 -040062 d.getVar('service_dir', True)
63 services = []
64 for s in os.listdir(path):
65 services.append('.'.join(s.split('-')))
66
67 path = d.getVar('STAGING_DIR_NATIVE', True) + \
Brad Bishopf8a7cd12017-07-09 23:41:49 -040068 d.getVar('interface_dir', True)
69 interfaces = []
70 for i in os.listdir(path):
71 interfaces.append('.'.join(i.split('-')))
72
Brad Bishop385c63f2018-10-22 20:48:49 -040073 path = d.getVar('STAGING_DIR_NATIVE', True) + \
74 d.getVar('serviceblacklist_dir', True)
75 service_blacklists = []
76 for x in os.listdir(path):
77 service_blacklists.append('.'.join(x.split('-')))
78
Brad Bishopf8a7cd12017-07-09 23:41:49 -040079 path = [d.getVar('D', True) + d.getVar('envfiledir', True)]
80 path.append('obmc')
81 path.append('mapper')
82 parent = os.path.join(*path[:-1])
83 path = os.path.join(*path)
84
85 if not os.path.exists(parent):
86 os.makedirs(parent)
87 with open(path, 'w+') as fd:
88 fd.write('MAPPER_NAMESPACES="{}"'.format(' '.join(paths)))
89 fd.write('\n')
Brad Bishop385c63f2018-10-22 20:48:49 -040090 fd.write('MAPPER_SERVICES="{}"'.format(' '.join(services)))
91 fd.write('\n')
Brad Bishopf8a7cd12017-07-09 23:41:49 -040092 fd.write('MAPPER_INTERFACES="{}"'.format(' '.join(interfaces)))
93 fd.write('\n')
Brad Bishop385c63f2018-10-22 20:48:49 -040094 fd.write('MAPPER_SERVICEBLACKLISTS="{}"'.format(' '.join(service_blacklists)))
95 fd.write('\n')
Brad Bishopf8a7cd12017-07-09 23:41:49 -040096}
97
98do_install[postfuncs] += "do_emit_env"
99do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACES"