summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a3f312b17631e9df9c1c690068bc02937701c8d3 (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
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: James An <james@jamesan.ca>

pkgname=terminus-git
_pkgname=${pkgname%-git}
pkgver=1.7.2_dev
pkgrel=1
pkgdesc="The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform https://pantheon.io"
arch=('any')
url="https://github.com/pantheon-systems/$_pkgname"
license=('MIT')
depends=('php' 'composer' 'git')
optdepends=('drush: Useful to run incompatible-with-Terminus Drush commands'
            'wp-cli: Useful to run incompatible-with-Terminus WP-CLI commands')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname"::"git+https://github.com/pantheon-systems/$_pkgname.git")
md5sums=('SKIP')

pkgver() {
  cd "$_pkgname"

  grep TERMINUS_VERSION config/constants.yml | cut -f2 -d\' | tr '-' '_'
}

prepare() {
  cd "$_pkgname"

  composer install --no-interaction --no-dev --prefer-dist
}

check() {
  cd "$_pkgname"

  scripts/test.sh
}

package() {
  cd "$_pkgname"

  install -Dm644 LICENSE.txt "$pkgdir/usr/share/license/$pkgname/LICENSE"

  install -d -m755 "$pkgdir/usr/share/webapps/$pkgname"
  cp -at "$pkgdir/usr/share/webapps/$pkgname" assets bin composer.json composer.lock config src templates vendor
  install -d -m755 "$pkgdir/usr/bin"
  ln --symbolic "/usr/share/webapps/$pkgname/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
}