blob: 5059b6321231c24af3e8fde11b44f0ceaf93fca3 [file] [log] [blame]
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -05001SUMMARY = "A subproject of Apache NiFi to collect data where it originates."
2DESCRIPTION = "MiNiFi--a subproject of Apache NiFi--is a complementary \
3data collection approach that supplements the core tenets of NiFi in dataflow \
4management, focusing on the collection of data at the source of its creation."
5HOMEPAGE = "https://nifi.apache.org/minifi/index.html"
6SECTION = "console/network"
7LICENSE = "Apache-2.0"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=f9534eb5f4ab800b573a37bffc62f3a7"
9
Andrew Geissler4b7c1152020-11-30 19:55:29 -060010DEPENDS = "virtual/crypt expat flex python3 bison-native libxml2 nettle lz4"
Patrick Williams213cb262021-08-07 19:21:33 -050011RDEPENDS:${PN} = "python3-core"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050012
13SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a"
Andrew Geissler595f6302022-01-24 19:11:47 +000014SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git;branch=master;protocol=https \
Andrew Geisslera2681d92020-10-16 10:17:07 -050015 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 Geisslerbffdb3e2020-08-21 16:13:29 -050018 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 Geisslera2681d92020-10-16 10:17:07 -050027 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 Geissler4b7c1152020-11-30 19:55:29 -060030 file://0001-civetweb-CMakeLists.txt-do-not-search-gcc-ar-and-gcc.patch \
Andrew Geissler97771a32021-03-05 15:23:11 -060031 file://0001-cxxopts-Add-limits-header.patch \
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070032 file://0001-Fix-build-with-libc.patch \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050033 file://0001-civetweb-Disable-lto.patch \
Patrick Williamsb9af8752023-01-30 13:28:01 -060034 file://0001-Add-missing-includes-cstdint-and-cstdio.patch \
Patrick Williams8e7b46e2023-05-01 14:19:06 -050035 file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch \
Andrew Geissler8f840682023-07-21 09:09:43 -050036 file://0001-Fix-the-constness-issues-around-autovector-iterator_.patch \
37 file://0002-Fix-build-with-clang-17.patch \
Andrew Geissler220dafd2023-10-04 10:18:08 -050038 file://0001-CMakeLists.txt-Pass-the-OPENSSLDIR.patch \
39 file://0001-BundledOSSPUUID.cmake-Pass-CFLAGS-to-compiler.patch \
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050040 file://minifi.service \
41 file://systemd-volatile.conf \
42 file://sysvinit-volatile.conf \
Patrick Williams169d7bc2024-01-05 11:33:25 -060043 file://0001-config.guess-Support-build-on-aarch64.patch \
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050044 "
Andrew Geisslera2681d92020-10-16 10:17:07 -050045
46SRC_URI[curl.md5sum] = "d0bcc586873cfef08b4b9594e5395a33"
47SRC_URI[curl.sha256sum] = "d573ba1c2d1cf9d8533fadcce480d778417964e8d04ccddcc76e591d544cf2eb"
48SRC_URI[libressl.md5sum] = "0f1127bd21b4aa8495a910379c2ad936"
49SRC_URI[libressl.sha256sum] = "9b640b13047182761a99ce3e4f000be9687566e0828b4a72709e9e6a3ef98477"
50SRC_URI[ossp-uuid.md5sum] = "5db0d43a9022a6ebbbc25337ae28942f"
51SRC_URI[ossp-uuid.sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0"
52
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050053S = "${WORKDIR}/git"
54
55inherit pkgconfig cmake systemd
56
57SYSTEMD_PACKAGES = "minifi-cpp"
Patrick Williams213cb262021-08-07 19:21:33 -050058SYSTEMD_SERVICE:${PN} = "minifi.service"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050059SYSTEMD_AUTO_ENABLE = "disable"
60
61OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
62
63EXTRA_OECMAKE += " \
64 -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \
65 -DSKIP_TESTS=ON \
Andrew Geissler4b7c1152020-11-30 19:55:29 -060066 -DGCC_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \
67 -DGCC_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050068 -DDISABLE_PYTHON_SCRIPTING=ON \
Patrick Williamse760df82023-05-26 11:10:49 -050069 -DFLEX_TARGET_ARG_COMPILE_FLAGS='--noline' \
Patrick Williamsac13d5f2023-11-24 18:59:46 -060070 -DBISON_TARGET_ARG_COMPILE_FLAGS='--no-lines --file-prefix-map=${S}=${TARGET_DBGSRC_DIR}' \
Andrew Geissler220dafd2023-10-04 10:18:08 -050071 -DOPENSSLDIR=${sysconfdir}/libressl \
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050072 "
Andrew Geissler220dafd2023-10-04 10:18:08 -050073
74CFLAGS:append = " -fPIC"
Patrick Williams213cb262021-08-07 19:21:33 -050075EXTRA_OECMAKE:append:toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib"
76LDFLAGS:append:toolchain-clang = " -fuse-ld=lld"
Andrew Geissler4b7c1152020-11-30 19:55:29 -060077
78# RV lld errors out:
79# riscv64-yoe-linux-ld.lld: error: init.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
Patrick Williams213cb262021-08-07 19:21:33 -050080LDFLAGS:remove:riscv32 = "-fuse-ld=lld"
81LDFLAGS:remove:riscv64 = "-fuse-ld=lld"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050082
83# There are endian issues when communicating with the x86 nifi on the the mips and the ppc machines.
Patrick Williams213cb262021-08-07 19:21:33 -050084COMPATIBLE_MACHINE:mips = "(!.*mips).*"
85COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*"
86COMPATIBLE_MACHINE:powerpc = "(!.*ppc).*"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050087
Patrick Williams213cb262021-08-07 19:21:33 -050088TARGET_CFLAGS:append:riscv32 = " -fpic"
89TARGET_CXXFLAGS:append:riscv32 = " -fpic"
90TARGET_CFLAGS:append:riscv64 = " -fpic"
91TARGET_CXXFLAGS:append:riscv64 = " -fpic"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050092
Andrew Geisslera2681d92020-10-16 10:17:07 -050093do_install[cleandirs] += "${WORKDIR}/minifi-install"
Andrew Geisslerac970dd2021-02-12 15:32:45 -060094PSEUDO_CONSIDER_PATHS .= ",${WORKDIR}/minifi-install"
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050095
Andrew Geissler87f5cff2022-09-30 13:13:31 -050096do_configure:prepend:libc-musl() {
97 sed -i -e 's/-DHAVE_GLIBC_STRERROR_R=1/-DHAVE_GLIBC_STRERROR_R=0/' ${S}/CMakeLists.txt
98 sed -i -e 's/-DHAVE_POSIX_STRERROR_R=0/-DHAVE_POSIX_STRERROR_R=1/' ${S}/CMakeLists.txt
99}
100
Patrick Williamse760df82023-05-26 11:10:49 -0500101do_configure:append() {
102 sed -i -e 's|${WORKDIR}|<WORKDIR>|g' ${S}/libminifi/include/agent/agent_version.h
103}
104
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500105CFLAGS:append:libc-glibc = " -D_GNU_SOURCE"
106CXXFLAGS:append:libc-glibc = " -D_GNU_SOURCE"
107
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500108do_install() {
Andrew Geisslera2681d92020-10-16 10:17:07 -0500109 DESTDIR='${WORKDIR}/minifi-install' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL}
110 MINIFI_BIN=${bindir}
111 MINIFI_HOME=${sysconfdir}/minifi
112 MINIFI_RUN=${localstatedir}/lib/minifi
113 MINIFI_LOG=${localstatedir}/log/minifi
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500114
115 install -d ${D}${MINIFI_BIN}
116 install -d ${D}${MINIFI_HOME}/conf
Andrew Geisslera2681d92020-10-16 10:17:07 -0500117 install -m 755 -d ${D}${localstatedir}/lib/minifi
Andrew Geissler69721092021-07-23 12:57:00 -0400118 install -m 755 -d ${D}${libexecdir}/minifi-python
Andrew Geisslera2681d92020-10-16 10:17:07 -0500119 cp -a ${WORKDIR}/minifi-install/usr/bin/* ${D}${MINIFI_BIN}/
120 cp -a ${WORKDIR}/minifi-install/usr/conf/* ${D}${MINIFI_HOME}/conf/
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500121
122 sed -i 's|#appender.rolling.directory=.*|appender.rolling.directory='${MINIFI_LOG}'|g' \
123 ${D}${MINIFI_HOME}/conf/minifi-log.properties
124 sed -i 's|nifi.provenance.repository.directory.default=.*|nifi.provenance.repository.directory.default='${MINIFI_RUN}'/provenance_repository|g' \
125 ${D}${MINIFI_HOME}/conf/minifi.properties
126 sed -i 's|nifi.flowfile.repository.directory.default=.*|nifi.flowfile.repository.directory.default='${MINIFI_RUN}'/flowfile_repository|g' \
127 ${D}${MINIFI_HOME}/conf/minifi.properties
128 sed -i 's|nifi.database.content.repository.directory.default=.*|nifi.database.content.repository.directory.default='${MINIFI_RUN}'/content_repository|g' \
129 ${D}${MINIFI_HOME}/conf/minifi.properties
130 sed -i 's|nifi.flow.configuration.file=.*|nifi.flow.configuration.file='${MINIFI_HOME}'/conf/config.yml|g' \
131 ${D}${MINIFI_HOME}/conf/minifi.properties
Andrew Geissler69721092021-07-23 12:57:00 -0400132 sed -i 's|nifi.python.processor.dir=.*|nifi.python.processor.dir=${libexecdir}/minifi-python|g' \
133 ${D}${MINIFI_HOME}/conf/minifi.properties
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500134
135 sed -i 's|export MINIFI_HOME=.*|export MINIFI_HOME='${MINIFI_HOME}'|g' ${D}${MINIFI_BIN}/minifi.sh
136 sed -i 's|bin_dir=${MINIFI_HOME}/bin|bin_dir='${MINIFI_BIN}'|g' ${D}${MINIFI_BIN}/minifi.sh
Andrew Geisslera2681d92020-10-16 10:17:07 -0500137 sed -i 's|pid_file=${bin_dir}/.|pid_file='${localstatedir}/run/'|g' ${D}${MINIFI_BIN}/minifi.sh
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500138
139 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
140 install -d ${D}${sysconfdir}/tmpfiles.d/
Andrew Geisslera2681d92020-10-16 10:17:07 -0500141 install -m 0644 ${WORKDIR}/systemd-volatile.conf ${D}${sysconfdir}/tmpfiles.d/minifi.conf
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500142 install -m 0755 -d ${D}${systemd_unitdir}/system
143 install -m 0644 ${WORKDIR}/minifi.service ${D}${systemd_unitdir}/system/
144
145 sed -i 's|@LOCALSTATEDIR@|${localstatedir}|g' ${D}${systemd_unitdir}/system/minifi.service
146 sed -i 's|@SYSCONFDIR@|${sysconfdir}|g' ${D}${systemd_unitdir}/system/minifi.service
147 sed -i 's|@BINDIR@|${bindir}|g' ${D}${systemd_unitdir}/system/minifi.service
148
Andrew Geisslera2681d92020-10-16 10:17:07 -0500149 sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/tmpfiles.d/minifi.conf
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500150
151 elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
152 install -d ${D}${sysconfdir}/default/volatiles
153 install -m 0644 ${WORKDIR}/sysvinit-volatile.conf ${D}${sysconfdir}/default/volatiles/99_minifi
154
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500155 sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi
156 fi
157}
158
Patrick Williams213cb262021-08-07 19:21:33 -0500159pkg_postinst:${PN}() {
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -0500160 if [ -z "$D" ]; then
161 if type systemd-tmpfiles >/dev/null; then
162 systemd-tmpfiles --create
163 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
164 ${sysconfdir}/init.d/populate-volatile.sh update
165 fi
166 fi
167}
Andrew Geissler69721092021-07-23 12:57:00 -0400168
169CLEANBROKEN = "1"