blob: 5301071516056ec98bb8ea20fe61b31a886a450f [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001DESCRIPTION = "InfluxDB is a time series database designed to handle high write and query loads."
2HOMEPAGE = "https://www.influxdata.com/products/influxdb-overview/"
3
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=f39a8d10930fb37bd59adabb3b9d0bd6"
6
7RDEPENDS:${PN} = "bash"
8RDEPENDS:${PN}-dev = "bash"
9
10GO_IMPORT = "github.com/influxdata/influxdb"
11
12GO_INSTALL = "\
13 ${GO_IMPORT}/cmd/influx \
14 ${GO_IMPORT}/cmd/influxd \
15"
16
17SRC_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
24SRC_URI:append:mipsarch = " file://0001-patch-term-module-for-mips-ispeed-ospeed-termios-abs.patch;patchdir=src/${GO_IMPORT}"
25
26SRCREV = "688e697c51fd5353725da078555adbeff0363d01"
27
28inherit go-mod pkgconfig systemd update-rc.d useradd
29
Patrick Williamsb58112e2024-03-07 11:16:36 -060030export GOPROXY = "https://proxy.golang.org,direct"
31
Andrew Geissler595f6302022-01-24 19:11:47 +000032# Workaround for network access issue during compile step
33# this needs to be fixed in the recipes buildsystem to move
34# this such that it can be accomplished during do_fetch task
35do_compile[network] = "1"
36
37USERADD_PACKAGES = "${PN}"
38USERADD_PARAM:${PN} = "--system -d /var/lib/influxdb -m -s /bin/nologin influxdb"
39
40do_install:prepend() {
41 rm ${B}/src/${GO_IMPORT}/build.py
42 rm ${B}/src/${GO_IMPORT}/build.sh
43 rm ${B}/src/${GO_IMPORT}/Dockerfile*
44 sed -i -e "s#usr/bin/sh#bin/sh#g" ${B}/src/${GO_IMPORT}/scripts/ci/run_perftest.sh
45}
46
47do_install:append() {
48 install -d ${D}${sysconfdir}/influxdb
49 install -m 0644 ${WORKDIR}/influxdb.conf ${D}${sysconfdir}/influxdb
Patrick Williams39653562024-03-01 08:54:02 -060050 chown -R root:influxdb ${D}${sysconfdir}/influxdb
Andrew Geissler595f6302022-01-24 19:11:47 +000051
52 install -d ${D}${sysconfdir}/init.d
53 install -m 0755 ${WORKDIR}/influxdb ${D}${sysconfdir}/init.d/influxdb
54
55 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ] ; then
56 install -d ${D}${sysconfdir}/logrotate.d
57 install -m 0644 ${S}/src/${GO_IMPORT}/scripts/logrotate ${D}${sysconfdir}/logrotate.d/influxdb
58 fi
59
60 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ] ; then
61 install -d ${D}${systemd_unitdir}/system
62 install -m 0644 ${S}/src/${GO_IMPORT}/scripts/influxdb.service ${D}${systemd_system_unitdir}/influxdb.service
Patrick Williamsac13d5f2023-11-24 18:59:46 -060063 install -d ${D}${libdir}/influxdb/scripts
64 install -m 0755 ${S}/src/${GO_IMPORT}/scripts/influxd-systemd-start.sh ${D}${libdir}/influxdb/scripts/influxd-systemd-start.sh
Andrew Geissler595f6302022-01-24 19:11:47 +000065 fi
66
67 # TODO chown
68}
69
Patrick Williamsac13d5f2023-11-24 18:59:46 -060070FILES:${PN} += "${libdir}/influxdb/scripts/influxd-systemd-start.sh"
71
Andrew Geissler595f6302022-01-24 19:11:47 +000072INITSCRIPT_PACKAGES = "${PN}"
73INITSCRIPT_NAME = "influxdb"
74INITSCRIPT_PARAMS = "defaults"
75
76SYSTEMD_SERVICE:${PN} = "influxdb.service"