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