]>
Commit | Line | Data |
---|---|---|
7e4a1874 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # build boostrap | |
4 | ||
fc4ae5b5 ER |
5 | %define pkgname composer |
6 | %define php_min_version 5.3.4 | |
7 | %define subver alpha6 | |
7e4a1874 | 8 | %define rel 0.2 |
fc4ae5b5 ER |
9 | %include /usr/lib/rpm/macros.php |
10 | Summary: Dependency Manager for PHP | |
11 | Name: %{pkgname}-php | |
12 | Version: 1.0.0 | |
13 | Release: 0.%{subver}.%{rel} | |
14 | License: MIT | |
15 | Group: Development/Languages/PHP | |
7e4a1874 ER |
16 | Source0: https://github.com/composer/composer/archive/%{version}-%{subver}.tar.gz |
17 | # Source0-md5: bb5ad93089d09a1e58cfaf28fb5c2ab4 | |
18 | Source1: http://getcomposer.org/download/%{version}-%{subver}/%{pkgname}.phar | |
19 | # Source1-md5: 77ab6fa1a2b50539e935c826f9df27fb | |
20 | Patch0: nogit.patch | |
fc4ae5b5 | 21 | URL: http://www.getcomposer.org/ |
7e4a1874 ER |
22 | BuildRequires: /usr/bin/php |
23 | BuildRequires: php(phar) | |
fc4ae5b5 ER |
24 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
25 | BuildRequires: rpmbuild(macros) >= 1.461 | |
7e4a1874 ER |
26 | %if %{without bootstrap} |
27 | BuildRequires: %{name} | |
28 | %endif | |
fc4ae5b5 ER |
29 | Requires: php(core) >= %{php_min_version} |
30 | Requires: php(phar) | |
a9025f5d ER |
31 | Suggests: git-core |
32 | Suggests: mercurial | |
a3c55e4e | 33 | Suggests: php(openssl) |
a9025f5d | 34 | Suggests: subversion |
fc4ae5b5 ER |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | Composer is a tool for dependency management in PHP. It allows you to | |
40 | declare the dependent libraries your project needs and it will install | |
41 | them in your project for you. | |
42 | ||
43 | %prep | |
7e4a1874 ER |
44 | %setup -q -n %{pkgname}-%{version}%{?subver:-%{subver}} |
45 | %patch0 -p1 | |
46 | ||
47 | %build | |
48 | %if %{with bootstrap} | |
49 | cp -p %{SOURCE1} . | |
50 | %else | |
51 | composer install -v | |
52 | ||
53 | COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \ | |
54 | %{__php} -d phar.readonly=0 ./bin/compile | |
55 | %endif | |
fc4ae5b5 ER |
56 | |
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | install -d $RPM_BUILD_ROOT%{_bindir} | |
7e4a1874 | 60 | cp -p %{pkgname}.phar $RPM_BUILD_ROOT%{_bindir}/%{pkgname} |
fc4ae5b5 ER |
61 | |
62 | %clean | |
63 | rm -rf $RPM_BUILD_ROOT | |
64 | ||
65 | %files | |
66 | %defattr(644,root,root,755) | |
7e4a1874 | 67 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 68 | %attr(755,root,root) %{_bindir}/composer |