]>
Commit | Line | Data |
---|---|---|
f21c5b27 ER |
1 | # NOTE |
2 | # - release tarballs: http://getcomposer.org/download/ | |
3 | ||
7e4a1874 ER |
4 | # Conditional build: |
5 | %bcond_with bootstrap # build boostrap | |
6 | ||
fc4ae5b5 | 7 | %define php_min_version 5.3.4 |
b3a11e21 | 8 | %define subver alpha8 |
8cdf6de3 | 9 | %define rel 2 |
fc4ae5b5 ER |
10 | %include /usr/lib/rpm/macros.php |
11 | Summary: Dependency Manager for PHP | |
734cea69 | 12 | Name: composer |
fc4ae5b5 ER |
13 | Version: 1.0.0 |
14 | Release: 0.%{subver}.%{rel} | |
15 | License: MIT | |
16 | Group: Development/Languages/PHP | |
b3a11e21 ER |
17 | Source0: https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz |
18 | # Source0-md5: a304aecf48b8406730d572e204afd6db | |
157c1941 | 19 | %if %{with bootstrap} |
734cea69 | 20 | Source1: http://getcomposer.org/download/%{version}-%{subver}/%{name}.phar |
b3a11e21 | 21 | # Source1-md5: df1001975035f07d09307bf1f1e62584 |
157c1941 | 22 | %endif |
084e990b ER |
23 | Source2: https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer |
24 | # Source2-md5: cdeebf0a0da1fd07d0fd886d0461642e | |
7e4a1874 | 25 | Patch0: nogit.patch |
c9eae711 ER |
26 | Patch1: no-vendors.patch |
27 | Patch2: autoload-config.patch | |
fc4ae5b5 | 28 | URL: http://www.getcomposer.org/ |
27e7a28a | 29 | BuildRequires: /usr/bin/phar |
7e4a1874 | 30 | BuildRequires: /usr/bin/php |
fc1f03a9 ER |
31 | BuildRequires: php(ctype) |
32 | BuildRequires: php(hash) | |
33 | BuildRequires: php(json) | |
34 | BuildRequires: php(openssl) | |
7e4a1874 | 35 | BuildRequires: php(phar) |
89da5e62 | 36 | BuildRequires: php(zip) |
27e7a28a | 37 | BuildRequires: php(zlib) |
fc4ae5b5 | 38 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
084e990b | 39 | BuildRequires: rpmbuild(macros) >= 1.673 |
7e4a1874 ER |
40 | %if %{without bootstrap} |
41 | BuildRequires: %{name} | |
a62cffcb ER |
42 | BuildRequires: php-symfony2-Console >= 2.3 |
43 | BuildRequires: php-symfony2-Finder >= 2.2 | |
7e4a1874 | 44 | %endif |
fc4ae5b5 | 45 | Requires: php(core) >= %{php_min_version} |
64350575 ER |
46 | Requires: php(ctype) |
47 | Requires: php(date) | |
48 | Requires: php(filter) | |
fd5fce61 | 49 | Requires: php(hash) |
64350575 | 50 | Requires: php(json) |
b8b478bb | 51 | Requires: php(openssl) |
64350575 | 52 | Requires: php(pcre) |
d0052d6c | 53 | Requires: php(phar) |
154bbfb4 | 54 | Requires: php(posix) |
64350575 ER |
55 | Requires: php(simplexml) |
56 | Requires: php(spl) | |
b8b478bb | 57 | Requires: php(zip) |
27e7a28a | 58 | %if %{without bootstrap} |
c09cb1dd ER |
59 | Requires: php-justinrainbow-json-schema >= 1.1.0 |
60 | Requires: php-seld-jsonlint >= 1.1.2 | |
1550ab9f ER |
61 | Requires: php-symfony2-Console >= 2.3 |
62 | Requires: php-symfony2-Finder >= 2.2 | |
f21c5b27 | 63 | Requires: php-symfony2-Process >= 2.1 |
27e7a28a | 64 | %endif |
ce708d4d | 65 | Suggests: bash-completion-%{name} |
a9025f5d ER |
66 | Suggests: git-core |
67 | Suggests: mercurial | |
a9025f5d | 68 | Suggests: subversion |
fc4ae5b5 ER |
69 | BuildArch: noarch |
70 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
71 | ||
734cea69 | 72 | %define _appdir %{_datadir}/%{name} |
a2a560b6 | 73 | |
fc4ae5b5 ER |
74 | %description |
75 | Composer is a tool for dependency management in PHP. It allows you to | |
76 | declare the dependent libraries your project needs and it will install | |
77 | them in your project for you. | |
78 | ||
084e990b ER |
79 | %package -n bash-completion-%{name} |
80 | Summary: Bash completion for Composer | |
81 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Composera | |
82 | Group: Applications/Shells | |
83 | Requires: %{name} | |
84 | Requires: bash-completion >= 2.0 | |
85 | ||
86 | %description -n bash-completion-%{name} | |
87 | Bash completion for Composer package and dependency manager. | |
88 | ||
89 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
90 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera. | |
91 | ||
fc4ae5b5 | 92 | %prep |
ee5e3da9 ER |
93 | %setup -qc -n %{name}-%{version}-%{release} |
94 | mv composer-*/* . | |
b8c430b4 | 95 | %patch0 -p1 |
27e7a28a | 96 | %{!?with_bootstrap:%patch1 -p1} |
7e4a1874 | 97 | |
89da5e62 | 98 | mv composer.lock{,.disabled} |
a2a560b6 ER |
99 | %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/* |
100 | ||
7e4a1874 ER |
101 | %build |
102 | %if %{with bootstrap} | |
89da5e62 | 103 | composer='%{__php} %{SOURCE1}' |
27e7a28a | 104 | phar extract -f "%{SOURCE1}" -i vendor . |
7e4a1874 | 105 | %else |
f21c5b27 | 106 | composer=composer |
fc1f03a9 | 107 | %endif |
f21c5b27 | 108 | if [ ! -d vendor ]; then |
89da5e62 | 109 | COMPOSER_HOME=${PWD:=$(pwd)} \ |
a62cffcb | 110 | $composer dump-autoload -v |
f21c5b27 ER |
111 | %{__patch} -p1 < %{PATCH2} |
112 | fi | |
7e4a1874 | 113 | |
b3a11e21 | 114 | COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \ |
7e4a1874 | 115 | %{__php} -d phar.readonly=0 ./bin/compile |
fc4ae5b5 | 116 | |
f21c5b27 ER |
117 | # sanity check |
118 | %{__php} composer.phar --version | |
119 | ||
120 | install -d build | |
121 | %{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build | |
122 | ||
fc4ae5b5 ER |
123 | %install |
124 | rm -rf $RPM_BUILD_ROOT | |
a2a560b6 | 125 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}} |
f21c5b27 | 126 | cd build |
055b7afe | 127 | cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir} |
734cea69 | 128 | ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name} |
353ad298 | 129 | chmod +x $RPM_BUILD_ROOT%{_appdir}/bin/* |
fc4ae5b5 | 130 | |
084e990b ER |
131 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
132 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{bash_compdir}/composer | |
133 | ||
fc4ae5b5 ER |
134 | %clean |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
137 | %files | |
138 | %defattr(644,root,root,755) | |
7e4a1874 | 139 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 140 | %attr(755,root,root) %{_bindir}/composer |
a2a560b6 ER |
141 | %dir %{_appdir} |
142 | %dir %{_appdir}/bin | |
143 | %attr(755,root,root) %{_appdir}/bin/* | |
055b7afe | 144 | %{_appdir}/res |
a2a560b6 | 145 | %{_appdir}/src |
055b7afe | 146 | %{_appdir}/vendor |
084e990b ER |
147 | |
148 | %files -n bash-completion-%{name} | |
149 | %defattr(644,root,root,755) | |
150 | %{bash_compdir}/composer |