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