aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0d591f2a71a3f3ba55cfa8ec52c03dd7ccdc10f8 (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: monotonee <monotonee at tuta dot io>
# Note that the decision to use "latest" as pkgver was made based on the
# PKGBUILD of aurvote-git and negates the necessity of manual updates.
pkgname='php-box-git'
_vcsRepoDir='box2'
pkgver='latest'
pkgrel=1
pkgdesc='An application for building and managing phars.'
arch=('any')
url='http://box-project.org/'
license=('MIT')
depends=('php>=5.3.3')
makedepends=('git' 'php-composer')
conflicts=('php-box')
provides=('box')
source=($_vcsRepoDir'::git+https://github.com/box-project/box2.git')
md5sums=('SKIP')

pkgver() {
  cd $_vcsRepoDir
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $_vcsRepoDir
  composer install --no-interaction
}

build() {
  cd $_vcsRepoDir
  bin/box build --no-interaction
}

check() {
  cd $_vcsRepoDir
  _pharName='box-'$(git describe --tags)'.phar'
  echo 'Verifying built PHAR: '$(bin/box verify $_pharName)
  echo 'Checking built PHAR version: '$(./$_pharName --version)
}

package() {
  cd $_vcsRepoDir
  _pharName='box-'$(git describe --tags)'.phar'
  install -D -m755 $_pharName $pkgdir/usr/bin/${provides[0]}
  install -D -m644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}