summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d44275dbb9536355f57dce834eee241930b6e92 (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
# Maintainer: James An <james@jamesan.ca>

pkgname=drush-launcher-git
_pkgname=${pkgname%-git}
__pkgname=${_pkgname%-launcher}
pkgver=0.5.1.r1.gace4b71
pkgrel=1
pkgdesc='A small wrapper around Drush for your global $PATH.'
arch=('any')
url="https://github.com/drush-ops/drush-launcher"
license=('GPL')
depends=('php-composer')
makedepends=('git' 'php-box')
provides=("$__pkgname" "$_pkgname=$pkgver")
conflicts=("$__pkgname" "$_pkgname")
source=("$_pkgname"::"git+https://github.com/$__pkgname-ops/$_pkgname.git")
md5sums=('SKIP')

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

prepare() {
  cd "$_pkgname"

  composer --no-interaction install --prefer-source
}

build() {
  cd "$_pkgname"

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

package() {
  cd "$_pkgname"

  install -Dm755 "$__pkgname.phar" "$pkgdir/usr/bin/$__pkgname"
}