]>
Commit | Line | Data |
---|---|---|
7e4a1874 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # build boostrap | |
4 | ||
fc4ae5b5 | 5 | %define php_min_version 5.3.4 |
fc1f03a9 | 6 | %define subver alpha7 |
b8c430b4 | 7 | %define rel 0.7 |
fc4ae5b5 ER |
8 | %include /usr/lib/rpm/macros.php |
9 | Summary: Dependency Manager for PHP | |
734cea69 | 10 | Name: composer |
fc4ae5b5 ER |
11 | Version: 1.0.0 |
12 | Release: 0.%{subver}.%{rel} | |
13 | License: MIT | |
14 | Group: Development/Languages/PHP | |
fc1f03a9 ER |
15 | #Source0: https://github.com/composer/composer/archive/%{version}-%{subver}.tar.gz |
16 | Source0: https://github.com/composer/composer/archive/master.tar.gz?/%{name}.tgz | |
17 | # Source0-md5: 0a4a4b06740a9b49d2ab9773a907aa94 | |
734cea69 | 18 | Source1: http://getcomposer.org/download/%{version}-%{subver}/%{name}.phar |
0755a9b1 | 19 | # Source1-md5: f9b1dbd4ad0e3707bfe216690b210a7e |
7e4a1874 | 20 | Patch0: nogit.patch |
fc4ae5b5 | 21 | URL: http://www.getcomposer.org/ |
7e4a1874 | 22 | BuildRequires: /usr/bin/php |
fc1f03a9 ER |
23 | BuildRequires: php(ctype) |
24 | BuildRequires: php(hash) | |
25 | BuildRequires: php(json) | |
26 | BuildRequires: php(openssl) | |
7e4a1874 | 27 | BuildRequires: php(phar) |
fc4ae5b5 ER |
28 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
29 | BuildRequires: rpmbuild(macros) >= 1.461 | |
7e4a1874 ER |
30 | %if %{without bootstrap} |
31 | BuildRequires: %{name} | |
32 | %endif | |
fc4ae5b5 | 33 | Requires: php(core) >= %{php_min_version} |
a9025f5d ER |
34 | Suggests: git-core |
35 | Suggests: mercurial | |
a3c55e4e | 36 | Suggests: php(openssl) |
0cf8b9e3 | 37 | Suggests: php(zip) |
a9025f5d | 38 | Suggests: subversion |
fc4ae5b5 ER |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
734cea69 | 42 | %define _appdir %{_datadir}/%{name} |
a2a560b6 | 43 | |
fc4ae5b5 ER |
44 | %description |
45 | Composer is a tool for dependency management in PHP. It allows you to | |
46 | declare the dependent libraries your project needs and it will install | |
47 | them in your project for you. | |
48 | ||
49 | %prep | |
fc1f03a9 | 50 | %setup -q -n %{name}-master |
b8c430b4 | 51 | %patch0 -p1 |
7e4a1874 | 52 | |
a2a560b6 ER |
53 | %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/* |
54 | ||
7e4a1874 ER |
55 | %build |
56 | %if %{with bootstrap} | |
fc1f03a9 ER |
57 | env -i PATH=$PATH \ |
58 | %{__php} %{SOURCE1} install --prefer-dist -v | |
7e4a1874 | 59 | %else |
fc1f03a9 ER |
60 | composer install --prefer-dist -v |
61 | %endif | |
7e4a1874 ER |
62 | |
63 | COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \ | |
64 | %{__php} -d phar.readonly=0 ./bin/compile | |
fc4ae5b5 ER |
65 | |
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
a2a560b6 | 68 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}} |
055b7afe | 69 | cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir} |
734cea69 | 70 | ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name} |
fc4ae5b5 ER |
71 | |
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
7e4a1874 | 77 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 78 | %attr(755,root,root) %{_bindir}/composer |
a2a560b6 ER |
79 | %dir %{_appdir} |
80 | %dir %{_appdir}/bin | |
81 | %attr(755,root,root) %{_appdir}/bin/* | |
055b7afe | 82 | %{_appdir}/res |
a2a560b6 | 83 | %{_appdir}/src |
055b7afe | 84 | %{_appdir}/vendor |