]>
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 | |
a2a560b6 | 8 | %define rel 0.4 |
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 | |
0755a9b1 | 19 | # Source1-md5: f9b1dbd4ad0e3707bfe216690b210a7e |
7e4a1874 | 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 | 29 | Requires: php(core) >= %{php_min_version} |
a9025f5d ER |
30 | Suggests: git-core |
31 | Suggests: mercurial | |
a3c55e4e | 32 | Suggests: php(openssl) |
0cf8b9e3 | 33 | Suggests: php(zip) |
a9025f5d | 34 | Suggests: subversion |
fc4ae5b5 ER |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
a2a560b6 ER |
38 | %define _appdir %{_datadir}/%{pkgname} |
39 | ||
fc4ae5b5 ER |
40 | %description |
41 | Composer is a tool for dependency management in PHP. It allows you to | |
42 | declare the dependent libraries your project needs and it will install | |
43 | them in your project for you. | |
44 | ||
45 | %prep | |
7e4a1874 ER |
46 | %setup -q -n %{pkgname}-%{version}%{?subver:-%{subver}} |
47 | %patch0 -p1 | |
48 | ||
a2a560b6 ER |
49 | %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/* |
50 | ||
7e4a1874 ER |
51 | %build |
52 | %if %{with bootstrap} | |
53 | cp -p %{SOURCE1} . | |
54 | %else | |
55 | composer install -v | |
56 | ||
57 | COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \ | |
58 | %{__php} -d phar.readonly=0 ./bin/compile | |
59 | %endif | |
fc4ae5b5 ER |
60 | |
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
a2a560b6 ER |
63 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}} |
64 | cp -a bin src vendor $RPM_BUILD_ROOT%{_appdir} | |
65 | ln -s %{_appdir}/bin/%{pkgname} $RPM_BUILD_ROOT%{_bindir}/%{pkgname} | |
fc4ae5b5 ER |
66 | |
67 | %clean | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %files | |
71 | %defattr(644,root,root,755) | |
7e4a1874 | 72 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 73 | %attr(755,root,root) %{_bindir}/composer |
a2a560b6 ER |
74 | %dir %{_appdir} |
75 | %dir %{_appdir}/bin | |
76 | %attr(755,root,root) %{_appdir}/bin/* | |
77 | %{_appdir}/vendor | |
78 | %{_appdir}/src |