summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e039ba79eb3f632dff07a7d1b759419f6d113ef0 (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
# Maintainer: Frédéric Potvin <frederic.potvin@platform.sh>

pkgname=platformsh-cli-git
_pkgname=${pkgname%-git}
pkgver=3.30.1
pkgrel=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' 'php-box')
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
}

build() {
  cd "$_pkgname"

  php -d phar.readonly=Off /usr/bin/php-box build
}

check() {
  cd "$_pkgname"

  php -d phar.readonly=Off /usr/bin/php-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"
}