3 %bcond_without tests # build with tests
6 # - release tarballs: http://getcomposer.org/download/
8 %define php_min_version 5.3.4
9 %include /usr/lib/rpm/macros.php
10 Summary: Dependency Manager for PHP
15 Group: Development/Languages/PHP
16 Source0: https://github.com/composer/composer/archive/%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5: 41aa154b863ad1ddb4e261da5b12416d
18 Source2: https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer
19 # Source2-md5: cdeebf0a0da1fd07d0fd886d0461642e
21 Patch0: autoload.patch
22 Patch1: update-memory-limit.patch
23 Patch2: svn-ignore-externals.patch
24 Patch3: ca-certs.patch
25 URL: http://www.getcomposer.org/
26 BuildRequires: php-devel
27 BuildRequires: rpm-php-pearprov >= 4.4.2-11
28 BuildRequires: rpmbuild(macros) >= 1.673
30 BuildRequires: composer >= 1.0.1-2
31 BuildRequires: git-core
33 BuildRequires: phpunit
35 Requires: ca-certificates >= 20141019-3
36 Requires: php(core) >= %{php_min_version}
42 Requires: php(openssl)
46 Requires: php(simplexml)
50 Requires: php-composer-semver >= 1.0.0
51 Requires: php-composer-spdx-licenses >= 1.0.0
52 Requires: php-justinrainbow-json-schema >= 1.6
53 Requires: php-seld-cli-prompt >= 1.0.0
54 Requires: php-seld-jsonlint >= 1.4
55 Requires: php-seld-phar-utils >= 1.0.0
56 Requires: php-symfony2-ClassLoader >= 2.7.7
57 Requires: php-symfony2-Console >= 2.7.7
58 Requires: php-symfony2-Finder >= 2.7.7
59 Requires: php-symfony2-Process >= 2.7.7
60 Suggests: bash-completion-%{name}
64 Conflicts: satis < 1.0.0-1.alpha1.193
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 Composer is a tool for dependency management in PHP.
71 Composer helps you declare, manage and install dependencies of PHP
72 projects, ensuring you have the right stack everywhere.
74 %package -n bash-completion-%{name}
75 Summary: Bash completion for Composer
76 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Composera
77 Group: Applications/Shells
79 Requires: bash-completion >= 2.0
81 %description -n bash-completion-%{name}
82 Bash completion for Composer package and dependency manager.
84 %description -n bash-completion-%{name} -l pl.UTF-8
85 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera.
94 mv composer.lock{,.disabled}
95 # NOTE: do not use %{__php} macro here, need unversioned php binary
96 %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' bin/*
98 cp -p %{SOURCE3} src/Composer/autoload.php
100 # AutoloadGenerator needs this runtime
106 # move to Composer dir, this will simplify testing
108 ln -s src/Composer/res
110 # cleanup backups after patching
111 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
113 # needs newer phpunit:
114 # missing method PHPUnit_Framework_MockObject_Builder_InvocationMocker::willReturn()
115 rm tests/Composer/Test/ApplicationTest.php
116 rm tests/Composer/Test/EventDispatcher/EventDispatcherTest.php
117 rm tests/Composer/Test/IO/ConsoleIOTest.php
118 rm tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php
119 rm tests/Composer/Test/Package/RootAliasPackageTest.php
120 rm tests/Composer/Test/Package/Version/VersionGuesserTest.php
121 rm tests/Composer/Test/Util/GitHubTest.php
122 rm tests/Composer/Test/Util/GitLabTest.php
123 # method PHPUnit_Framework_MockObject_Builder_InvocationMocker::withConsecutive()
124 rm tests/Composer/Test/Util/BitbucketTest.php
125 # Call to undefined method Composer\Test\Repository\Vcs\GitLabDriverTest::prophesize()
126 rm tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php
130 phpab -n -o src/bootstrap.php -e '*/Fixtures/*' src/ tests/
131 echo "require 'src/Composer/autoload.php';" >> src/bootstrap.php
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer,/var/cache/composer}
138 cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir}
139 install -p bin/composer $RPM_BUILD_ROOT%{_bindir}/%{name}
141 install -d $RPM_BUILD_ROOT%{bash_compdir}
142 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{bash_compdir}/composer
145 rm -rf $RPM_BUILD_ROOT
148 %defattr(644,root,root,755)
149 %doc README.md CHANGELOG.md PORTING_INFO
150 %doc src/Composer/res/LICENSE
151 %attr(755,root,root) %{_bindir}/composer
152 %{php_data_dir}/Composer
154 # top level cachedir, create user cache dirs here manually
155 %dir %attr(711,root,http) /var/cache/composer
157 %files -n bash-completion-%{name}
158 %defattr(644,root,root,755)
159 %{bash_compdir}/composer