]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # build boostrap | |
4 | ||
5 | %define pkgname composer | |
6 | %define php_min_version 5.3.4 | |
7 | %define subver alpha6 | |
8 | %define rel 0.4 | |
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 | |
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: f9b1dbd4ad0e3707bfe216690b210a7e | |
20 | Patch0: nogit.patch | |
21 | URL: http://www.getcomposer.org/ | |
22 | BuildRequires: /usr/bin/php | |
23 | BuildRequires: php(phar) | |
24 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 | |
25 | BuildRequires: rpmbuild(macros) >= 1.461 | |
26 | %if %{without bootstrap} | |
27 | BuildRequires: %{name} | |
28 | %endif | |
29 | Requires: php(core) >= %{php_min_version} | |
30 | Suggests: git-core | |
31 | Suggests: mercurial | |
32 | Suggests: php(openssl) | |
33 | Suggests: php(zip) | |
34 | Suggests: subversion | |
35 | BuildArch: noarch | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %define _appdir %{_datadir}/%{pkgname} | |
39 | ||
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 | |
46 | %setup -q -n %{pkgname}-%{version}%{?subver:-%{subver}} | |
47 | %patch0 -p1 | |
48 | ||
49 | %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/* | |
50 | ||
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 | |
60 | ||
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
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} | |
66 | ||
67 | %clean | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %files | |
71 | %defattr(644,root,root,755) | |
72 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO | |
73 | %attr(755,root,root) %{_bindir}/composer | |
74 | %dir %{_appdir} | |
75 | %dir %{_appdir}/bin | |
76 | %attr(755,root,root) %{_appdir}/bin/* | |
77 | %{_appdir}/vendor | |
78 | %{_appdir}/src |