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