summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 09ffe72e390faf0e90b793f9e56fa24300a6570d (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
47
48
49
50
51
52
53
# Maintainer: Frédéric Potvin <frederic.potvin@platform.sh>

pkgname=platformsh-cli-git
_pkgname=${pkgname%-git}
pkgver=a47308373d4f5ba1a0be83607c2c22efa0124ae00e8925e1bb16abd497f9878d
pkgrel=3.42.1
pkgdesc="The unified tool for managing your Platform.sh services from the command line."
arch=('any')
url="https://github.com/platformsh/$_pkgname"
license=('MIT')
depends=('git' 'php' 'composer')
optdepends=('drush')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname"::"git+$url.git#branch=master")
md5sums=('SKIP')

pkgver() {
    cd "$_pkgname"
    (
        set -o pipefail
        git describe --long --tag | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' ||
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

prepare() {
  cd "$_pkgname"

  composer install
  composer bin all install
}

build() {
  cd "$_pkgname"

  ./bin/platform self:build --yes
}

check() {
  cd "$_pkgname"

  ./vendor/bin/box verify platform.phar
}

package() {
  cd "$_pkgname"

  mkdir -p ~/.platformsh
  install -Dm755 platform.phar "$pkgdir/usr/share/webapps/platform/platform.phar"
  install -dm755 "$pkgdir/usr/bin"
  ln -s /usr/share/webapps/platform/platform.phar "$pkgdir/usr/bin/platform"
}