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 | |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 10 | DEPENDS = "virtual/crypt expat flex python3 bison-native libxml2 nettle lz4" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 11 | RDEPENDS:${PN} = "python3-core" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 12 | |
| 13 | SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 14 | SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git;branch=master;protocol=https \ |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 15 | https://curl.haxx.se/download/curl-7.64.0.tar.bz2;name=curl;subdir=git/thirdparty \ |
| 16 | https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.8.3.tar.gz;name=libressl;subdir=git/thirdparty \ |
| 17 | ${DEBIAN_MIRROR}/main/o/ossp-uuid/ossp-uuid_1.6.2.orig.tar.gz;name=ossp-uuid;subdir=git/thirdparty \ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 18 | file://fix-minifi-compile.patch \ |
| 19 | file://fix-libressl-compile.patch \ |
| 20 | file://fix-libressl-avoid-BSWAP-assembly-for-ARM-v6.patch \ |
| 21 | file://fix-osspuuid-compile.patch \ |
| 22 | file://fix-osspuuid-cross-compile.patch \ |
| 23 | file://fix-osspuuid-musl-compile.patch \ |
| 24 | file://fix-rocksdb-cross-compile.patch \ |
| 25 | file://remove_const_due_to_std_lock_guard.patch \ |
| 26 | file://0001-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch \ |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 27 | file://0001-CMakeLists.txt-use-curl-local-source-tarball.patch \ |
| 28 | file://0002-cmake-LibreSSL.cmake-use-libressl-local-source-tarba.patch \ |
| 29 | file://0003-cmake-BundledOSSPUUID.cmake-use-ossp-uuid-local-sour.patch \ |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 30 | file://0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 31 | file://0001-cxxopts-Add-limits-header.patch \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 32 | file://0001-Fix-build-with-libc.patch \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 33 | file://0001-civetweb-Disable-lto.patch \ |
Patrick Williams | b9af875 | 2023-01-30 13:28:01 -0600 | [diff] [blame] | 34 | file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 35 | file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch \ |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 36 | file://0001-Fix-the-constness-issues-around-autovector-iterator_.patch \ |
| 37 | file://0002-Fix-build-with-clang-17.patch \ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 38 | file://minifi.service \ |
| 39 | file://systemd-volatile.conf \ |
| 40 | file://sysvinit-volatile.conf \ |
| 41 | " |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 42 | |
| 43 | SRC_URI[curl.md5sum] = "d0bcc586873cfef08b4b9594e5395a33" |
| 44 | SRC_URI[curl.sha256sum] = "d573ba1c2d1cf9d8533fadcce480d778417964e8d04ccddcc76e591d544cf2eb" |
| 45 | SRC_URI[libressl.md5sum] = "0f1127bd21b4aa8495a910379c2ad936" |
| 46 | SRC_URI[libressl.sha256sum] = "9b640b13047182761a99ce3e4f000be9687566e0828b4a72709e9e6a3ef98477" |
| 47 | SRC_URI[ossp-uuid.md5sum] = "5db0d43a9022a6ebbbc25337ae28942f" |
| 48 | SRC_URI[ossp-uuid.sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" |
| 49 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 50 | S = "${WORKDIR}/git" |
| 51 | |
| 52 | inherit pkgconfig cmake systemd |
| 53 | |
| 54 | SYSTEMD_PACKAGES = "minifi-cpp" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 55 | SYSTEMD_SERVICE:${PN} = "minifi.service" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 56 | SYSTEMD_AUTO_ENABLE = "disable" |
| 57 | |
| 58 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" |
| 59 | |
| 60 | EXTRA_OECMAKE += " \ |
| 61 | -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \ |
| 62 | -DSKIP_TESTS=ON \ |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 63 | -DGCC_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ |
| 64 | -DGCC_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 65 | -DDISABLE_PYTHON_SCRIPTING=ON \ |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 66 | -DFLEX_TARGET_ARG_COMPILE_FLAGS='--noline' \ |
| 67 | -DBISON_TARGET_ARG_COMPILE_FLAGS='--no-lines --file-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' \ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 68 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 69 | EXTRA_OECMAKE:append:toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib" |
| 70 | LDFLAGS:append:toolchain-clang = " -fuse-ld=lld" |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 71 | |
| 72 | # RV lld errors out: |
| 73 | # riscv64-yoe-linux-ld.lld: error: init.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 74 | LDFLAGS:remove:riscv32 = "-fuse-ld=lld" |
| 75 | LDFLAGS:remove:riscv64 = "-fuse-ld=lld" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 76 | |
| 77 | # There are endian issues when communicating with the x86 nifi on the the mips and the ppc machines. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 78 | COMPATIBLE_MACHINE:mips = "(!.*mips).*" |
| 79 | COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*" |
| 80 | COMPATIBLE_MACHINE:powerpc = "(!.*ppc).*" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 81 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | TARGET_CFLAGS:append:riscv32 = " -fpic" |
| 83 | TARGET_CXXFLAGS:append:riscv32 = " -fpic" |
| 84 | TARGET_CFLAGS:append:riscv64 = " -fpic" |
| 85 | TARGET_CXXFLAGS:append:riscv64 = " -fpic" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 86 | |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 87 | do_install[cleandirs] += "${WORKDIR}/minifi-install" |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 88 | PSEUDO_CONSIDER_PATHS .= ",${WORKDIR}/minifi-install" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 89 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 90 | do_configure:prepend:libc-musl() { |
| 91 | sed -i -e 's/-DHAVE_GLIBC_STRERROR_R=1/-DHAVE_GLIBC_STRERROR_R=0/' ${S}/CMakeLists.txt |
| 92 | sed -i -e 's/-DHAVE_POSIX_STRERROR_R=0/-DHAVE_POSIX_STRERROR_R=1/' ${S}/CMakeLists.txt |
| 93 | } |
| 94 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 95 | do_configure:append() { |
| 96 | sed -i -e 's|${WORKDIR}|<WORKDIR>|g' ${S}/libminifi/include/agent/agent_version.h |
| 97 | } |
| 98 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 99 | CFLAGS:append:libc-glibc = " -D_GNU_SOURCE" |
| 100 | CXXFLAGS:append:libc-glibc = " -D_GNU_SOURCE" |
| 101 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 102 | do_install() { |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 103 | DESTDIR='${WORKDIR}/minifi-install' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} |
| 104 | MINIFI_BIN=${bindir} |
| 105 | MINIFI_HOME=${sysconfdir}/minifi |
| 106 | MINIFI_RUN=${localstatedir}/lib/minifi |
| 107 | MINIFI_LOG=${localstatedir}/log/minifi |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 108 | |
| 109 | install -d ${D}${MINIFI_BIN} |
| 110 | install -d ${D}${MINIFI_HOME}/conf |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 111 | install -m 755 -d ${D}${localstatedir}/lib/minifi |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 112 | install -m 755 -d ${D}${libexecdir}/minifi-python |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 113 | cp -a ${WORKDIR}/minifi-install/usr/bin/* ${D}${MINIFI_BIN}/ |
| 114 | cp -a ${WORKDIR}/minifi-install/usr/conf/* ${D}${MINIFI_HOME}/conf/ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 115 | |
| 116 | sed -i 's|#appender.rolling.directory=.*|appender.rolling.directory='${MINIFI_LOG}'|g' \ |
| 117 | ${D}${MINIFI_HOME}/conf/minifi-log.properties |
| 118 | sed -i 's|nifi.provenance.repository.directory.default=.*|nifi.provenance.repository.directory.default='${MINIFI_RUN}'/provenance_repository|g' \ |
| 119 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 120 | sed -i 's|nifi.flowfile.repository.directory.default=.*|nifi.flowfile.repository.directory.default='${MINIFI_RUN}'/flowfile_repository|g' \ |
| 121 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 122 | sed -i 's|nifi.database.content.repository.directory.default=.*|nifi.database.content.repository.directory.default='${MINIFI_RUN}'/content_repository|g' \ |
| 123 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 124 | sed -i 's|nifi.flow.configuration.file=.*|nifi.flow.configuration.file='${MINIFI_HOME}'/conf/config.yml|g' \ |
| 125 | ${D}${MINIFI_HOME}/conf/minifi.properties |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 126 | sed -i 's|nifi.python.processor.dir=.*|nifi.python.processor.dir=${libexecdir}/minifi-python|g' \ |
| 127 | ${D}${MINIFI_HOME}/conf/minifi.properties |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 128 | |
| 129 | sed -i 's|export MINIFI_HOME=.*|export MINIFI_HOME='${MINIFI_HOME}'|g' ${D}${MINIFI_BIN}/minifi.sh |
| 130 | sed -i 's|bin_dir=${MINIFI_HOME}/bin|bin_dir='${MINIFI_BIN}'|g' ${D}${MINIFI_BIN}/minifi.sh |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 131 | sed -i 's|pid_file=${bin_dir}/.|pid_file='${localstatedir}/run/'|g' ${D}${MINIFI_BIN}/minifi.sh |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 132 | |
| 133 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 134 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 135 | install -m 0644 ${WORKDIR}/systemd-volatile.conf ${D}${sysconfdir}/tmpfiles.d/minifi.conf |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 136 | install -m 0755 -d ${D}${systemd_unitdir}/system |
| 137 | install -m 0644 ${WORKDIR}/minifi.service ${D}${systemd_unitdir}/system/ |
| 138 | |
| 139 | sed -i 's|@LOCALSTATEDIR@|${localstatedir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 140 | sed -i 's|@SYSCONFDIR@|${sysconfdir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 141 | sed -i 's|@BINDIR@|${bindir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 142 | |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 143 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/tmpfiles.d/minifi.conf |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 144 | |
| 145 | elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 146 | install -d ${D}${sysconfdir}/default/volatiles |
| 147 | install -m 0644 ${WORKDIR}/sysvinit-volatile.conf ${D}${sysconfdir}/default/volatiles/99_minifi |
| 148 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 149 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi |
| 150 | fi |
| 151 | } |
| 152 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 153 | pkg_postinst:${PN}() { |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 154 | if [ -z "$D" ]; then |
| 155 | if type systemd-tmpfiles >/dev/null; then |
| 156 | systemd-tmpfiles --create |
| 157 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 158 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 159 | fi |
| 160 | fi |
| 161 | } |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 162 | |
| 163 | CLEANBROKEN = "1" |