archrelease: copy trunk to community-any
[ArchLinux/community.git] / opensearch-dashboards / trunk / PKGBUILD
blobb8f7839063350b13680cd2ab35ced7a953fb3f74
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
2 # Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 # Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
4 # Contributor: Spider.007 <archlinux AT spider007 DOT net>
6 pkgname=opensearch-dashboards
7 pkgver=2.6.0
8 pkgrel=1
9 pkgdesc='Open source visualization dashboards for OpenSearch'
10 url='https://opensearch.org/docs/dashboards/index/'
11 arch=('x86_64')
12 license=('Apache')
13 depends=('nodejs-lts-fermium')
14 optdepends=(
15   'opensearch'
16   'opensearch-dashboards-alerting-plugin'
17   'opensearch-dashboards-anomaly-detection-plugin'
18   'opensearch-dashboards-gantt-chart-plugin'
19   'opensearch-dashboards-maps-plugin'
20   'opensearch-dashboards-notifications-plugin'
21   'opensearch-dashboards-index-management-plugin'
22   'opensearch-dashboards-observability-plugin'
23   'opensearch-dashboards-query-workbench-plugin'
24   'opensearch-dashboards-reports-plugin'
25   'opensearch-dashboards-security-plugin'
27 makedepends=('yarn' 'git' 'python')
28 backup=('etc/opensearch-dashboards/opensearch_dashboards.yml')
29 options=('!strip' 'emptydirs')
30 source=(
31   "git+https://github.com/opensearch-project/OpenSearch-Dashboards.git#tag=${pkgver}"
32   opensearch-dashboards
33   opensearch-dashboards-keystore
34   opensearch-dashboards-plugin
35   opensearch-dashboards.service
36   tmpfile.conf
37   user.conf
39 sha512sums=('SKIP'
40             'c404c8f576ccc5d9202b6808eaf0ec4a1545eec63480ea5189f0f5b66f3e22f431090ece3e7488f6e7d20472e55e784110d4d393bef94ad959c8ee0665290d36'
41             '55bb1b7e86bafb9938b787c973aab318848bdb7a498d547948d58ee06fc8b96f9a184d6c00a9f1e7accb5caf64992b0db86cf4b31b0d0eb66c8a88f09b609d3e'
42             'bd3bb6a1d64b80bc0a5a5d73ccce7689b8aaf035262424414de404083085ae8e482770f62e5d8219313adeecd65003b7ce1bbe8943418dbd6a432e739e124493'
43             'bec175171d7ce2d9769b4247931f13e73713f6f6f5eba1c1c184c450e694ae52e54d16e79853331df5fa6b50ebc42e1408cf022dbb8e025526c9be783dfca5c2'
44             'ee7a82eb8b5a719913250159485b144ab94219e64f09a73210bd4cf82345e4f7d1b594e6e8d67aca7faaf6087a672bec478f19ce1493ca64d42e6c39f6b586b8'
45             '51cef07f4f4cdd467aa4a2665ee8aaa870ea8f11449f4be1cb239826292ee4044cc656204ab8836730ac1555387ddb20c2cfb9a50ba70f5c5fe59c271a332ab4')
47 prepare() {
48   cd "OpenSearch-Dashboards"
50   nodeVersion="$(node -v)"
51   # Yes, you support this version. You just don't know it yet.
52   sed -i "s/    \"node\": \"[0-9\.]*\",/    \"node\": \"${nodeVersion:1}\",/" "package.json"
54   # Don't check the nodejs version for now until https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1189
55   sed -i "/^require('.\/node_version_validator');$/d" src/setup_node_env/no_transpilation.js
57   # set default quiet mode for systemd, cli option forces specified values
58   sed -r 's|#(logging.quiet:) false|\1 true|' -i config/opensearch_dashboards.yml
61 build() {
62   cd "OpenSearch-Dashboards"
64   yarn osd bootstrap
65   yarn build --skip-os-packages
67   # TODO: How to tell yarn that we don't want to create a SNAPSHOT version?
68   sed -i "s/  \"version\": \"${pkgver}-SNAPSHOT\",/  \"version\": \"${pkgver}\",/" "build/opensearch-dashboards/package.json"
71 package() {
72   cd "OpenSearch-Dashboards/build/opensearch-dashboards"
74   install -dm755 "${pkgdir}"/{usr/share,var/lib,etc}/opensearch-dashboards
76   ln -s /etc/opensearch-dashboards "${pkgdir}/usr/share/opensearch-dashboards/config"
77   ln -s /var/lib/opensearch-dashboards "${pkgdir}/usr/share/opensearch-dashboards/data"
78   rm -Rf data
80   install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
81   install -Dm644 NOTICE.txt "${pkgdir}/usr/share/licenses/${pkgname}/NOTICE.txt"
82   install -Dm644 README.txt "${pkgdir}/usr/share/doc/${pkgname}/README.txt"
83   rm ./*.txt
85   install -Dm 640 config/opensearch_dashboards.yml -t "${pkgdir}/etc/opensearch-dashboards"
86   install -Dm 640 config/node.options -t "${pkgdir}/etc/opensearch-dashboards"
87   rm -Rf config
89   rm -Rf bin
90   install -dm 755 "${pkgdir}/usr/bin"
91   install -Dm 755 "${srcdir}/opensearch-dashboards" -t "${pkgdir}/usr/bin"
92   install -Dm 755 "${srcdir}/opensearch-dashboards-keystore" -t "${pkgdir}/usr/bin"
93   install -Dm 755 "${srcdir}/opensearch-dashboards-plugin" -t "${pkgdir}/usr/bin"
95   install -dm 755 "${pkgdir}/usr/share/opensearch-dashboards"
96   cp -a ./* "${pkgdir}/usr/share/opensearch-dashboards"
98   install -Dm 644 "${srcdir}/opensearch-dashboards.service" -t "${pkgdir}/usr/lib/systemd/system"
99   install -Dm 644 "${srcdir}/user.conf" "${pkgdir}/usr/lib/sysusers.d/opensearch-dashboards.conf"
100   install -Dm 644 "${srcdir}/tmpfile.conf" "${pkgdir}/usr/lib/tmpfiles.d/opensearch-dashboards.conf"
103 # vim: ts=2 sw=2 et: