xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-dbs/influxdb/influxdb_1.8.10.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDESCRIPTION = "InfluxDB is a time series database designed to handle high write and query loads."
2*4882a593SmuzhiyunHOMEPAGE = "https://www.influxdata.com/products/influxdb-overview/"
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunLICENSE = "MIT"
5*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=f39a8d10930fb37bd59adabb3b9d0bd6"
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunRDEPENDS:${PN} = "bash"
8*4882a593SmuzhiyunRDEPENDS:${PN}-dev = "bash"
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunGO_IMPORT = "github.com/influxdata/influxdb"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunGO_INSTALL = "\
13*4882a593Smuzhiyun    ${GO_IMPORT}/cmd/influx \
14*4882a593Smuzhiyun    ${GO_IMPORT}/cmd/influxd \
15*4882a593Smuzhiyun"
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunSRC_URI = "\
18*4882a593Smuzhiyun    git://${GO_IMPORT};protocol=https;branch=1.8;destsuffix=${BPN}-${PV}/src/${GO_IMPORT} \
19*4882a593Smuzhiyun    file://0001-Use-v2.1.2-xxhash-to-fix-build-with-go-1.17.patch;patchdir=src/${GO_IMPORT} \
20*4882a593Smuzhiyun    file://influxdb \
21*4882a593Smuzhiyun    file://influxdb.conf \
22*4882a593Smuzhiyun"
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSRC_URI:append:mipsarch = " file://0001-patch-term-module-for-mips-ispeed-ospeed-termios-abs.patch;patchdir=src/${GO_IMPORT}"
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunSRCREV = "688e697c51fd5353725da078555adbeff0363d01"
27*4882a593Smuzhiyun
28*4882a593Smuzhiyuninherit go-mod pkgconfig systemd update-rc.d useradd
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun# Workaround for network access issue during compile step
31*4882a593Smuzhiyun# this needs to be fixed in the recipes buildsystem to move
32*4882a593Smuzhiyun# this such that it can be accomplished during do_fetch task
33*4882a593Smuzhiyundo_compile[network] = "1"
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunUSERADD_PACKAGES = "${PN}"
36*4882a593SmuzhiyunUSERADD_PARAM:${PN} = "--system -d /var/lib/influxdb -m -s /bin/nologin influxdb"
37*4882a593Smuzhiyun
38*4882a593Smuzhiyundo_install:prepend() {
39*4882a593Smuzhiyun    rm ${B}/src/${GO_IMPORT}/build.py
40*4882a593Smuzhiyun    rm ${B}/src/${GO_IMPORT}/build.sh
41*4882a593Smuzhiyun    rm ${B}/src/${GO_IMPORT}/Dockerfile*
42*4882a593Smuzhiyun    sed -i -e "s#usr/bin/sh#bin/sh#g" ${B}/src/${GO_IMPORT}/scripts/ci/run_perftest.sh
43*4882a593Smuzhiyun}
44*4882a593Smuzhiyun
45*4882a593Smuzhiyundo_install:append() {
46*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/influxdb
47*4882a593Smuzhiyun    install -m 0644 ${WORKDIR}/influxdb.conf ${D}${sysconfdir}/influxdb
48*4882a593Smuzhiyun    chown -R root.influxdb ${D}${sysconfdir}/influxdb
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun    install -d ${D}${sysconfdir}/init.d
51*4882a593Smuzhiyun    install -m 0755 ${WORKDIR}/influxdb ${D}${sysconfdir}/init.d/influxdb
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun    if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ] ; then
54*4882a593Smuzhiyun        install -d ${D}${sysconfdir}/logrotate.d
55*4882a593Smuzhiyun        install -m 0644 ${S}/src/${GO_IMPORT}/scripts/logrotate ${D}${sysconfdir}/logrotate.d/influxdb
56*4882a593Smuzhiyun    fi
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun    if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ] ; then
59*4882a593Smuzhiyun        install -d ${D}${systemd_unitdir}/system
60*4882a593Smuzhiyun        install -m 0644 ${S}/src/${GO_IMPORT}/scripts/influxdb.service ${D}${systemd_system_unitdir}/influxdb.service
61*4882a593Smuzhiyun    fi
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun    # TODO chown
64*4882a593Smuzhiyun}
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunINITSCRIPT_PACKAGES = "${PN}"
67*4882a593SmuzhiyunINITSCRIPT_NAME = "influxdb"
68*4882a593SmuzhiyunINITSCRIPT_PARAMS = "defaults"
69*4882a593Smuzhiyun
70*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "influxdb.service"
71