blob: c24fccf04b91a66dbc22d1732341514bb3f00bf9 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification"
2DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \
3middleware consistent with Service Availability Forum (SA Forum) \
4specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \
5established by leading Communications and Enterprise Computing Companies to \
6facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \
7code base in commercial products. \
8The OpenSAF project was launched in mid 2007 and has been under development by \
9an informal group of supporters of the OpenSAF initiative. The OpenSAF \
10Foundation was founded on January 22nd 2008 with Emerson Network Power, \
11Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members."
12HOMEPAGE = "http://www.opensaf.org"
13SECTION = "admin"
14LICENSE = "LGPLv2.1"
15LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
16
17DEPENDS = "libxml2 python3"
18TOOLCHAIN = "gcc"
19
20SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
21
22SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
23 file://0001-configure-Pass-linker-specific-options-with-Wl.patch \
24 file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
25 file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \
26 file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \
27 file://0001-create_empty_library-Use-CC-variable-intead-of-hardc.patch \
28 file://0001-immom_python-convert-to-python3.patch \
29 file://0001-Fix-build-with-fno-common.patch \
30 file://0001-Use-correct-printf-format-for-__fsblkcnt_t.patch \
31 "
32SRC_URI[sha256sum] = "227ae1dafb6d51ce6561c9fcaec60087a0183839a8a4da11517e09f2a662b53d"
33
34UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/opensaf/files/releases"
35
36inherit autotools useradd systemd pkgconfig
37
38USERADD_PACKAGES = "${PN}"
39GROUPADD_PARAM:${PN} = "-f -r opensaf"
40USERADD_PARAM:${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
41
42SYSTEMD_SERVICE:${PN} += "opensafd.service"
43SYSTEMD_AUTO_ENABLE = "disable"
44
45PACKAGECONFIG[systemd] = ",,systemd"
46PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03,,openhpi"
47PACKAGECONFIG[plm] = "--enable-ais-plm,--disable-ais-plm,libvirt openhpi"
48
49PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
50
51CPPFLAGS += "-Wno-error=stringop-overflow= -Wno-error=stringop-truncation"
52CXXFLAGS += "-Wno-error=stringop-overflow= -Wno-error=stringop-truncation -Wno-error=format-truncation="
53LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
54
55do_install:append() {
56 rm -fr "${D}${localstatedir}/lock"
57 rm -fr "${D}${localstatedir}/run"
Andrew Geissler595f6302022-01-24 19:11:47 +000058 rmdir "${D}${localstatedir}/log/${BPN}/saflog"
59 rmdir "${D}${localstatedir}/log/${BPN}"
60 rmdir "${D}${localstatedir}/log"
Andrew Geisslereff27472021-10-29 15:35:00 -050061 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
62 rmdir --ignore-fail-on-non-empty "${D}${datadir}/java"
Andrew Geissler595f6302022-01-24 19:11:47 +000063
64 # Rename /etc/init.d/opensafd to /usr/lib/opensaf/opensafd-init as it is
65 # needed by opensafd.service, but /etc/init.d is removed by systemd.bbclass
66 # if sysvinit is not in DISTRO_FEATURES.
67 mv ${D}${sysconfdir}/init.d/opensafd ${D}${libdir}/${BPN}/opensafd-init
68 ln -srf ${D}${libdir}/${BPN}/opensafd-init ${D}${sysconfdir}/init.d/opensafd
69 [ ! -f ${D}${systemd_system_unitdir}/opensafd.service ] ||
70 sed -ri -e "s|/etc/init.d/opensafd|${libdir}/${BPN}/opensafd-init|" ${D}${systemd_system_unitdir}/opensafd.service
71
72 # Create /var/log/opensaf/saflog in runtime.
73 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
74 install -d ${D}${nonarch_libdir}/tmpfiles.d
75 echo "d ${localstatedir}/log/${BPN}/saflog - - - -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
76 fi
77 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
78 install -d ${D}${sysconfdir}/default/volatiles
79 echo "d root root 0755 ${localstatedir}/log/${BPN}/saflog none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
Andrew Geisslereff27472021-10-29 15:35:00 -050080 fi
81}
82
83FILES:${PN} += "${libdir}/libSa*.so ${systemd_unitdir}/system/*.service"
Andrew Geissler595f6302022-01-24 19:11:47 +000084FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"
Andrew Geisslereff27472021-10-29 15:35:00 -050085FILES:${PN}-dev += "${libdir}/libopensaf_core.so"
86FILES:${PN}-staticdev += "${PKGLIBDIR}/*.a"
87
88INSANE_SKIP:${PN} = "dev-so"
89
90RDEPENDS:${PN} += "bash python3-core"
91
92# http://errors.yoctoproject.org/Errors/Details/186970/
93COMPATIBLE_HOST:libc-musl = 'null'
94
95FILES_SOLIBSDEV = ""