Skip to content

Instantly share code, notes, and snippets.

@ProBackup-nl

ProBackup-nl/PKGBUILD

Last active Feb 12, 2021
Embed
What would you like to do?
Influxdb2-bin package for Arch
## arg 1: the new package version
post_install() {
echo '----------------------------------------------------------------------'
echo 'Arch style is that users manually start installed services. So, issue:'
echo '$ sudo systemctl enable influxdb.service'
echo '$ sudo systemctl start influxdb.service'
echo 'And point your browser to http://(local)host:8086'
echo 'storage-engine path=/var/lib/influxdb/.influxdbv2'
echo '----------------------------------------------------------------------'
}
# https://raw.githubusercontent.com/influxdata/influxdb/279bf1bf13bb391ac5635bbcccfe8d7524dadb92/scripts/influxdb.service
[Unit]
Description=InfluxDB 2.x is an open-source, distributed, time series database
Documentation=https://v2.docs.influxdata.com/v2.0/get-started/
After=network-online.target
[Service]
User=influxdb
Group=influxdb
LimitNOFILE=65536
#ExecStart=
ExecStart=/usr/bin/influxd --reporting-disabled
KillMode=control-group
Restart=on-failure
#TimeoutStopSec=infinity
#TimeoutStartSec=infinity
[Install]
WantedBy=multi-user.target
Alias=influxd.service
u influxdb - - /var/lib/influxdb
g influxdb - -
d /var/lib/influxdb 0755 influxdb influxdb
d /var/log/influxdb 0755 influxdb influxdb
d /etc/influxdb 0755 influxdb influxdb
x /var/lib/influxdb/*
x /var/log/influxdb/*
x /etc/influxdb/*
# Maintainer: Ceriel Jacobs <2010 at probackup dot nl>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
pkgname=influxdb2-bin
pkgver=2.0.3
pkgrel=1
pkgdesc='Scalable datastore for metrics, events, and real-time analytics; Binary release;'
arch=('x86_64' 'aarch64')
url="https://github.com/InfluxData/influxdb"
license=('MIT')
depends=('glibc')
conflicts=('influxdb' 'influxdb-bin')
#backup=('etc/influxdb/config.toml' 'var/lib/influxdb/influxd.bolt')
install=influxdb.install
# see https://portal.influxdata.com/downloads/
source_x86_64=("https://dl.influxdata.com/influxdb/releases/influxdb2-${pkgver}_linux_amd64.tar.gz")
sha256sums_x86_64=('d01f0b6d634406e0be1829f884ebf93423cc0c920743fa293a03b1533ffac4af')
source_aarch64=("https://dl.influxdata.com/influxdb/releases/influxdb2-${pkgver}_linux_arm64.tar.gz")
sha256sums_aarch64=('0c67b0282cefc9b1052633008f5713d24f6d18f669d8f92abb2004e2541947b4')
source=('influxdb.sysusers' 'influxdb.tmpfiles' 'influxdb.service.d')
sha256sums=('5266afa264a210102ade9e777f9258baa38dcc500707b822a31b9a7e2e029439' \
'4be469656e630e9ab49653f3a7b51062712cf6fe892d76bf645f7e6feb4502ed' \
'f71a1780f3b21b638f08e556cb9410d1b8cc2aaafcdd2d340954ed8ba0809cd8')
package() {
# users and groups
install -Dm644 influxdb.sysusers "$pkgdir/usr/lib/sysusers.d/influxdb.conf"
# directories and files
install -Dm644 influxdb.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/influxdb.conf"
# systemd
install -Dm644 influxdb.service.d "$pkgdir/usr/lib/systemd/system/influxdb.service"
# binaries
if [[ $CARCH = 'aarch64' ]]; then
cd "$srcdir/influxdb2-${pkgver}_linux_arm64"
elif [[ $CARCH == 'x86_64' ]]; then
cd "$srcdir/influxdb2-${pkgver}_linux_amd64"
fi
install -d "${pkgdir}/usr/bin/"
install -Dm755 influx "${pkgdir}/usr/bin/influx"
install -Dm755 influxd "${pkgdir}/usr/bin/influxd"
# text files
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
# ToDos?
#install -Dm644 etc/logrotate.d/influxdb "$pkgdir/etc/logrotate.d/influxdb"
#sudo cp /root/.influxdbv2/configs /var/lib/influxdb
#sudo chown influxdb:influxdb /var/lib/influxdb/influxd.bolt /var/lib/influxdb/configs
#sudo chown -R influxdb:influxdb /var/lib/influxdb/engine
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment