]> git.pld-linux.org Git - packages/composer.git/blame - composer.spec
tar unpacker uses phar extension
[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
d0052d6c 10%define rel 0.16
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)
89da5e62 33BuildRequires: php(zip)
fc4ae5b5
ER
34BuildRequires: rpm-php-pearprov >= 4.4.2-11
35BuildRequires: rpmbuild(macros) >= 1.461
7e4a1874
ER
36%if %{without bootstrap}
37BuildRequires: %{name}
38%endif
fc4ae5b5 39Requires: php(core) >= %{php_min_version}
d0052d6c 40Requires: php(phar)
f21c5b27
ER
41Requires: php-symfony2-Console >= 2.1
42Requires: php-symfony2-Finder >= 2.1
43Requires: php-symfony2-Process >= 2.1
a9025f5d
ER
44Suggests: git-core
45Suggests: mercurial
a3c55e4e 46Suggests: php(openssl)
0cf8b9e3 47Suggests: php(zip)
a9025f5d 48Suggests: subversion
fc4ae5b5
ER
49BuildArch: noarch
50BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
734cea69 52%define _appdir %{_datadir}/%{name}
a2a560b6 53
fc4ae5b5
ER
54%description
55Composer is a tool for dependency management in PHP. It allows you to
56declare the dependent libraries your project needs and it will install
57them in your project for you.
58
59%prep
f21c5b27
ER
60%setup -qc
61mv composer-composer-*/* .
b8c430b4 62%patch0 -p1
f21c5b27 63%patch1 -p1
7e4a1874 64
89da5e62 65mv composer.lock{,.disabled}
a2a560b6
ER
66%{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/*
67
7e4a1874
ER
68%build
69%if %{with bootstrap}
89da5e62 70composer='%{__php} %{SOURCE1}'
7e4a1874 71%else
f21c5b27 72composer=composer
fc1f03a9 73%endif
f21c5b27 74if [ ! -d vendor ]; then
89da5e62 75 COMPOSER_HOME=${PWD:=$(pwd)} \
f21c5b27
ER
76 $composer install --prefer-dist -v
77 %{__patch} -p1 < %{PATCH2}
78fi
7e4a1874 79
f21c5b27
ER
80V=$(echo composer-composer-*)
81V=${V#composer-composer-}
82COMPOSER_VERSION=%{version}%{?subver:-%{subver}}${V:+-g$V} \
7e4a1874 83%{__php} -d phar.readonly=0 ./bin/compile
fc4ae5b5 84
f21c5b27
ER
85# sanity check
86%{__php} composer.phar --version
87
88install -d build
89%{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build
90
fc4ae5b5
ER
91%install
92rm -rf $RPM_BUILD_ROOT
a2a560b6 93install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
f21c5b27 94cd build
055b7afe 95cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir}
734cea69 96ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
fc4ae5b5
ER
97
98%clean
99rm -rf $RPM_BUILD_ROOT
100
101%files
102%defattr(644,root,root,755)
7e4a1874 103%doc README.md CHANGELOG.md LICENSE PORTING_INFO
fc4ae5b5 104%attr(755,root,root) %{_bindir}/composer
a2a560b6
ER
105%dir %{_appdir}
106%dir %{_appdir}/bin
107%attr(755,root,root) %{_appdir}/bin/*
055b7afe 108%{_appdir}/res
a2a560b6 109%{_appdir}/src
055b7afe 110%{_appdir}/vendor
This page took 0.078992 seconds and 4 git commands to generate.