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