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