blob: 02f7ce0c832ebfe939e1db69f5c51353d6351c0d [file] [log] [blame]
Tom Josephdcdc8ea2017-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])
Tom Josephdcdc8ea2017-02-01 19:47:27 +053023 source = "../ipmid-providers/" + file
24
25 # create the symlink
Brad Bishop66f1f9f2018-02-14 22:24:55 -050026 os.symlink(source, os.path.join(install_dir, file))
Tom Josephdcdc8ea2017-02-01 19:47:27 +053027
28 for libname in listvar_to_list(d, 'HOSTIPMI_PROVIDER_LIBRARY'):
29 install_dir = d.getVar('HOSTIPMI_LIBDIR', True)
30 install_symlink(d, libname, install_dir)
31
32 for libname in listvar_to_list(d, 'NETIPMI_PROVIDER_LIBRARY'):
33 install_dir = d.getVar('NETIPMI_LIBDIR', True)
34 install_symlink(d, libname, install_dir)
35}
Brad Bishop8e5d45b2018-02-14 22:24:02 -050036do_install[postfuncs] += "symlink_create_postinstall"