summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Auditor2015-12-21 10:31:33 +0100
committerStefan Auditor2015-12-21 10:31:33 +0100
commit52976f4fd9082d750e321d67118bf738ad0b7031 (patch)
treec13a49405e3e201c2cb64957f751f1fec864578d
parent02f2d43e777a41ba17ec125692b418afda5d005f (diff)
downloadaur-52976f4fd9082d750e321d67118bf738ad0b7031.tar.gz
Move runtime dependency check to function
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD10
-rw-r--r--php-cs-fixer.install12
3 files changed, 10 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6baaaeb1ed50..d22ba49496ac 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,10 @@
+# Generated by mksrcinfo v8
+# Mon Dec 21 09:30:46 UTC 2015
pkgbase = php-cs-fixer
pkgdesc = Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible).
pkgver = 1.11
pkgrel = 1
url = http://cs.sensiolabs.org/
- install = php-cs-fixer.install
arch = any
license = MIT
makedepends = php-box
diff --git a/PKGBUILD b/PKGBUILD
index 281b834412a7..90c53d0a8342 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,17 +11,23 @@ license="MIT"
arch=("any")
depends=("php>=5.3.6")
makedepends=("php-box" "php-composer")
-install="${pkgname}.install"
source=("https://github.com/FriendsOfPHP/${_pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('337eeb18b9d6ab41fda772bb3372467a6093a153f336f804b2d2ca1b4631e1ea99fdc2ac690780003e911da4a24942052fd00d1daa0129abe10d459f93b9c1d4')
build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
- composer install --prefer-dist --no-dev
+ php -d extension=phar.so /usr/bin/composer install --prefer-dist --no-dev
sed -i '/git-commit/d' box.json
php -d extension=phar.so -d phar.readonly=Off -d display_errors=Off /usr/bin/php-box build
}
+check() {
+ if ! php -i | grep 'PHP Archive support => enabled' >/dev/null 2>&1; then
+ echo -e "\e[1;31m Warning: phar.so must be loaded in your php.ini to install and use ${pkgname}\e[0m"
+ exit 1
+ fi
+}
+
package() {
cd "${srcdir}/${_pkgname}-${pkgver}"
install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
diff --git a/php-cs-fixer.install b/php-cs-fixer.install
deleted file mode 100644
index b20eb913cdd7..000000000000
--- a/php-cs-fixer.install
+++ /dev/null
@@ -1,12 +0,0 @@
-post_install() {
- if ! php -i | grep 'PHP Archive support => enabled' >/dev/null 2>&1; then
- echo
- echo "Error: phar.so must be enabled in your php.ini"
- echo
- exit 1
- fi
-}
-
-post_upgrade() {
- post_install
-}