summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02b3bea3b3d6ef1727dd83a87e7fd4859b1d38bd (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
# Maintainer: Senya <senya at riseup.net>
pkgname=crowdin-cli
pkgver=3.5.4
pkgrel=1
pkgdesc="Command line tool that allows you to manage and synchronize localization resources with your Crowdin project"
url="https://support.crowdin.com/cli-tool/"
license=('MIT')
depends=('java-runtime>=8')
makedepends=('git' 'java-environment>=8' 'gradle' 'grep' 'awk')
conflicts=('crowdin-cli-bin')
arch=('any')
md5sums=('SKIP' 'b018bcf51df64a8e68450cd7ac0e3838')

source=(
  "git+https://github.com/crowdin/crowdin-cli.git#tag=$pkgver"
  'crowdin'
)

build() {
  cd "$srcdir/$pkgname"
  gradle shadowJar
  gradle properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}' > _pkgBuildVersion
  java -cp "build/libs/crowdin-cli-$(cat _pkgBuildVersion).jar" picocli.AutoComplete --force com.crowdin.cli.commands.picocli.RootCommand
}

package()
{
  cd "$srcdir"
  install -Dm 0644 "$srcdir/$pkgname"/build/libs/crowdin-cli-$(cat "$srcdir/$pkgname"/_pkgBuildVersion).jar "$pkgdir"/usr/share/java/$pkgname/crowdin-cli.jar
  install -Dm 0755 "$startdir"/crowdin "$pkgdir"/usr/bin/crowdin
  install -Dm 0644 "$srcdir/$pkgname"/crowdin_completion "$pkgdir"/usr/share/bash-completion/completions/crowdin
}