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