]> git.pld-linux.org Git - packages/composer.git/blame - composer.spec
rebundle .phar without symfony components
[packages/composer.git] / composer.spec
CommitLineData
7e4a1874 1#
f21c5b27
ER
2# NOTE
3# - release tarballs: http://getcomposer.org/download/
4
7e4a1874
ER
5# Conditional build:
6%bcond_with bootstrap # build boostrap
7
fc4ae5b5 8%define php_min_version 5.3.4
fc1f03a9 9%define subver alpha7
f21c5b27 10%define rel 0.13
fc4ae5b5
ER
11%include /usr/lib/rpm/macros.php
12Summary: Dependency Manager for PHP
734cea69 13Name: composer
fc4ae5b5
ER
14Version: 1.0.0
15Release: 0.%{subver}.%{rel}
16License: MIT
17Group: Development/Languages/PHP
fc1f03a9 18#Source0: https://github.com/composer/composer/archive/%{version}-%{subver}.tar.gz
f21c5b27
ER
19Source0: http://github.com/composer/composer/tarball/master?/%{name}.tgz
20# Source0-md5: 661b31437f47e3ff23e616ab3fb21831
734cea69 21Source1: http://getcomposer.org/download/%{version}-%{subver}/%{name}.phar
0755a9b1 22# Source1-md5: f9b1dbd4ad0e3707bfe216690b210a7e
7e4a1874 23Patch0: nogit.patch
f21c5b27
ER
24Patch1: no-bundle-symfony.patch
25Patch2: system-symfony.patch
fc4ae5b5 26URL: http://www.getcomposer.org/
7e4a1874 27BuildRequires: /usr/bin/php
fc1f03a9
ER
28BuildRequires: php(ctype)
29BuildRequires: php(hash)
30BuildRequires: php(json)
31BuildRequires: php(openssl)
7e4a1874 32BuildRequires: php(phar)
fc4ae5b5
ER
33BuildRequires: rpm-php-pearprov >= 4.4.2-11
34BuildRequires: rpmbuild(macros) >= 1.461
7e4a1874
ER
35%if %{without bootstrap}
36BuildRequires: %{name}
37%endif
fc4ae5b5 38Requires: php(core) >= %{php_min_version}
f21c5b27
ER
39Requires: php-symfony2-Console >= 2.1
40Requires: php-symfony2-Finder >= 2.1
41Requires: php-symfony2-Process >= 2.1
a9025f5d
ER
42Suggests: git-core
43Suggests: mercurial
a3c55e4e 44Suggests: php(openssl)
0cf8b9e3 45Suggests: php(zip)
a9025f5d 46Suggests: subversion
fc4ae5b5
ER
47BuildArch: noarch
48BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
734cea69 50%define _appdir %{_datadir}/%{name}
a2a560b6 51
fc4ae5b5
ER
52%description
53Composer is a tool for dependency management in PHP. It allows you to
54declare the dependent libraries your project needs and it will install
55them in your project for you.
56
57%prep
f21c5b27
ER
58%setup -qc
59mv composer-composer-*/* .
b8c430b4 60%patch0 -p1
f21c5b27 61%patch1 -p1
7e4a1874 62
a2a560b6
ER
63%{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/*
64
7e4a1874
ER
65%build
66%if %{with bootstrap}
f21c5b27 67composer='env -i PATH="$PATH" %{__php} %{SOURCE1}'
7e4a1874 68%else
f21c5b27 69composer=composer
fc1f03a9 70%endif
f21c5b27
ER
71if [ ! -d vendor ]; then
72 $composer install --prefer-dist -v
73 %{__patch} -p1 < %{PATCH2}
74fi
7e4a1874 75
f21c5b27
ER
76V=$(echo composer-composer-*)
77V=${V#composer-composer-}
78COMPOSER_VERSION=%{version}%{?subver:-%{subver}}${V:+-g$V} \
7e4a1874 79%{__php} -d phar.readonly=0 ./bin/compile
fc4ae5b5 80
f21c5b27
ER
81# sanity check
82%{__php} composer.phar --version
83
84install -d build
85%{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build
86
fc4ae5b5
ER
87%install
88rm -rf $RPM_BUILD_ROOT
a2a560b6 89install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
f21c5b27 90cd build
055b7afe 91cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir}
734cea69 92ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
fc4ae5b5
ER
93
94%clean
95rm -rf $RPM_BUILD_ROOT
96
97%files
98%defattr(644,root,root,755)
7e4a1874 99%doc README.md CHANGELOG.md LICENSE PORTING_INFO
fc4ae5b5 100%attr(755,root,root) %{_bindir}/composer
a2a560b6
ER
101%dir %{_appdir}
102%dir %{_appdir}/bin
103%attr(755,root,root) %{_appdir}/bin/*
055b7afe 104%{_appdir}/res
a2a560b6 105%{_appdir}/src
055b7afe 106%{_appdir}/vendor
This page took 0.052458 seconds and 4 git commands to generate.