]>
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 |
b3a11e21 | 8 | %define subver alpha8 |
d9257928 ER |
9 | %define githash ac497fe |
10 | %define rel 3 | |
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 |
d9257928 | 15 | Release: 0.%{subver}.%{rel}.%{githash} |
fc4ae5b5 ER |
16 | License: MIT |
17 | Group: Development/Languages/PHP | |
d9257928 ER |
18 | #Source0: https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz |
19 | Source0: https://github.com/composer/composer/archive/%{githash}/%{name}-%{version}-%{subver}-%{githash}.tar.gz | |
20 | # Source0-md5: 124fe0335a9f61f1ab149d3f8e0616b4 | |
157c1941 | 21 | %if %{with bootstrap} |
734cea69 | 22 | Source1: http://getcomposer.org/download/%{version}-%{subver}/%{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 | |
fc4ae5b5 | 30 | URL: http://www.getcomposer.org/ |
27e7a28a | 31 | BuildRequires: /usr/bin/phar |
7e4a1874 | 32 | BuildRequires: /usr/bin/php |
fc1f03a9 ER |
33 | BuildRequires: php(ctype) |
34 | BuildRequires: php(hash) | |
35 | BuildRequires: php(json) | |
36 | BuildRequires: php(openssl) | |
7e4a1874 | 37 | BuildRequires: php(phar) |
89da5e62 | 38 | BuildRequires: php(zip) |
27e7a28a | 39 | BuildRequires: php(zlib) |
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) |
27e7a28a | 60 | %if %{without bootstrap} |
c09cb1dd ER |
61 | Requires: php-justinrainbow-json-schema >= 1.1.0 |
62 | Requires: php-seld-jsonlint >= 1.1.2 | |
1550ab9f ER |
63 | Requires: php-symfony2-Console >= 2.3 |
64 | Requires: php-symfony2-Finder >= 2.2 | |
f21c5b27 | 65 | Requires: php-symfony2-Process >= 2.1 |
27e7a28a | 66 | %endif |
ce708d4d | 67 | Suggests: bash-completion-%{name} |
a9025f5d ER |
68 | Suggests: git-core |
69 | Suggests: mercurial | |
a9025f5d | 70 | Suggests: subversion |
fc4ae5b5 ER |
71 | BuildArch: noarch |
72 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
73 | ||
734cea69 | 74 | %define _appdir %{_datadir}/%{name} |
a2a560b6 | 75 | |
fc4ae5b5 | 76 | %description |
d9257928 ER |
77 | Composer is a tool for dependency management in PHP. |
78 | ||
79 | Composer helps you declare, manage and install dependencies of PHP | |
80 | projects, ensuring you have the right stack everywhere. | |
fc4ae5b5 | 81 | |
084e990b ER |
82 | %package -n bash-completion-%{name} |
83 | Summary: Bash completion for Composer | |
84 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Composera | |
85 | Group: Applications/Shells | |
86 | Requires: %{name} | |
87 | Requires: bash-completion >= 2.0 | |
88 | ||
89 | %description -n bash-completion-%{name} | |
90 | Bash completion for Composer package and dependency manager. | |
91 | ||
92 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
93 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera. | |
94 | ||
fc4ae5b5 | 95 | %prep |
ee5e3da9 ER |
96 | %setup -qc -n %{name}-%{version}-%{release} |
97 | mv composer-*/* . | |
b8c430b4 | 98 | %patch0 -p1 |
27e7a28a | 99 | %{!?with_bootstrap:%patch1 -p1} |
7e4a1874 | 100 | |
89da5e62 | 101 | mv composer.lock{,.disabled} |
a2a560b6 ER |
102 | %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/* |
103 | ||
7e4a1874 ER |
104 | %build |
105 | %if %{with bootstrap} | |
89da5e62 | 106 | composer='%{__php} %{SOURCE1}' |
27e7a28a | 107 | phar extract -f "%{SOURCE1}" -i vendor . |
7e4a1874 | 108 | %else |
f21c5b27 | 109 | composer=composer |
fc1f03a9 | 110 | %endif |
f21c5b27 | 111 | if [ ! -d vendor ]; then |
89da5e62 | 112 | COMPOSER_HOME=${PWD:=$(pwd)} \ |
a62cffcb | 113 | $composer dump-autoload -v |
f21c5b27 ER |
114 | %{__patch} -p1 < %{PATCH2} |
115 | fi | |
7e4a1874 | 116 | |
b3a11e21 | 117 | COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \ |
7e4a1874 | 118 | %{__php} -d phar.readonly=0 ./bin/compile |
fc4ae5b5 | 119 | |
f21c5b27 ER |
120 | # sanity check |
121 | %{__php} composer.phar --version | |
122 | ||
123 | install -d build | |
124 | %{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build | |
125 | ||
fc4ae5b5 ER |
126 | %install |
127 | rm -rf $RPM_BUILD_ROOT | |
a2a560b6 | 128 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}} |
f21c5b27 | 129 | cd build |
055b7afe | 130 | cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir} |
734cea69 | 131 | ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name} |
353ad298 | 132 | chmod +x $RPM_BUILD_ROOT%{_appdir}/bin/* |
fc4ae5b5 | 133 | |
084e990b ER |
134 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
135 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{bash_compdir}/composer | |
136 | ||
fc4ae5b5 ER |
137 | %clean |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
140 | %files | |
141 | %defattr(644,root,root,755) | |
7e4a1874 | 142 | %doc README.md CHANGELOG.md LICENSE PORTING_INFO |
fc4ae5b5 | 143 | %attr(755,root,root) %{_bindir}/composer |
a2a560b6 ER |
144 | %dir %{_appdir} |
145 | %dir %{_appdir}/bin | |
146 | %attr(755,root,root) %{_appdir}/bin/* | |
055b7afe | 147 | %{_appdir}/res |
a2a560b6 | 148 | %{_appdir}/src |
055b7afe | 149 | %{_appdir}/vendor |
084e990b ER |
150 | |
151 | %files -n bash-completion-%{name} | |
152 | %defattr(644,root,root,755) | |
153 | %{bash_compdir}/composer |