#
# Conditional build:
%bcond_with tests # build with tests
+%bcond_without online # online self-test
+
+%if 0%{?_pld_builder:1}
+%undefine with_online
+%endif
%define php_min_version 5.3.4
-%include /usr/lib/rpm/macros.php
Summary: Dependency Manager for PHP
Name: composer
-Version: 1.7.2
+Version: 1.10.11
Release: 1
License: MIT
Group: Development/Languages/PHP
Source0: https://github.com/composer/composer/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: a136929801355a1c6ee9047ca3f60a3e
+# Source0-md5: 155e49f0c0587ecb6f1a5d9d6e10dac7
Source2: https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer
# Source2-md5: cdeebf0a0da1fd07d0fd886d0461642e
Source3: autoload.php
BuildRequires: php-devel
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.673
-%if %{with tests}
# instead of filling duplicate deps for running tests,
# update composer version that have neccessary runtime dependencies
BuildRequires: composer >= 1.7.0
+%if %{with tests}
BuildRequires: git-core
BuildRequires: phpab
BuildRequires: phpunit >= 4.8
Requires: php-seld-phar-utils >= 1.0.0
Requires: php-symfony2-ClassLoader >= 2.7.7
Requires: php-symfony2-Console >= 2.7.7
+Requires: php-symfony2-Filesystem >= 2.7.7
Requires: php-symfony2-Finder >= 2.7.7
Requires: php-symfony2-Process >= 2.7.7
+Requires: unzip
Suggests: bash-completion-%{name}
Suggests: git-core
Suggests: mercurial
find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
%build
+%if %{with online}
+# always run self-test
+%{__php} ./bin/composer diagnose
+%endif
+
%if %{with tests}
phpab -n -o src/bootstrap.php -e '*/Fixtures/*' src/ tests/
echo "require 'src/Composer/autoload.php';" >> src/bootstrap.php