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