Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 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 libxml2" |
| 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://remove_const_due_to_std_lock_guard.patch \ |
| 23 | file://0001-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ |
| 24 | file://minifi.service \ |
| 25 | file://systemd-volatile.conf \ |
| 26 | file://sysvinit-volatile.conf \ |
| 27 | " |
| 28 | S = "${WORKDIR}/git" |
| 29 | |
| 30 | inherit pkgconfig cmake systemd |
| 31 | |
| 32 | SYSTEMD_PACKAGES = "minifi-cpp" |
| 33 | SYSTEMD_SERVICE_${PN} = "minifi.service" |
| 34 | SYSTEMD_AUTO_ENABLE = "disable" |
| 35 | |
| 36 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" |
| 37 | |
| 38 | EXTRA_OECMAKE += " \ |
| 39 | -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \ |
| 40 | -DSKIP_TESTS=ON \ |
| 41 | " |
| 42 | EXTRA_OECMAKE_append_toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib" |
| 43 | LDFLAGS_append_toolchain-clang = " -fuse-ld=lld" |
| 44 | |
| 45 | # There are endian issues when communicating with the x86 nifi on the the mips and the ppc machines. |
| 46 | COMPATIBLE_MACHINE_mips = "(!.*mips).*" |
| 47 | COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" |
| 48 | COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" |
| 49 | |
| 50 | TARGET_CFLAGS_append_riscv32 += "-fpic" |
| 51 | TARGET_CXXFLAGS_append_riscv32 += "-fpic" |
| 52 | TARGET_CFLAGS_append_riscv64 += "-fpic" |
| 53 | TARGET_CXXFLAGS_append_riscv64 += "-fpic" |
| 54 | |
| 55 | |
| 56 | do_install() { |
| 57 | DESTDIR='${B}/minifi-install' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} |
| 58 | |
| 59 | MINIFI_BIN=${base_prefix}${bindir} |
| 60 | MINIFI_HOME=${base_prefix}${sysconfdir}/minifi |
| 61 | MINIFI_RUN=${base_prefix}${localstatedir}/run/minifi |
| 62 | MINIFI_LOG=${base_prefix}${localstatedir}/log/minifi |
| 63 | |
| 64 | install -d ${D}${MINIFI_BIN} |
| 65 | install -d ${D}${MINIFI_HOME}/conf |
| 66 | cp -a ${B}/minifi-install/usr/bin/* ${D}${MINIFI_BIN}/ |
| 67 | cp -a ${B}/minifi-install/usr/conf/* ${D}${MINIFI_HOME}/conf/ |
| 68 | |
| 69 | sed -i 's|#appender.rolling.directory=.*|appender.rolling.directory='${MINIFI_LOG}'|g' \ |
| 70 | ${D}${MINIFI_HOME}/conf/minifi-log.properties |
| 71 | sed -i 's|nifi.provenance.repository.directory.default=.*|nifi.provenance.repository.directory.default='${MINIFI_RUN}'/provenance_repository|g' \ |
| 72 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 73 | sed -i 's|nifi.flowfile.repository.directory.default=.*|nifi.flowfile.repository.directory.default='${MINIFI_RUN}'/flowfile_repository|g' \ |
| 74 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 75 | sed -i 's|nifi.database.content.repository.directory.default=.*|nifi.database.content.repository.directory.default='${MINIFI_RUN}'/content_repository|g' \ |
| 76 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 77 | sed -i 's|nifi.flow.configuration.file=.*|nifi.flow.configuration.file='${MINIFI_HOME}'/conf/config.yml|g' \ |
| 78 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 79 | |
| 80 | sed -i 's|export MINIFI_HOME=.*|export MINIFI_HOME='${MINIFI_HOME}'|g' ${D}${MINIFI_BIN}/minifi.sh |
| 81 | sed -i 's|bin_dir=${MINIFI_HOME}/bin|bin_dir='${MINIFI_BIN}'|g' ${D}${MINIFI_BIN}/minifi.sh |
| 82 | sed -i 's|pid_file=${bin_dir}|pid_file='${MINIFI_RUN}'|g' ${D}${MINIFI_BIN}/minifi.sh |
| 83 | |
| 84 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 85 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
| 86 | install -m 0644 ${WORKDIR}/systemd-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 87 | install -m 0755 -d ${D}${systemd_unitdir}/system |
| 88 | install -m 0644 ${WORKDIR}/minifi.service ${D}${systemd_unitdir}/system/ |
| 89 | |
| 90 | sed -i 's|@LOCALSTATEDIR@|${localstatedir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 91 | sed -i 's|@SYSCONFDIR@|${sysconfdir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 92 | sed -i 's|@BINDIR@|${bindir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 93 | |
| 94 | sed -i 's|@MINIFI_RUN@|'${MINIFI_RUN}'|g' ${D}${sysconfdir}/tmpfiles.d/systemd-volatile.conf |
| 95 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/tmpfiles.d/systemd-volatile.conf |
| 96 | |
| 97 | elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 98 | install -d ${D}${sysconfdir}/default/volatiles |
| 99 | install -m 0644 ${WORKDIR}/sysvinit-volatile.conf ${D}${sysconfdir}/default/volatiles/99_minifi |
| 100 | |
| 101 | sed -i 's|@MINIFI_RUN@|'${MINIFI_RUN}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi |
| 102 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi |
| 103 | fi |
| 104 | } |
| 105 | |
| 106 | pkg_postinst_${PN}() { |
| 107 | if [ -z "$D" ]; then |
| 108 | if type systemd-tmpfiles >/dev/null; then |
| 109 | systemd-tmpfiles --create |
| 110 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 111 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 112 | fi |
| 113 | fi |
| 114 | } |
| 115 | |
| 116 | FILES_${PN} = " \ |
| 117 | ${bindir} \ |
| 118 | ${sysconfdir} \ |
| 119 | ${systemd_unitdir} \ |
| 120 | " |