Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [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=ba8146ad9cc2a128209983265136e06a" |
| 6 | |
| 7 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
| 8 | |
| 9 | RDEPENDS_${PN} = "bash" |
| 10 | RDEPENDS_${PN}-dev = "bash" |
| 11 | |
| 12 | GO_IMPORT = "github.com/influxdata/influxdb" |
| 13 | |
| 14 | GO_INSTALL = "\ |
| 15 | ${GO_IMPORT}/cmd/influx \ |
| 16 | ${GO_IMPORT}/cmd/influxd \ |
| 17 | " |
| 18 | |
| 19 | SRC_URI = "\ |
| 20 | git://${GO_IMPORT};protocol=https;branch=1.7;destsuffix=${BPN}-${PV}/src/${GO_IMPORT} \ |
| 21 | file://influxdb \ |
| 22 | file://influxdb.conf \ |
| 23 | " |
| 24 | |
| 25 | SRC_URI_append_mipsarch = " file://0001-patch-term-module-for-mips-ispeed-ospeed-termios-abs.patch;patchdir=src/${GO_IMPORT}" |
| 26 | |
| 27 | SRCREV = "c958f436b2e538a88a7815aad721c7774a0b8f63" |
| 28 | |
| 29 | inherit go-mod systemd update-rc.d useradd |
| 30 | |
| 31 | USERADD_PACKAGES = "${PN}" |
| 32 | USERADD_PARAM_${PN} = "--system -d /var/lib/influxdb -m -s /bin/nologin influxdb" |
| 33 | |
| 34 | do_install_prepend() { |
| 35 | rm ${B}/src/${GO_IMPORT}/build.py |
| 36 | rm ${B}/src/${GO_IMPORT}/build.sh |
| 37 | rm ${B}/src/${GO_IMPORT}/Dockerfile* |
| 38 | } |
| 39 | |
| 40 | do_install_append() { |
| 41 | install -d ${D}${sysconfdir}/influxdb |
| 42 | install -m 0644 ${WORKDIR}/influxdb.conf ${D}${sysconfdir}/influxdb |
| 43 | chown -R root.influxdb ${D}${sysconfdir}/influxdb |
| 44 | |
| 45 | install -d ${D}${sysconfdir}/init.d |
| 46 | install -m 0755 ${WORKDIR}/influxdb ${D}${sysconfdir}/init.d/influxdb |
| 47 | |
| 48 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ] ; then |
| 49 | install -d ${D}${sysconfdir}/logrotate.d |
| 50 | install -m 0644 ${S}/src/${GO_IMPORT}/scripts/logrotate ${D}${sysconfdir}/logrotate.d/influxdb |
| 51 | fi |
| 52 | |
| 53 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ] ; then |
| 54 | install -d ${D}${systemd_unitdir}/system |
| 55 | install -m 0644 ${S}/src/${GO_IMPORT}/scripts/influxdb.service ${D}${systemd_system_unitdir}/influxdb.service |
| 56 | fi |
| 57 | |
| 58 | # TODO chown |
| 59 | } |
| 60 | |
| 61 | INITSCRIPT_PACKAGES = "${PN}" |
| 62 | INITSCRIPT_NAME = "influxdb" |
| 63 | INITSCRIPT_PARAMS = "defaults" |
| 64 | |
| 65 | SYSTEMD_SERVICE_${PN} = "influxdb.service" |