Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 1 | DESCRIPTION = "InfluxDB is a time series database designed to handle high write and query loads." |
| 2 | HOMEPAGE = "https://www.influxdata.com/products/influxdb-overview/" |
| 3 | |
| 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=f39a8d10930fb37bd59adabb3b9d0bd6" |
| 6 | |
| 7 | RDEPENDS:${PN} = "bash" |
| 8 | RDEPENDS:${PN}-dev = "bash" |
| 9 | |
| 10 | GO_IMPORT = "github.com/influxdata/influxdb" |
| 11 | |
| 12 | GO_INSTALL = "\ |
| 13 | ${GO_IMPORT}/cmd/influx \ |
| 14 | ${GO_IMPORT}/cmd/influxd \ |
| 15 | " |
| 16 | |
| 17 | SRC_URI = "\ |
| 18 | git://${GO_IMPORT};protocol=https;branch=1.8;destsuffix=${BPN}-${PV}/src/${GO_IMPORT} \ |
| 19 | file://0001-Use-v2.1.2-xxhash-to-fix-build-with-go-1.17.patch;patchdir=src/${GO_IMPORT} \ |
| 20 | file://influxdb \ |
| 21 | file://influxdb.conf \ |
| 22 | " |
| 23 | |
| 24 | SRC_URI:append:mipsarch = " file://0001-patch-term-module-for-mips-ispeed-ospeed-termios-abs.patch;patchdir=src/${GO_IMPORT}" |
| 25 | |
| 26 | SRCREV = "688e697c51fd5353725da078555adbeff0363d01" |
| 27 | |
| 28 | inherit go-mod pkgconfig systemd update-rc.d useradd |
| 29 | |
| 30 | # Workaround for network access issue during compile step |
| 31 | # this needs to be fixed in the recipes buildsystem to move |
| 32 | # this such that it can be accomplished during do_fetch task |
| 33 | do_compile[network] = "1" |
| 34 | |
| 35 | USERADD_PACKAGES = "${PN}" |
| 36 | USERADD_PARAM:${PN} = "--system -d /var/lib/influxdb -m -s /bin/nologin influxdb" |
| 37 | |
| 38 | do_install:prepend() { |
| 39 | rm ${B}/src/${GO_IMPORT}/build.py |
| 40 | rm ${B}/src/${GO_IMPORT}/build.sh |
| 41 | rm ${B}/src/${GO_IMPORT}/Dockerfile* |
| 42 | sed -i -e "s#usr/bin/sh#bin/sh#g" ${B}/src/${GO_IMPORT}/scripts/ci/run_perftest.sh |
| 43 | } |
| 44 | |
| 45 | do_install:append() { |
| 46 | install -d ${D}${sysconfdir}/influxdb |
| 47 | install -m 0644 ${WORKDIR}/influxdb.conf ${D}${sysconfdir}/influxdb |
| 48 | chown -R root.influxdb ${D}${sysconfdir}/influxdb |
| 49 | |
| 50 | install -d ${D}${sysconfdir}/init.d |
| 51 | install -m 0755 ${WORKDIR}/influxdb ${D}${sysconfdir}/init.d/influxdb |
| 52 | |
| 53 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ] ; then |
| 54 | install -d ${D}${sysconfdir}/logrotate.d |
| 55 | install -m 0644 ${S}/src/${GO_IMPORT}/scripts/logrotate ${D}${sysconfdir}/logrotate.d/influxdb |
| 56 | fi |
| 57 | |
| 58 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ] ; then |
| 59 | install -d ${D}${systemd_unitdir}/system |
| 60 | install -m 0644 ${S}/src/${GO_IMPORT}/scripts/influxdb.service ${D}${systemd_system_unitdir}/influxdb.service |
| 61 | fi |
| 62 | |
| 63 | # TODO chown |
| 64 | } |
| 65 | |
| 66 | INITSCRIPT_PACKAGES = "${PN}" |
| 67 | INITSCRIPT_NAME = "influxdb" |
| 68 | INITSCRIPT_PARAMS = "defaults" |
| 69 | |
| 70 | SYSTEMD_SERVICE:${PN} = "influxdb.service" |