blob: a025b4299862b9adcbe1356e23d311dddade9fb9 [file] [log] [blame]
Tom Josephdcdc8ea2017-02-01 19:47:27 +05301# Common code for recipes that create IPMI provider libraries
2
Brad Bishop02f9a522018-03-09 16:51:57 -05003inherit obmc-phosphor-utils
4
Patrick Venture4cdfde12018-10-03 11:27:00 -07005# This LIBDIR is searched for the libraries.
Tom Josephdcdc8ea2017-02-01 19:47:27 +05306LIBDIR = "${D}/${libdir}/ipmid-providers/"
Patrick Venture4cdfde12018-10-03 11:27:00 -07007
8# The symlinks are installed in the following directories depending on the
9# variable.
Tom Josephdcdc8ea2017-02-01 19:47:27 +053010HOSTIPMI_LIBDIR = "${D}/${libdir}/host-ipmid/"
11NETIPMI_LIBDIR = "${D}/${libdir}/net-ipmid/"
Patrick Venture4cdfde12018-10-03 11:27:00 -070012BLOBIPMI_LIBDIR = "${D}/${libdir}/blob-ipmid/"
Tom Josephdcdc8ea2017-02-01 19:47:27 +053013
14python symlink_create_postinstall() {
15 def install_symlink(d, libname, install_dir):
16 import glob;
17
18 if not os.path.exists(install_dir):
19 os.makedirs(install_dir)
20
21 lib_dir = d.getVar('LIBDIR', True)
22
23 # find the library extension libxxx.so.?
24 install_file = lib_dir + libname + ".?"
25
26 filelist = glob.glob(install_file);
27
28 # get the library name
29 path, file = os.path.split(filelist[0])
Tom Josephdcdc8ea2017-02-01 19:47:27 +053030 source = "../ipmid-providers/" + file
31
32 # create the symlink
Brad Bishop66f1f9f2018-02-14 22:24:55 -050033 os.symlink(source, os.path.join(install_dir, file))
Tom Josephdcdc8ea2017-02-01 19:47:27 +053034
35 for libname in listvar_to_list(d, 'HOSTIPMI_PROVIDER_LIBRARY'):
36 install_dir = d.getVar('HOSTIPMI_LIBDIR', True)
37 install_symlink(d, libname, install_dir)
38
39 for libname in listvar_to_list(d, 'NETIPMI_PROVIDER_LIBRARY'):
40 install_dir = d.getVar('NETIPMI_LIBDIR', True)
41 install_symlink(d, libname, install_dir)
Patrick Venture4cdfde12018-10-03 11:27:00 -070042
43 for libname in listvar_to_list(d, 'BLOBIPMI_PROVIDER_LIBRARY'):
44 install_dir = d.getVar('BLOBIPMI_LIBDIR', True)
45 install_symlink(d, libname, install_dir)
Tom Josephdcdc8ea2017-02-01 19:47:27 +053046}
Brad Bishop8e5d45b2018-02-14 22:24:02 -050047do_install[postfuncs] += "symlink_create_postinstall"