|
| 1 | +pkgname="dremio-bin" |
| 2 | +gives="dremio" |
| 3 | +pkgver="4.9.1" |
| 4 | +fullver="4.9.1-202010230218060541-2e764ed0" |
| 5 | +depends=("openjdk-8-jdk") |
| 6 | +url="https://www.dremio.com/" |
| 7 | +pkgdesc="Dremio: Data Lakehouse Platform Powered by Apache Iceberg" |
| 8 | +maintainer=("Luca Fabbian < [email protected]>") |
| 9 | +arch=('amd64') |
| 10 | +sha256sums_amd64=("ccd0ac89c9d3dc13eee8eba0f3f489b3f9efc7a897c1c550d919fcc294c749f9") |
| 11 | +source_amd64=("https://download.dremio.com/community-server/${fullver}/dremio-community-${fullver}.tar.gz") |
| 12 | + |
| 13 | +package() { |
| 14 | + cd "${_archive}" |
| 15 | + |
| 16 | + mkdir -p "${pkgdir}/opt/${pkgname}" |
| 17 | + mv -- * "${pkgdir}/opt/${pkgname}" |
| 18 | + |
| 19 | + mkdir -p "${pkgdir}/usr/bin" |
| 20 | + |
| 21 | + # shellcheck disable=SC2016 |
| 22 | + echo '#!/bin/bash |
| 23 | +# Set the JAVA_HOME for this script |
| 24 | +export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 |
| 25 | +export PATH=$JAVA_HOME/bin:$PATH |
| 26 | + |
| 27 | +# Forward execution to dremio script |
| 28 | +bash "/opt/'"${pkgname}"'/bin/dremio" "$@"' | tee "${pkgdir}/usr/bin/dremio" > /dev/null |
| 29 | + chmod +x "${pkgdir}/usr/bin/dremio" |
| 30 | + |
| 31 | + mkdir -p "${pkgdir}/lib/systemd/system" |
| 32 | + |
| 33 | + echo '[Unit] |
| 34 | +Description=Dremio Daemon Server |
| 35 | +Documentation=https://docs.dremio.com |
| 36 | +Wants=network-online.target |
| 37 | +After=network-online.target |
| 38 | + |
| 39 | +[Service] |
| 40 | +User=root |
| 41 | +Group=root |
| 42 | +ExecStart=/usr/bin/dremio start-fg |
| 43 | +Restart=on-failure |
| 44 | +LimitNOFILE=65536 |
| 45 | + |
| 46 | + |
| 47 | +[Install] |
| 48 | +WantedBy=multi-user.target' | tee "${pkgdir}/lib/systemd/system/dremio.service" > /dev/null |
| 49 | + |
| 50 | +} |
| 51 | + |
| 52 | +post_install() { |
| 53 | + if [[ -f /bin/systemctl ]]; then |
| 54 | + sudo systemctl enable dremio.service --now |
| 55 | + fi |
| 56 | +} |
| 57 | + |
| 58 | +post_remove() { |
| 59 | + if [[ -f /bin/systemctl ]]; then |
| 60 | + sudo rm "/etc/systemd/system/multi-user.target.wants/dremio.service" && echo "Removed /etc/systemd/system/multi-user.target.wants/dremio.service" |
| 61 | + fi |
| 62 | +} |
0 commit comments