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