blob: b9b0437b275db5690376ed94b6b0711b5e46624c [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "Hardware Platform Interface Library and Tools"
2
3DESCRIPTION = "\
4OpenHPI is an open source project created with the intent of providing an \
5implementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
6provides an abstracted interface to managing computer hardware, typically for \
7chassis and rack based servers. HPI includes resource modeling; access to and \
8control over sensor, control, watchdog, and inventory data associated with \
9resources; abstracted System Event Log interfaces; hardware events and alerts; \
10and a managed hotswap interface. \
11\
12OpenHPI provides a modular mechanism for adding new hardware and device support \
13easily. Many plugins exist in the OpenHPI source tree to provide access to \
14various types of hardware. This includes, but is not limited to, IPMI based \
15servers, Blade Center, and machines which export data via sysfs. \
16"
17
18HOMEPAGE = "http://openhpi.sourceforge.net/Home"
19SECTION = "net"
20LICENSE = "BSD"
21LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
22
23DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs"
24
25SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
26 file://openhpi-netsnmp-cross-compile.patch \
27 file://openhpi-sysfs-cross-compile.patch \
28 file://openhpi-libxml2-cross-compile.patch \
29 file://openhpi-glib-cross-compile.patch \
30 file://openhpi-linkfix.patch \
31 file://openhpi-fix-host-gcc.patch \
32 file://openhpi-hpi-shell-thread-fix.patch \
33 file://openhpi-fix-testfail-errors.patch \
34 file://openhpi-add-libnetsnmp-when-link.patch \
35 file://openhpi-invalide-session.patch \
36 file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
37 file://openhpi-fix-alignment-issue.patch \
38 \
39 file://openhpi.init \
40 file://openhpid.service \
41 file://run-ptest \
42"
43
44SRC_URI[md5sum] = "4718b16e0f749b5ad214a9b04f45dd23"
45SRC_URI[sha256sum] = "e0a810cb401c4bdcfc9551f2e6afd5a8ca4b411f5ee3bc60c19f82fd6e84a3dc"
46
47inherit autotools pkgconfig ptest update-rc.d systemd
48
49PACKAGES =+ "${PN}-libs"
50
51FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
52
53INSANE_SKIP_${PN}-libs = "dev-so"
54RDEPENDS_${PN} += "${PN}-libs"
55
56PACKAGECONFIG ??= "libgcrypt"
57PACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
58PACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
59
60do_install_append () {
61 install -m 0755 -d ${D}${sysconfdir}/${BPN}
62 install -m 0755 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
63 install -m 0700 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
64 install -m 0755 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
65 install -m 0755 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
66 install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
67
68 install -d ${D}${systemd_unitdir}/system
69 install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
70 sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
71 ${D}${systemd_unitdir}/system/openhpid.service
72}
73
74do_compile_ptest () {
75 for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
76 dir=`dirname ${x}`
77 upper=`dirname ${dir}`
78 if [ `basename ${upper}` != "cpp" ]; then
79 oe_runmake -C ${dir} buildtest-TESTS
80 fi
81 done
82}
83
84do_install_ptest () {
85 cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
86 TESTS="utils marshal openhpid"
87 for subtest in ${TESTS}; do
88 mkdir -p ${D}${PTEST_PATH}/${subtest}/t
89 cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
90 done
91
92 for x in `find ${D}${PTEST_PATH} -name Makefile`; do
93 sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
94 sed -i "s/^Makefile:/MM:/g" ${x};
95 done;
96
97 mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
98 cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
99 cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
100 find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
101 find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
102 find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
103}
104
105INITSCRIPT_NAME = "openhpid"
106INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
107
108SYSTEMD_SERVICE_${PN} = "openhpid.service"
109SYSTEMD_AUTO_ENABLE = "disable"