xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.8.0.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Hardware Platform Interface Library and Tools"
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunDESCRIPTION = "\
4*4882a593SmuzhiyunOpenHPI is an open source project created with the intent of providing an \
5*4882a593Smuzhiyunimplementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
6*4882a593Smuzhiyunprovides an abstracted interface to managing computer hardware, typically for \
7*4882a593Smuzhiyunchassis and rack based servers. HPI includes resource modeling; access to and \
8*4882a593Smuzhiyuncontrol over sensor, control, watchdog, and inventory data associated with \
9*4882a593Smuzhiyunresources; abstracted System Event Log interfaces; hardware events and alerts; \
10*4882a593Smuzhiyunand a managed hotswap interface. \
11*4882a593Smuzhiyun\
12*4882a593SmuzhiyunOpenHPI provides a modular mechanism for adding new hardware and device support \
13*4882a593Smuzhiyuneasily. Many plugins exist in the OpenHPI source tree to provide access to \
14*4882a593Smuzhiyunvarious types of hardware. This includes, but is not limited to, IPMI based \
15*4882a593Smuzhiyunservers, Blade Center, and machines which export data via sysfs. \
16*4882a593Smuzhiyun"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunHOMEPAGE = "http://openhpi.sourceforge.net/Home"
19*4882a593SmuzhiyunSECTION = "net"
20*4882a593SmuzhiyunLICENSE = "BSD-3-Clause"
21*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunDEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs \
24*4882a593Smuzhiyun           autoconf-archive-native os-release"
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunSRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
27*4882a593Smuzhiyun           file://openhpi.init \
28*4882a593Smuzhiyun           file://openhpid.service \
29*4882a593Smuzhiyun           file://run-ptest \
30*4882a593Smuzhiyun           file://openhpi-netsnmp-cross-compile.patch \
31*4882a593Smuzhiyun           file://openhpi-sysfs-cross-compile.patch \
32*4882a593Smuzhiyun           file://openhpi-libxml2-cross-compile.patch \
33*4882a593Smuzhiyun           file://openhpi-glib-cross-compile.patch \
34*4882a593Smuzhiyun           file://openhpi-linkfix.patch \
35*4882a593Smuzhiyun           file://openhpi-fix-host-gcc.patch \
36*4882a593Smuzhiyun           file://openhpi-fix-function-saHpiSensorThresholds.patch \
37*4882a593Smuzhiyun           file://openhpi-add-libnetsnmp-when-link.patch \
38*4882a593Smuzhiyun           file://openhpi-invalide-session.patch \
39*4882a593Smuzhiyun           file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
40*4882a593Smuzhiyun           file://openhpi-fix-alignment-issue.patch \
41*4882a593Smuzhiyun           file://c++11.patch \
42*4882a593Smuzhiyun           file://clang-c++11.patch \
43*4882a593Smuzhiyun           file://fix-narrowing-warning.patch \
44*4882a593Smuzhiyun           file://0001-session-close-socket.patch \
45*4882a593Smuzhiyun           file://openhpi-3.6.1-ssl.patch \
46*4882a593Smuzhiyun           file://0001-Do-not-poke-at-build-host-s-etc-os-release.patch \
47*4882a593Smuzhiyun           file://cross_899198.patch \
48*4882a593Smuzhiyun           file://no-md2.patch \
49*4882a593Smuzhiyun           file://0001-include-iostream-for-cout.patch \
50*4882a593Smuzhiyun           "
51*4882a593SmuzhiyunSRC_URI[md5sum] = "fffda3deea8a0d3671a72eea9d13a4df"
52*4882a593SmuzhiyunSRC_URI[sha256sum] = "c94332a29160dd75cb799c027e614690c00263b0fabed87417707bec04c38723"
53*4882a593Smuzhiyun
54*4882a593Smuzhiyuninherit autotools pkgconfig ptest update-rc.d systemd
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunPACKAGES =+ "${PN}-libs"
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunFILES:${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunINSANE_SKIP:${PN}-libs = "dev-so"
61*4882a593SmuzhiyunRDEPENDS:${PN} += "${PN}-libs"
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunPACKAGECONFIG ??= "libgcrypt non32bit snmp-bc"
64*4882a593SmuzhiyunPACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
65*4882a593SmuzhiyunPACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
66*4882a593SmuzhiyunPACKAGECONFIG[non32bit] = "--enable-non32bit-int,--disable-non32bit-int,,"
67*4882a593SmuzhiyunPACKAGECONFIG[snmp-bc] = "--enable-snmp_bc,--disable-snmp_bc"
68*4882a593Smuzhiyun
69*4882a593Smuzhiyunexport DISTRO
70*4882a593Smuzhiyun
71*4882a593Smuzhiyundo_install:append () {
72*4882a593Smuzhiyun    install -m 0755 -d ${D}${sysconfdir}/${BPN}
73*4882a593Smuzhiyun    install -m 0644 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
74*4882a593Smuzhiyun    install -m 0600 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
75*4882a593Smuzhiyun    install -m 0644 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
76*4882a593Smuzhiyun    install -m 0644 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
77*4882a593Smuzhiyun    install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun    install -d ${D}${systemd_unitdir}/system
80*4882a593Smuzhiyun    install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
81*4882a593Smuzhiyun    sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
82*4882a593Smuzhiyun        ${D}${systemd_unitdir}/system/openhpid.service
83*4882a593Smuzhiyun}
84*4882a593Smuzhiyun
85*4882a593Smuzhiyundo_compile_ptest () {
86*4882a593Smuzhiyun    for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
87*4882a593Smuzhiyun        dir=`dirname ${x}`
88*4882a593Smuzhiyun        case $dir in
89*4882a593Smuzhiyun            *cpp/t)      ;;
90*4882a593Smuzhiyun            *snmp_bc/t)  if ${@bb.utils.contains('PACKAGECONFIG','snmp-bc','true','false',d)}
91*4882a593Smuzhiyun                         then
92*4882a593Smuzhiyun                           oe_runmake -C ${dir} buildtest-TESTS
93*4882a593Smuzhiyun                         fi
94*4882a593Smuzhiyun                         ;;
95*4882a593Smuzhiyun            *)           oe_runmake -C ${dir} buildtest-TESTS ;;
96*4882a593Smuzhiyun        esac
97*4882a593Smuzhiyun    done
98*4882a593Smuzhiyun}
99*4882a593Smuzhiyun
100*4882a593Smuzhiyunack_do_compile_ptest () {
101*4882a593Smuzhiyun    for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
102*4882a593Smuzhiyun        dir=`dirname ${x}`
103*4882a593Smuzhiyun        upper=`dirname ${dir}`
104*4882a593Smuzhiyun        if [ `basename ${upper}` != "cpp" ]; then
105*4882a593Smuzhiyun            oe_runmake -C ${dir} buildtest-TESTS
106*4882a593Smuzhiyun        fi
107*4882a593Smuzhiyun    done
108*4882a593Smuzhiyun}
109*4882a593Smuzhiyun
110*4882a593Smuzhiyundo_install_ptest () {
111*4882a593Smuzhiyun    cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
112*4882a593Smuzhiyun    TESTS="utils marshal openhpid"
113*4882a593Smuzhiyun    for subtest in ${TESTS}; do
114*4882a593Smuzhiyun        mkdir -p ${D}${PTEST_PATH}/${subtest}/t
115*4882a593Smuzhiyun        cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
116*4882a593Smuzhiyun    done
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun    for x in `find ${D}${PTEST_PATH} -name Makefile`; do
119*4882a593Smuzhiyun        sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
120*4882a593Smuzhiyun        sed -i "s/^Makefile:/MM:/g" ${x};
121*4882a593Smuzhiyun    done;
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun    install -m 644 ${S}/openhpid/t/ohpi/openhpi.conf ${D}${PTEST_PATH}/openhpid/t/ohpi/
124*4882a593Smuzhiyun    sed -i "s:OPENHPI_CONF=[^ ]*:OPENHPI_CONF=./openhpi.conf:g" ${D}${PTEST_PATH}/openhpid/t/ohpi/Makefile
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun    mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
127*4882a593Smuzhiyun    cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
128*4882a593Smuzhiyun    cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
129*4882a593Smuzhiyun    find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
130*4882a593Smuzhiyun    find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
131*4882a593Smuzhiyun    find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
132*4882a593Smuzhiyun}
133*4882a593Smuzhiyun
134*4882a593SmuzhiyunINITSCRIPT_NAME = "openhpid"
135*4882a593SmuzhiyunINITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
136*4882a593Smuzhiyun
137*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "openhpid.service"
138*4882a593SmuzhiyunSYSTEMD_AUTO_ENABLE = "disable"
139