]>
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 | ||
826ed1fe ER |
7 | %define rel 10 |
8 | #define githash b23a3cd | |
9 | %define subver alpha9 | |
fc4ae5b5 | 10 | %define php_min_version 5.3.4 |
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 |
826ed1fe | 15 | Release: %{rel}.%{subver} |
fc4ae5b5 ER |
16 | License: MIT |
17 | Group: Development/Languages/PHP | |
826ed1fe ER |
18 | #Source0: https://github.com/composer/composer/archive/%{githash}/%{name}-%{version}-%{githash}.tar.gz |
19 | Source0: https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz | |
20 | # Source0-md5: f5d0fb132995263ee2783f9e9521acbc | |
157c1941 | 21 | %if %{with bootstrap} |
848ed42b | 22 | Source1: http://getcomposer.org/download/%{version}-alpha8/%{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 | ||
e3a33933 ER |
108 | # cleanup backups after patching |
109 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
110 | ||
7e4a1874 ER |
111 | %build |
112 | %if %{with bootstrap} | |
89da5e62 | 113 | composer='%{__php} %{SOURCE1}' |
27e7a28a | 114 | phar extract -f "%{SOURCE1}" -i vendor . |
7e4a1874 | 115 | %else |
f21c5b27 | 116 | composer=composer |
fc1f03a9 | 117 | %endif |
f21c5b27 | 118 | if [ ! -d vendor ]; then |
89da5e62 | 119 | COMPOSER_HOME=${PWD:=$(pwd)} \ |
a62cffcb | 120 | $composer dump-autoload -v |
f21c5b27 ER |
121 | %{__patch} -p1 < %{PATCH2} |
122 | fi | |
7e4a1874 | 123 | |
848ed42b | 124 | RELEASE_DATE=$(LC_ALL=C date) \ |
826ed1fe ER |
125 | PACKAGE_VERSION=%{?!githash:%{version}-%{subver}}%{?githash} \ |
126 | DEV_VERSION=%{!?githash:0}%{?githash:1} \ | |
7e4a1874 | 127 | %{__php} -d phar.readonly=0 ./bin/compile |
fc4ae5b5 | 128 | |
f21c5b27 ER |
129 | # sanity check |
130 | %{__php} composer.phar --version | |
131 | ||
132 | install -d build | |
133 | %{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build | |
134 | ||
fc4ae5b5 ER |
135 | %install |
136 | rm -rf $RPM_BUILD_ROOT | |
fd4b4dad | 137 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir},/var/cache/composer} |
f21c5b27 | 138 | cd build |
055b7afe | 139 | cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir} |
734cea69 | 140 | ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name} |
353ad298 | 141 | chmod +x $RPM_BUILD_ROOT%{_appdir}/bin/* |
fc4ae5b5 | 142 | |
084e990b ER |
143 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
144 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{bash_compdir}/composer | |
145 | ||
fc4ae5b5 ER |
146 | %clean |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | ||
149 | %files | |
150 | %defattr(644,root,root,755) | |
7e4a1874 | 151 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 152 | %attr(755,root,root) %{_bindir}/composer |
a2a560b6 ER |
153 | %dir %{_appdir} |
154 | %dir %{_appdir}/bin | |
155 | %attr(755,root,root) %{_appdir}/bin/* | |
055b7afe | 156 | %{_appdir}/res |
a2a560b6 | 157 | %{_appdir}/src |
055b7afe | 158 | %{_appdir}/vendor |
084e990b | 159 | |
fd4b4dad ER |
160 | # top level cachedir, create user cache dirs here manually |
161 | %dir %attr(711,root,http) /var/cache/composer | |
162 | ||
084e990b ER |
163 | %files -n bash-completion-%{name} |
164 | %defattr(644,root,root,755) | |
165 | %{bash_compdir}/composer |