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