summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10eecfcbe1e1cb4c3f79e933cfe3b2aedb6a7d9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Contributor: Johannes Dewender  arch at JonnyJD dot net
# Contributor: Vlad M. <vlad@archlinux.net>
# Contributor: Timofey Titovets <nefelim4ag@gmail.com>

pkgname=elasticdump
pkgver=6.2.2
pkgrel=1
pkgdesc="Import and export tools for Elasticsearch"
arch=(any)
url="https://github.com/taskrabbit/elasticsearch-dump"
license=("Apache")
depends=('nodejs>=8.0')
makedepends=('npm')
source=("http://registry.npmjs.org/${pkgname}/-/${pkgname}-${pkgver}.tgz")
sha256sums=('04ab7525b4b5e104ff37b1771483705e13b46c97a98c064d6cfada5a4829cedd')
noextract=("$pkgname-$pkgver.tgz")

package() {
  npm install -g --user root --prefix "${pkgdir}/usr" "$srcdir/$pkgname-$pkgver.tgz"

  BASE_PATH="${pkgdir}/usr/lib/node_modules/elasticdump"
  TRASH=(
    "$BASE_PATH"/.{idea,github}
    "$BASE_PATH"/node_modules/lossless-json/.idea
    "$BASE_PATH"/node_modules/aws-sdk/.changes
  )

  # Cleanup
  for path in "${TRASH[@]}"; do
      [ -d "$path" ] && rm -r "$path"
  done

  find "$BASE_PATH" -type f -name ".*" -delete
  find "$BASE_PATH" -empty -delete
}