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