blob: 7a864966149b711abe17e0f272beef113671f181 [file] [log] [blame]
Tom Joseph40b4e3f2017-02-01 19:47:27 +05301# Common code for recipes that create IPMI provider libraries
2
Brad Bishop6f120e32018-03-09 16:51:57 -05003inherit obmc-phosphor-utils
4
Tom Joseph40b4e3f2017-02-01 19:47:27 +05305LIBDIR = "${D}/${libdir}/ipmid-providers/"
6HOSTIPMI_LIBDIR = "${D}/${libdir}/host-ipmid/"
7NETIPMI_LIBDIR = "${D}/${libdir}/net-ipmid/"
8
9python symlink_create_postinstall() {
10 def install_symlink(d, libname, install_dir):
11 import glob;
12
13 if not os.path.exists(install_dir):
14 os.makedirs(install_dir)
15
16 lib_dir = d.getVar('LIBDIR', True)
17
18 # find the library extension libxxx.so.?
19 install_file = lib_dir + libname + ".?"
20
21 filelist = glob.glob(install_file);
22
23 # get the library name
24 path, file = os.path.split(filelist[0])
Tom Joseph40b4e3f2017-02-01 19:47:27 +053025 source = "../ipmid-providers/" + file
26
27 # create the symlink
Brad Bishopf16226c2018-02-14 22:24:55 -050028 os.symlink(source, os.path.join(install_dir, file))
Tom Joseph40b4e3f2017-02-01 19:47:27 +053029
30 for libname in listvar_to_list(d, 'HOSTIPMI_PROVIDER_LIBRARY'):
31 install_dir = d.getVar('HOSTIPMI_LIBDIR', True)
32 install_symlink(d, libname, install_dir)
33
34 for libname in listvar_to_list(d, 'NETIPMI_PROVIDER_LIBRARY'):
35 install_dir = d.getVar('NETIPMI_LIBDIR', True)
36 install_symlink(d, libname, install_dir)
37}
Brad Bishop4412c4c2018-02-14 22:24:02 -050038do_install[postfuncs] += "symlink_create_postinstall"