diff options
Diffstat (limited to 'meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb')
| -rw-r--r-- | meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb new file mode 100644 index 0000000000..150d1fa53c --- /dev/null +++ b/meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.7.0.bb | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | SUMMARY = "A subproject of Apache NiFi to collect data where it originates." | ||
| 2 | DESCRIPTION = "MiNiFi--a subproject of Apache NiFi--is a complementary \ | ||
| 3 | data collection approach that supplements the core tenets of NiFi in dataflow \ | ||
| 4 | management, focusing on the collection of data at the source of its creation." | ||
| 5 | HOMEPAGE = "https://nifi.apache.org/minifi/index.html" | ||
| 6 | SECTION = "console/network" | ||
| 7 | LICENSE = "Apache-2.0" | ||
| 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=f9534eb5f4ab800b573a37bffc62f3a7" | ||
| 9 | |||
| 10 | DEPENDS = "virtual/crypt expat flex python3 bison-native" | ||
| 11 | RDEPENDS_${PN} = "python3-core" | ||
| 12 | |||
| 13 | SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a" | ||
| 14 | SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git \ | ||
| 15 | file://fix-minifi-compile.patch \ | ||
| 16 | file://fix-libressl-compile.patch \ | ||
| 17 | file://fix-libressl-avoid-BSWAP-assembly-for-ARM-v6.patch \ | ||
| 18 | file://fix-osspuuid-compile.patch \ | ||
| 19 | file://fix-osspuuid-cross-compile.patch \ | ||
| 20 | file://fix-osspuuid-musl-compile.patch \ | ||
| 21 | file://fix-rocksdb-cross-compile.patch \ | ||
| 22 | file://minifi.service \ | ||
| 23 | file://systemd-volatile.conf \ | ||
| 24 | file://sysvinit-volatile.conf \ | ||
| 25 | " | ||
| 26 | S = "${WORKDIR}/git" | ||
| 27 | |||
| 28 | inherit pkgconfig cmake systemd | ||
| 29 | |||
| 30 | SYSTEMD_PACKAGES = "minifi-cpp" | ||
| 31 | SYSTEMD_SERVICE_${PN} = "minifi.service" | ||
| 32 | SYSTEMD_AUTO_ENABLE = "disable" | ||
| 33 | |||
| 34 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" | ||
| 35 | |||
| 36 | EXTRA_OECMAKE += " \ | ||
| 37 | -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \ | ||
| 38 | -DSKIP_TESTS=ON \ | ||
| 39 | " | ||
| 40 | |||
| 41 | # There are endian issues when communicating with the x86 nifi on the the mips and the ppc machines. | ||
| 42 | COMPATIBLE_MACHINE_mips = "(!.*mips).*" | ||
| 43 | COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" | ||
| 44 | COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" | ||
| 45 | |||
| 46 | TARGET_CFLAGS_append_riscv32 += "-fpic" | ||
| 47 | TARGET_CXXFLAGS_append_riscv32 += "-fpic" | ||
| 48 | TARGET_CFLAGS_append_riscv64 += "-fpic" | ||
| 49 | TARGET_CXXFLAGS_append_riscv64 += "-fpic" | ||
| 50 | |||
| 51 | |||
| 52 | do_install() { | ||
| 53 | DESTDIR='${B}/minifi-install' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} | ||
| 54 | |||
| 55 | MINIFI_BIN=${base_prefix}${bindir} | ||
| 56 | MINIFI_HOME=${base_prefix}${sysconfdir}/minifi | ||
| 57 | MINIFI_RUN=${base_prefix}${localstatedir}/run/minifi | ||
| 58 | MINIFI_LOG=${base_prefix}${localstatedir}/log/minifi | ||
| 59 | |||
| 60 | install -d ${D}${MINIFI_BIN} | ||
| 61 | install -d ${D}${MINIFI_HOME}/conf | ||
| 62 | cp -a ${B}/minifi-install/usr/bin/* ${D}${MINIFI_BIN}/ | ||
| 63 | cp -a ${B}/minifi-install/usr/conf/* ${D}${MINIFI_HOME}/conf/ | ||
| 64 | |||
| 65 | sed -i 's|#appender.rolling.directory=.*|appender.rolling.directory='${MINIFI_LOG}'|g' \ | ||
| 66 | ${D}${MINIFI_HOME}/conf/minifi-log.properties | ||
| 67 | sed -i 's|nifi.provenance.repository.directory.default=.*|nifi.provenance.repository.directory.default='${MINIFI_RUN}'/provenance_repository|g' \ | ||
| 68 | ${D}${MINIFI_HOME}/conf/minifi.properties | ||
| 69 | sed -i 's|nifi.flowfile.repository.directory.default=.*|nifi.flowfile.repository.directory.default='${MINIFI_RUN}'/flowfile_repository|g' \ | ||
| 70 | ${D}${MINIFI_HOME}/conf/minifi.properties | ||
| 71 | sed -i 's|nifi.database.content.repository.directory.default=.*|nifi.database.content.repository.directory.default='${MINIFI_RUN}'/content_repository|g' \ | ||
| 72 | ${D}${MINIFI_HOME}/conf/minifi.properties | ||
| 73 | sed -i 's|nifi.flow.configuration.file=.*|nifi.flow.configuration.file='${MINIFI_HOME}'/conf/config.yml|g' \ | ||
| 74 | ${D}${MINIFI_HOME}/conf/minifi.properties | ||
| 75 | |||
| 76 | sed -i 's|export MINIFI_HOME=.*|export MINIFI_HOME='${MINIFI_HOME}'|g' ${D}${MINIFI_BIN}/minifi.sh | ||
| 77 | sed -i 's|bin_dir=${MINIFI_HOME}/bin|bin_dir='${MINIFI_BIN}'|g' ${D}${MINIFI_BIN}/minifi.sh | ||
| 78 | sed -i 's|pid_file=${bin_dir}|pid_file='${MINIFI_RUN}'|g' ${D}${MINIFI_BIN}/minifi.sh | ||
| 79 | |||
| 80 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
| 81 | install -d ${D}${sysconfdir}/tmpfiles.d/ | ||
| 82 | install -m 0644 ${WORKDIR}/systemd-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
| 83 | install -m 0755 -d ${D}${systemd_unitdir}/system | ||
| 84 | install -m 0644 ${WORKDIR}/minifi.service ${D}${systemd_unitdir}/system/ | ||
| 85 | |||
| 86 | sed -i 's|@LOCALSTATEDIR@|${localstatedir}|g' ${D}${systemd_unitdir}/system/minifi.service | ||
| 87 | sed -i 's|@SYSCONFDIR@|${sysconfdir}|g' ${D}${systemd_unitdir}/system/minifi.service | ||
| 88 | sed -i 's|@BINDIR@|${bindir}|g' ${D}${systemd_unitdir}/system/minifi.service | ||
| 89 | |||
| 90 | sed -i 's|@MINIFI_RUN@|'${MINIFI_RUN}'|g' ${D}${sysconfdir}/tmpfiles.d/systemd-volatile.conf | ||
| 91 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/tmpfiles.d/systemd-volatile.conf | ||
| 92 | |||
| 93 | elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 94 | install -d ${D}${sysconfdir}/default/volatiles | ||
| 95 | install -m 0644 ${WORKDIR}/sysvinit-volatile.conf ${D}${sysconfdir}/default/volatiles/99_minifi | ||
| 96 | |||
| 97 | sed -i 's|@MINIFI_RUN@|'${MINIFI_RUN}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi | ||
| 98 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi | ||
| 99 | fi | ||
| 100 | } | ||
| 101 | |||
| 102 | pkg_postinst_${PN}() { | ||
| 103 | if [ -z "$D" ]; then | ||
| 104 | if type systemd-tmpfiles >/dev/null; then | ||
| 105 | systemd-tmpfiles --create | ||
| 106 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
| 107 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
| 108 | fi | ||
| 109 | fi | ||
| 110 | } | ||
| 111 | |||
| 112 | FILES_${PN} = " \ | ||
| 113 | ${bindir} \ | ||
| 114 | ${sysconfdir} \ | ||
| 115 | ${systemd_unitdir} \ | ||
| 116 | " | ||
