]>
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 | ||
833eb7f2 | 7 | %define rel 14 |
b0da7bb7 | 8 | #define githash 5744981 |
65715e5b | 9 | # $ git rev-list 1.0.0-alpha11..%{githash} --count |
b0da7bb7 | 10 | #define commits 216 |
1fe17f86 | 11 | %define subver alpha11 |
fc4ae5b5 | 12 | %define php_min_version 5.3.4 |
fc4ae5b5 ER |
13 | %include /usr/lib/rpm/macros.php |
14 | Summary: Dependency Manager for PHP | |
734cea69 | 15 | Name: composer |
fc4ae5b5 | 16 | Version: 1.0.0 |
b0da7bb7 | 17 | Release: %{rel}.%{subver}%{?commits:.%{commits}}%{?githash:.g%{githash}} |
fc4ae5b5 ER |
18 | License: MIT |
19 | Group: Development/Languages/PHP | |
b0da7bb7 ER |
20 | #Source0: https://github.com/composer/composer/archive/%{githash}/%{name}-%{version}-%{subver}-%{commits}-g%{githash}.tar.gz |
21 | Source0: https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz | |
1fe17f86 | 22 | # Source0-md5: 5e4ff16cff75fae31285196c5f51a8f8 |
157c1941 | 23 | %if %{with bootstrap} |
848ed42b | 24 | Source1: http://getcomposer.org/download/%{version}-alpha8/%{name}.phar |
b3a11e21 | 25 | # Source1-md5: df1001975035f07d09307bf1f1e62584 |
157c1941 | 26 | %endif |
084e990b ER |
27 | Source2: https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer |
28 | # Source2-md5: cdeebf0a0da1fd07d0fd886d0461642e | |
65715e5b | 29 | Source3: autoload.php |
7e4a1874 | 30 | Patch0: nogit.patch |
c9eae711 ER |
31 | Patch1: no-vendors.patch |
32 | Patch2: autoload-config.patch | |
048c2357 | 33 | Patch3: update-memory-limit.patch |
833eb7f2 | 34 | Patch4: svn-ignore-externals.patch |
65715e5b | 35 | Patch10: autoload.patch |
fc4ae5b5 | 36 | URL: http://www.getcomposer.org/ |
5d101a0e | 37 | BuildRequires: %{php_name}-cli |
e2164043 | 38 | BuildRequires: %{php_name}-ctype |
df35030a | 39 | BuildRequires: %{php_name}-filter |
e2164043 ER |
40 | BuildRequires: %{php_name}-hash |
41 | BuildRequires: %{php_name}-json | |
42 | BuildRequires: %{php_name}-openssl | |
43 | BuildRequires: %{php_name}-phar | |
e2164043 ER |
44 | BuildRequires: %{php_name}-zip |
45 | BuildRequires: %{php_name}-zlib | |
27e7a28a | 46 | BuildRequires: /usr/bin/phar |
c3f23dc6 | 47 | BuildRequires: php-devel |
fc4ae5b5 | 48 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
084e990b | 49 | BuildRequires: rpmbuild(macros) >= 1.673 |
7e4a1874 ER |
50 | %if %{without bootstrap} |
51 | BuildRequires: %{name} | |
b4e74b61 ER |
52 | BuildRequires: php-composer-semver >= 1.0.0 |
53 | BuildRequires: php-composer-spdx-licenses >= 1.0.0 | |
54 | BuildRequires: php-seld-phar-utils >= 1.0.0 | |
a62cffcb ER |
55 | BuildRequires: php-symfony2-Console >= 2.3 |
56 | BuildRequires: php-symfony2-Finder >= 2.2 | |
7e4a1874 | 57 | %endif |
fc4ae5b5 | 58 | Requires: php(core) >= %{php_min_version} |
64350575 ER |
59 | Requires: php(ctype) |
60 | Requires: php(date) | |
61 | Requires: php(filter) | |
fd5fce61 | 62 | Requires: php(hash) |
64350575 | 63 | Requires: php(json) |
b8b478bb | 64 | Requires: php(openssl) |
64350575 | 65 | Requires: php(pcre) |
d0052d6c | 66 | Requires: php(phar) |
154bbfb4 | 67 | Requires: php(posix) |
64350575 ER |
68 | Requires: php(simplexml) |
69 | Requires: php(spl) | |
b8b478bb | 70 | Requires: php(zip) |
d5534972 | 71 | Requires: php(zlib) |
27e7a28a | 72 | %if %{without bootstrap} |
b0da7bb7 | 73 | Requires: php-justinrainbow-json-schema >= 1.4 |
c09cb1dd | 74 | Requires: php-seld-jsonlint >= 1.1.2 |
65715e5b ER |
75 | Requires: php-symfony2-ClassLoader >= 2.7.7 |
76 | Requires: php-symfony2-Console >= 2.7.7 | |
77 | Requires: php-symfony2-Finder >= 2.7.7 | |
78 | Requires: php-symfony2-Process >= 2.7.7 | |
27e7a28a | 79 | %endif |
ce708d4d | 80 | Suggests: bash-completion-%{name} |
a9025f5d ER |
81 | Suggests: git-core |
82 | Suggests: mercurial | |
a9025f5d | 83 | Suggests: subversion |
fc4ae5b5 ER |
84 | BuildArch: noarch |
85 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
86 | ||
87 | %description | |
d9257928 ER |
88 | Composer is a tool for dependency management in PHP. |
89 | ||
90 | Composer helps you declare, manage and install dependencies of PHP | |
91 | projects, ensuring you have the right stack everywhere. | |
fc4ae5b5 | 92 | |
084e990b ER |
93 | %package -n bash-completion-%{name} |
94 | Summary: Bash completion for Composer | |
95 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Composera | |
96 | Group: Applications/Shells | |
97 | Requires: %{name} | |
98 | Requires: bash-completion >= 2.0 | |
99 | ||
100 | %description -n bash-completion-%{name} | |
101 | Bash completion for Composer package and dependency manager. | |
102 | ||
103 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
104 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera. | |
105 | ||
fc4ae5b5 | 106 | %prep |
ee5e3da9 ER |
107 | %setup -qc -n %{name}-%{version}-%{release} |
108 | mv composer-*/* . | |
65715e5b | 109 | %patch10 -p1 |
7e4a1874 | 110 | |
89da5e62 | 111 | mv composer.lock{,.disabled} |
5d101a0e ER |
112 | # NOTE: do not use %{__php} macro here, need unversioned php binary |
113 | %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' bin/* | |
a2a560b6 | 114 | |
65715e5b ER |
115 | cp -p %{SOURCE3} src/Composer/autoload.php |
116 | ||
e3a33933 ER |
117 | # cleanup backups after patching |
118 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
119 | ||
7e4a1874 | 120 | %build |
65715e5b | 121 | %if 0 |
7e4a1874 | 122 | %if %{with bootstrap} |
89da5e62 | 123 | composer='%{__php} %{SOURCE1}' |
27e7a28a | 124 | phar extract -f "%{SOURCE1}" -i vendor . |
7e4a1874 | 125 | %else |
f21c5b27 | 126 | composer=composer |
fc1f03a9 | 127 | %endif |
f21c5b27 | 128 | if [ ! -d vendor ]; then |
89da5e62 | 129 | COMPOSER_HOME=${PWD:=$(pwd)} \ |
a62cffcb | 130 | $composer dump-autoload -v |
f21c5b27 ER |
131 | %{__patch} -p1 < %{PATCH2} |
132 | fi | |
7e4a1874 | 133 | |
848ed42b | 134 | RELEASE_DATE=$(LC_ALL=C date) \ |
826ed1fe ER |
135 | PACKAGE_VERSION=%{?!githash:%{version}-%{subver}}%{?githash} \ |
136 | DEV_VERSION=%{!?githash:0}%{?githash:1} \ | |
7e4a1874 | 137 | %{__php} -d phar.readonly=0 ./bin/compile |
fc4ae5b5 | 138 | |
f21c5b27 ER |
139 | # sanity check |
140 | %{__php} composer.phar --version | |
141 | ||
142 | install -d build | |
143 | %{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build | |
65715e5b | 144 | %endif |
f21c5b27 | 145 | |
fc4ae5b5 ER |
146 | %install |
147 | rm -rf $RPM_BUILD_ROOT | |
65715e5b ER |
148 | install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer,/var/cache/composer} |
149 | cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir} | |
150 | cp -a res $RPM_BUILD_ROOT%{php_data_dir}/Composer | |
151 | install -p bin/composer $RPM_BUILD_ROOT%{_bindir}/%{name} | |
fc4ae5b5 | 152 | |
084e990b ER |
153 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
154 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{bash_compdir}/composer | |
155 | ||
fc4ae5b5 ER |
156 | %clean |
157 | rm -rf $RPM_BUILD_ROOT | |
158 | ||
159 | %files | |
160 | %defattr(644,root,root,755) | |
7e4a1874 | 161 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 162 | %attr(755,root,root) %{_bindir}/composer |
65715e5b | 163 | %{php_data_dir}/Composer |
084e990b | 164 | |
fd4b4dad ER |
165 | # top level cachedir, create user cache dirs here manually |
166 | %dir %attr(711,root,http) /var/cache/composer | |
167 | ||
084e990b ER |
168 | %files -n bash-completion-%{name} |
169 | %defattr(644,root,root,755) | |
170 | %{bash_compdir}/composer |