# Maintainer: Pierre Schmitz pkgname=composer pkgver=2.5.5 pkgrel=1 pkgdesc="Dependency Manager for PHP" arch=('any') license=('MIT') url='https://getcomposer.org/' depends=('php' 'unzip') makedepends=('git') source=("${pkgname}::git+https://github.com/composer/composer.git#tag=${pkgver}" "${pkgname}-${pkgver}.phar::https://getcomposer.org/download/${pkgver}/composer.phar") sha256sums=('SKIP' '566a6d1cf4be1cc3ac882d2a2a13817ffae54e60f5aa7c9137434810a5809ffc') prepare() { cd "${srcdir}/${pkgname}" php "${srcdir}/${pkgname}-${pkgver}.phar" install --no-interaction --no-dev --no-progress --prefer-dist } build() { cd "${srcdir}/${pkgname}" php -d phar.readonly=Off bin/compile php composer.phar completion bash > completion.bash } check() { cd "${srcdir}" mkdir integration-test cd integration-test php "${srcdir}/${pkgname}/composer.phar" init \ --no-interaction \ --type=project \ --name='archlinux/test' \ --description='Composer Test Project' \ --license='GPL-3.0-or-later' \ --require='symfony/console:*' php "${srcdir}/${pkgname}/composer.phar" update --no-interaction --no-progress --prefer-dist php "${srcdir}/${pkgname}/composer.phar" validate --no-interaction } package() { cd "${srcdir}/${pkgname}" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -Dm755 composer.phar "${pkgdir}/usr/bin/composer" install -Dm644 completion.bash "${pkgdir}/usr/share/bash-completion/completions/composer" }