summaryrefslogtreecommitdiffstats
path: root/abs/extra/php-composer/PKGBUILD
blob: 0cd1b13c6c7868269bfa7fd0be77fc76d34ddb8c (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
# $Id$
# Maintainer: Pierre Schmitz <pierre@archlinux.de>

pkgname=php-composer
pkgver=1.0.0.alpha8.532
pkgrel=1
pkgdesc="Dependency Manager for PHP"
arch=('any')
license=('MIT')
url='http://getcomposer.org/'
depends=('php' 'php-intl')
makedepends=('git' "${pkgname}")
checkdepends=('mercurial')
source=("${pkgname}::git+https://github.com/composer/composer.git"
        'php.ini')
md5sums=('SKIP'
         '9d871623bc2ec0a37a7d78f708a7f838')

pkgver() {
	cd ${srcdir}/${pkgname}

	local _tag=$(git tag -l --sort -version:refname | head -1)
	echo "${_tag}.$(git rev-list ${_tag}.. --count)" | sed 's/-/./g'
}

prepare() {
	cd ${srcdir}/${pkgname}

	sed "s~^#!/usr/bin/env php~#!/usr/bin/php -nc/usr/share/${pkgname}/php.ini~g" -i src/Composer/Compiler.php
	/usr/bin/composer -on install
}

check() {
	cd ${srcdir}/${pkgname}

	git config --global user.email "${USER}@${HOST}"
	git config --global user.name "${USER}"
	/usr/bin/php -nc ${srcdir}/php.ini vendor/phpunit/phpunit/phpunit.php
}

build() {
	cd ${srcdir}/${pkgname}

	/usr/bin/php -nc ${srcdir}/php.ini bin/compile
}

package() {
	cd ${srcdir}/${pkgname}

	install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
	install -Dm644 ${srcdir}/php.ini ${pkgdir}/usr/share/php-composer/php.ini
	install -Dm755 composer.phar ${pkgdir}/usr/bin/composer
}