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