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" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 11 | RDEPENDS_${PN} = "python3-core" |
| 12 | |
| 13 | SRCREV = "aa42957a2e227df41510047cece3cd606dc1cb6a" |
| 14 | SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git \ |
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 | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 31 | file://minifi.service \ |
| 32 | file://systemd-volatile.conf \ |
| 33 | file://sysvinit-volatile.conf \ |
| 34 | " |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 35 | |
| 36 | SRC_URI[curl.md5sum] = "d0bcc586873cfef08b4b9594e5395a33" |
| 37 | SRC_URI[curl.sha256sum] = "d573ba1c2d1cf9d8533fadcce480d778417964e8d04ccddcc76e591d544cf2eb" |
| 38 | SRC_URI[libressl.md5sum] = "0f1127bd21b4aa8495a910379c2ad936" |
| 39 | SRC_URI[libressl.sha256sum] = "9b640b13047182761a99ce3e4f000be9687566e0828b4a72709e9e6a3ef98477" |
| 40 | SRC_URI[ossp-uuid.md5sum] = "5db0d43a9022a6ebbbc25337ae28942f" |
| 41 | SRC_URI[ossp-uuid.sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" |
| 42 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 43 | S = "${WORKDIR}/git" |
| 44 | |
| 45 | inherit pkgconfig cmake systemd |
| 46 | |
| 47 | SYSTEMD_PACKAGES = "minifi-cpp" |
| 48 | SYSTEMD_SERVICE_${PN} = "minifi.service" |
| 49 | SYSTEMD_AUTO_ENABLE = "disable" |
| 50 | |
| 51 | OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" |
| 52 | |
| 53 | EXTRA_OECMAKE += " \ |
| 54 | -DHOST_SYS=${HOST_SYS} -DBUILD_SYS=${BUILD_SYS} \ |
| 55 | -DSKIP_TESTS=ON \ |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 56 | -DGCC_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ |
| 57 | -DGCC_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 58 | " |
| 59 | EXTRA_OECMAKE_append_toolchain-clang = " -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib" |
| 60 | LDFLAGS_append_toolchain-clang = " -fuse-ld=lld" |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 61 | |
| 62 | # RV lld errors out: |
| 63 | # riscv64-yoe-linux-ld.lld: error: init.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax |
Andrew Geissler | bbbd5f4 | 2020-10-30 15:42:48 -0500 | [diff] [blame] | 64 | LDFLAGS_remove_riscv32 = "-fuse-ld=lld" |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 65 | LDFLAGS_remove_riscv64 = "-fuse-ld=lld" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 66 | |
| 67 | # There are endian issues when communicating with the x86 nifi on the the mips and the ppc machines. |
| 68 | COMPATIBLE_MACHINE_mips = "(!.*mips).*" |
| 69 | COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" |
| 70 | COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" |
| 71 | |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 72 | TARGET_CFLAGS_append_riscv32 = " -fpic" |
| 73 | TARGET_CXXFLAGS_append_riscv32 = " -fpic" |
| 74 | TARGET_CFLAGS_append_riscv64 = " -fpic" |
| 75 | TARGET_CXXFLAGS_append_riscv64 = " -fpic" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 76 | |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 77 | do_install[cleandirs] += "${WORKDIR}/minifi-install" |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 78 | |
| 79 | do_install() { |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 80 | DESTDIR='${WORKDIR}/minifi-install' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} |
| 81 | MINIFI_BIN=${bindir} |
| 82 | MINIFI_HOME=${sysconfdir}/minifi |
| 83 | MINIFI_RUN=${localstatedir}/lib/minifi |
| 84 | MINIFI_LOG=${localstatedir}/log/minifi |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 85 | |
| 86 | install -d ${D}${MINIFI_BIN} |
| 87 | install -d ${D}${MINIFI_HOME}/conf |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 88 | install -m 755 -d ${D}${localstatedir}/lib/minifi |
| 89 | cp -a ${WORKDIR}/minifi-install/usr/bin/* ${D}${MINIFI_BIN}/ |
| 90 | cp -a ${WORKDIR}/minifi-install/usr/conf/* ${D}${MINIFI_HOME}/conf/ |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 91 | |
| 92 | sed -i 's|#appender.rolling.directory=.*|appender.rolling.directory='${MINIFI_LOG}'|g' \ |
| 93 | ${D}${MINIFI_HOME}/conf/minifi-log.properties |
| 94 | sed -i 's|nifi.provenance.repository.directory.default=.*|nifi.provenance.repository.directory.default='${MINIFI_RUN}'/provenance_repository|g' \ |
| 95 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 96 | sed -i 's|nifi.flowfile.repository.directory.default=.*|nifi.flowfile.repository.directory.default='${MINIFI_RUN}'/flowfile_repository|g' \ |
| 97 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 98 | sed -i 's|nifi.database.content.repository.directory.default=.*|nifi.database.content.repository.directory.default='${MINIFI_RUN}'/content_repository|g' \ |
| 99 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 100 | sed -i 's|nifi.flow.configuration.file=.*|nifi.flow.configuration.file='${MINIFI_HOME}'/conf/config.yml|g' \ |
| 101 | ${D}${MINIFI_HOME}/conf/minifi.properties |
| 102 | |
| 103 | sed -i 's|export MINIFI_HOME=.*|export MINIFI_HOME='${MINIFI_HOME}'|g' ${D}${MINIFI_BIN}/minifi.sh |
| 104 | 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] | 105 | 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] | 106 | |
| 107 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 108 | install -d ${D}${sysconfdir}/tmpfiles.d/ |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 109 | 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] | 110 | install -m 0755 -d ${D}${systemd_unitdir}/system |
| 111 | install -m 0644 ${WORKDIR}/minifi.service ${D}${systemd_unitdir}/system/ |
| 112 | |
| 113 | sed -i 's|@LOCALSTATEDIR@|${localstatedir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 114 | sed -i 's|@SYSCONFDIR@|${sysconfdir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 115 | sed -i 's|@BINDIR@|${bindir}|g' ${D}${systemd_unitdir}/system/minifi.service |
| 116 | |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 117 | 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] | 118 | |
| 119 | elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 120 | install -d ${D}${sysconfdir}/default/volatiles |
| 121 | install -m 0644 ${WORKDIR}/sysvinit-volatile.conf ${D}${sysconfdir}/default/volatiles/99_minifi |
| 122 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 123 | sed -i 's|@MINIFI_LOG@|'${MINIFI_LOG}'|g' ${D}${sysconfdir}/default/volatiles/99_minifi |
| 124 | fi |
| 125 | } |
| 126 | |
| 127 | pkg_postinst_${PN}() { |
| 128 | if [ -z "$D" ]; then |
| 129 | if type systemd-tmpfiles >/dev/null; then |
| 130 | systemd-tmpfiles --create |
| 131 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 132 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 133 | fi |
| 134 | fi |
| 135 | } |