]> git.pld-linux.org Git - packages/composer.git/blob - composer.spec
rename to composer
[packages/composer.git] / composer.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap               # build boostrap
4
5 %define         php_min_version 5.3.4
6 %define         subver  alpha6
7 %define         rel             0.5
8 %include        /usr/lib/rpm/macros.php
9 Summary:        Dependency Manager for PHP
10 Name:           composer
11 Version:        1.0.0
12 Release:        0.%{subver}.%{rel}
13 License:        MIT
14 Group:          Development/Languages/PHP
15 Source0:        https://github.com/composer/composer/archive/%{version}-%{subver}.tar.gz
16 # Source0-md5:  bb5ad93089d09a1e58cfaf28fb5c2ab4
17 Source1:        http://getcomposer.org/download/%{version}-%{subver}/%{name}.phar
18 # Source1-md5:  f9b1dbd4ad0e3707bfe216690b210a7e
19 Patch0:         nogit.patch
20 URL:            http://www.getcomposer.org/
21 BuildRequires:  /usr/bin/php
22 BuildRequires:  php(phar)
23 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
24 BuildRequires:  rpmbuild(macros) >= 1.461
25 %if %{without bootstrap}
26 BuildRequires:  %{name}
27 %endif
28 Requires:       php(core) >= %{php_min_version}
29 Suggests:       git-core
30 Suggests:       mercurial
31 Suggests:       php(openssl)
32 Suggests:       php(zip)
33 Suggests:       subversion
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %define         _appdir         %{_datadir}/%{name}
38
39 %description
40 Composer is a tool for dependency management in PHP. It allows you to
41 declare the dependent libraries your project needs and it will install
42 them in your project for you.
43
44 %prep
45 %setup -q -n %{name}-%{version}%{?subver:-%{subver}}
46 %patch0 -p1
47
48 %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/*
49
50 %build
51 %if %{with bootstrap}
52 cp -p %{SOURCE1} .
53 %else
54 composer install -v
55
56 COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \
57 %{__php} -d phar.readonly=0 ./bin/compile
58 %endif
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
63 cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir}
64 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
65
66 %clean
67 rm -rf $RPM_BUILD_ROOT
68
69 %files
70 %defattr(644,root,root,755)
71 %doc README.md CHANGELOG.md LICENSE PORTING_INFO
72 %attr(755,root,root) %{_bindir}/composer
73 %dir %{_appdir}
74 %dir %{_appdir}/bin
75 %attr(755,root,root) %{_appdir}/bin/*
76 %{_appdir}/res
77 %{_appdir}/src
78 %{_appdir}/vendor
This page took 0.040288 seconds and 4 git commands to generate.