3 # - release tarballs: http://getcomposer.org/download/
6 %bcond_with bootstrap # build boostrap
8 %define php_min_version 5.3.4
9 %define githash 46e5554
12 %include /usr/lib/rpm/macros.php
13 Summary: Dependency Manager for PHP
16 Release: 0.%{subver}.%{rel}
18 Group: Development/Languages/PHP
19 Source0: https://github.com/composer/composer/archive/%{githash}/%{name}-%{version}-%{githash}.tar.gz
20 # Source0-md5: 8d3be5df3a0151b87b77806b75cfcf9d
21 Source1: http://getcomposer.org/download/%{version}-%{subver}/%{name}.phar
22 # Source1-md5: f9b1dbd4ad0e3707bfe216690b210a7e
24 Patch1: no-bundle-symfony.patch
25 Patch2: system-symfony.patch
26 URL: http://www.getcomposer.org/
27 BuildRequires: /usr/bin/php
28 BuildRequires: php(ctype)
29 BuildRequires: php(hash)
30 BuildRequires: php(json)
31 BuildRequires: php(openssl)
32 BuildRequires: php(phar)
33 BuildRequires: php(zip)
34 BuildRequires: rpm-php-pearprov >= 4.4.2-11
35 BuildRequires: rpmbuild(macros) >= 1.461
36 %if %{without bootstrap}
37 BuildRequires: %{name}
39 Requires: php(core) >= %{php_min_version}
42 Requires: php-symfony2-Console >= 2.1
43 Requires: php-symfony2-Finder >= 2.1
44 Requires: php-symfony2-Process >= 2.1
47 Suggests: php(openssl)
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 %define _appdir %{_datadir}/%{name}
56 Composer is a tool for dependency management in PHP. It allows you to
57 declare the dependent libraries your project needs and it will install
58 them in your project for you.
61 %setup -qc -n %{name}-%{version}-%{release}
66 mv composer.lock{,.disabled}
67 %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/*
71 composer='%{__php} %{SOURCE1}'
75 if [ ! -d vendor ]; then
76 COMPOSER_HOME=${PWD:=$(pwd)} \
77 $composer install --prefer-dist -v
78 %{__patch} -p1 < %{PATCH2}
81 V=$(echo composer-composer-*)
82 V=${V#composer-composer-}
83 COMPOSER_VERSION=%{version}%{?subver:-%{subver}}${V:+-g$V} \
84 %{__php} -d phar.readonly=0 ./bin/compile
87 %{__php} composer.phar --version
90 %{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build
93 rm -rf $RPM_BUILD_ROOT
94 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
96 cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir}
97 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
100 rm -rf $RPM_BUILD_ROOT
103 %defattr(644,root,root,755)
104 %doc README.md CHANGELOG.md LICENSE PORTING_INFO
105 %attr(755,root,root) %{_bindir}/composer
108 %attr(755,root,root) %{_appdir}/bin/*