archrelease: copy trunk to community-any
[ArchLinux/community.git] / opensearch-dashboards-notifications-plugin / trunk / PKGBUILD
bloba2b3449dfd74f7516951adc0576b7bc774f475d2
1 # Maintainer: Justin Kromlinger <hashworks@archlinux.org>
3 pkgname='opensearch-dashboards-notifications-plugin'
4 _pluginname='notifications'
5 pkgver=2.6.0.0
6 _dashboardsver=2.6.0
7 pkgrel=1
8 pkgdesc='OpenSearch Dashboards Notifications Plugin'
9 url='https://opensearch.org/docs/latest/notifications-plugin/index/'
10 arch=('x86_64')
11 license=('Apache')
12 depends=("opensearch-dashboards=${_dashboardsver}" 'coffeescript')
13 makedepends=('yarn' 'python' 'git' 'unzip')
14 options=('!strip' 'emptydirs')
15 source=(
16   "git+https://github.com/opensearch-project/${_pluginname}.git#tag=${pkgver}"
17   "git+https://github.com/opensearch-project/OpenSearch-Dashboards.git#tag=${_dashboardsver}"
19 sha256sums=('SKIP'
20             'SKIP')
22 prepare() {
23   nodeVersion="$(node -v)"
24   # Yes, you support this version. You just don't know it yet.
25   sed -i "s/    \"node\": \"[0-9\.]*\",/    \"node\": \"${nodeVersion:1}\",/" \
26     "OpenSearch-Dashboards/package.json"
29 build() {
30   mv "${_pluginname}/dashboards-${_pluginname}" "OpenSearch-Dashboards/plugins/${_pluginname}"
31   cd "OpenSearch-Dashboards/plugins/${_pluginname}"
32   yarn osd bootstrap
33   yarn build # --skip-archive breaks the build
36 check() {
37   cd "OpenSearch-Dashboards/plugins/${_pluginname}"
38   yarn test:jest
41 package() {
42   cd "${_pluginname}"
43   install -Dm644 "LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
45   cd "${srcdir}/OpenSearch-Dashboards/plugins/${_pluginname}/build"
46   unzip "${_pluginname}-dashboards-${pkgver}.zip"
48   install -dm755 "${pkgdir}/usr/share/opensearch-dashboards/plugins/"
50   cp -r "opensearch-dashboards/"* "${pkgdir}/usr/share/opensearch-dashboards/plugins/"
52   find "${pkgdir}/usr/share/opensearch-dashboards/plugins" -type d -empty -delete
55 # vim: ts=2 sw=2 et: