blob: 18f4deca169215467aac8932212120647661a82e [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "IPMI (Intelligent Platform Management Interface) library and tools"
2DESCRIPTION = "OpenIPMI is an effort to create a full-function IPMI system, \
3to allow full access to all IPMI information on a server \
4and to abstract it to a level that will make it easy to use"
5
6HOMEPAGE = "http://openipmi.sourceforge.net"
7
8DEPENDS = " \
9 glib-2.0 \
10 ncurses \
11 net-snmp \
12 openssl \
13 popt \
14 python3 \
15 swig-native \
16 readline \
17 "
18
Andrew Geissler9aee5002022-03-30 16:27:02 +000019LICENSE = "GPL-2.0-only & LGPL-2.1-only & BSD-3-Clause"
Andrew Geissler595f6302022-01-24 19:11:47 +000020
21LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
22 file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
23 file://COPYING.BSD;md5=4b318d4160eb69c8ee53452feb1b4cdf \
24 "
25
26SRC_URI = "${SOURCEFORGE_MIRROR}/openipmi/OpenIPMI-${PV}.tar.gz \
27 file://fix-symlink-install-error-in-cmdlang.patch \
28 file://openipmi-no-openipmigui-man.patch \
29 file://openipmi-remove-host-path-from-la_LDFLAGS.patch \
30 file://ipmi-init-fix-the-arguments.patch \
31 file://include_sys_types.patch \
32 file://openipmi-helper \
33 file://ipmi.service \
34 file://0001-m4-ax_python_devel.m4-do-not-check-for-distutils.patch \
35 "
36
37S = "${WORKDIR}/OpenIPMI-${PV}"
38
39SRC_URI[md5sum] = "532404c9df7d0e8bde975b95b9e6775b"
40SRC_URI[sha256sum] = "f6d0fd4c0a74b05f80907229d0b270f54ca23294bcc11979f8b8d12766786945"
41
42inherit autotools-brokensep pkgconfig python3native perlnative update-rc.d systemd cpan-base python3targetconfig
43
Patrick Williams92b42cb2022-09-03 06:53:57 -050044CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
45
Andrew Geissler595f6302022-01-24 19:11:47 +000046EXTRA_OECONF = "--disable-static \
47 --with-perl='${STAGING_BINDIR_NATIVE}/perl-native/perl' \
48 --with-python='${STAGING_BINDIR_NATIVE}/python3-native/python3' \
49 --with-pythoninstall='${PYTHON_SITEPACKAGES_DIR}' \
50 --with-glibver=2.0"
51
52PACKAGECONFIG ??= "gdbm"
53PACKAGECONFIG[gdbm] = "ac_cv_header_gdbm_h=yes,ac_cv_header_gdbm_h=no,gdbm,"
54
55PACKAGES += "${PN}-perl ${PN}-python"
56PRIVATE_LIBS:${PN}-perl = "libOpenIPMI.so.0"
57
58FILES:${PN}-perl = " \
59 ${libdir}/perl/vendor_perl/*/OpenIPMI.pm \
60 ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/OpenIPMI.so \
61 "
62
63FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
64
65FILES:${PN}-dbg += " \
66 ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/.debug \
67 ${PYTHON_SITEPACKAGES_DIR}/.debug \
68 "
69
70do_configure () {
71
72 # Let's perform regular configuration first then handle perl issues.
73 autotools_do_configure
74
75 perl_ver=`perl -V:version | cut -d\' -f 2`
76
77 # Force openipmi perl bindings to be compiled using perl-native instead of
78 # the host's perl. Set the proper install directory for the resulting
79 # openipmi.pm and openipmi.so
80 for i in ${S}/swig/Makefile ${S}/swig/perl/Makefile; do
81 echo "SAL: i = $i"
82 echo "SAL: STAGING_INCDIR_NATIVE = $STAGING_INCDIR_NATIVE"
83 echo "SAL: libdir = $libdir"
84 sed -i -e "/^PERL_CFLAGS/s:-I/usr/local/include:-I${STAGING_INCDIR_NATIVE}:g" $i
85 sed -i -e "/^PERL_CFLAGS/s:-I .* :-I ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/${@get_perl_version(d)}/${@get_perl_arch(d)}/CORE :g" $i
86 sed -i -e "/^PERL_INSTALL_DIR/s:^PERL_INSTALL_DIR = .*:PERL_INSTALL_DIR = ${libdir}/perl/vendor_perl/$perl_ver:g" $i
87 done
88}
89
Patrick Williams92b42cb2022-09-03 06:53:57 -050090do_compile:append () {
91 sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' ${S}/swig/perl/OpenIPMI_wrap.c
92}
93
Andrew Geissler595f6302022-01-24 19:11:47 +000094do_install:append () {
95 echo "SAL: D = $D"
96 echo "SAL: libdir = $libdir"
97 install -m 0755 -d ${D}${sysconfdir}/sysconfig ${D}${sysconfdir}/init.d
98 install -m 0755 ${S}/ipmi.init ${D}${sysconfdir}/init.d/ipmi
99 install -m 0644 ${S}/ipmi.sysconf ${D}${sysconfdir}/sysconfig/ipmi
100 # SAL: mv: cannot stat `/localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/openipmi-2.0.19-r4/image/usr/lib64/perl5': No such file or directory
101 # SAL: real path to perl is /localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/perl-5.14.2-r8.3/package/usr/lib64/perl5 and it is a symlink to perl so no need to mv.
102 if [ -d ${D}${libdir}/perl5 ]
103 then
104 mv ${D}${libdir}/perl5 ${D}${libdir}/perl
105 fi
106
107 # for systemd
108 install -d ${D}${systemd_unitdir}/system
109 install -m 0664 ${WORKDIR}/ipmi.service ${D}${systemd_unitdir}/system
110 sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/ipmi.service
111 install -d ${D}${libexecdir}
112 install -m 0755 ${WORKDIR}/openipmi-helper ${D}${libexecdir}
113}
114
115INITSCRIPT_NAME = "ipmi"
116INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
117
118SYSTEMD_SERVICE:${PN} = "ipmi.service"
119SYSTEMD_AUTO_ENABLE = "disable"