]> git.pld-linux.org Git - packages/composer.git/blob - composer.spec
rename files to reflect what they really contain now
[packages/composer.git] / composer.spec
1 # NOTE
2 # - release tarballs: http://getcomposer.org/download/
3
4 # Conditional build:
5 %bcond_with     bootstrap               # build boostrap
6
7 %define         php_min_version 5.3.4
8 %define         subver  alpha8
9 %define         rel             0.22
10 %include        /usr/lib/rpm/macros.php
11 Summary:        Dependency Manager for PHP
12 Name:           composer
13 Version:        1.0.0
14 Release:        0.%{subver}.%{rel}
15 License:        MIT
16 Group:          Development/Languages/PHP
17 Source0:        https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz
18 # Source0-md5:  a304aecf48b8406730d572e204afd6db
19 Source1:        http://getcomposer.org/download/%{version}-%{subver}/%{name}.phar
20 # Source1-md5:  df1001975035f07d09307bf1f1e62584
21 Patch0:         nogit.patch
22 Patch1:         no-vendors.patch
23 Patch2:         autoload-config.patch
24 URL:            http://www.getcomposer.org/
25 BuildRequires:  /usr/bin/php
26 BuildRequires:  php(ctype)
27 BuildRequires:  php(hash)
28 BuildRequires:  php(json)
29 BuildRequires:  php(openssl)
30 BuildRequires:  php(phar)
31 BuildRequires:  php(zip)
32 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
33 BuildRequires:  rpmbuild(macros) >= 1.461
34 %if %{without bootstrap}
35 BuildRequires:  %{name}
36 %endif
37 Requires:       php(core) >= %{php_min_version}
38 Requires:       php(hash)
39 Requires:       php(phar)
40 Requires:       php-justinrainbow-json-schema >= 1.1.0
41 Requires:       php-seld-jsonlint >= 1.1.2
42 Requires:       php-symfony2-Console >= 2.3
43 Requires:       php-symfony2-Finder >= 2.2
44 Requires:       php-symfony2-Process >= 2.1
45 Suggests:       git-core
46 Suggests:       mercurial
47 Suggests:       php(openssl)
48 Suggests:       php(zip)
49 Suggests:       subversion
50 BuildArch:      noarch
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %define         _appdir         %{_datadir}/%{name}
54
55 %description
56 Composer is a tool for dependency management in PHP. It allows you to
57 declare the dependent libraries your project needs and it will install
58 them in your project for you.
59
60 %prep
61 %setup -qc -n %{name}-%{version}-%{release}
62 mv composer-*/* .
63 %patch0 -p1
64 %patch1 -p1
65
66 mv composer.lock{,.disabled}
67 %{__sed} -i -e '1s,^#!.*env php,#!%{__php},' bin/*
68
69 %build
70 %if %{with bootstrap}
71 composer='%{__php} %{SOURCE1}'
72 %else
73 composer=composer
74 %endif
75 if [ ! -d vendor ]; then
76         COMPOSER_HOME=${PWD:=$(pwd)} \
77         $composer install --prefer-dist -v --no-dev
78         %{__patch} -p1 < %{PATCH2}
79 fi
80
81 COMPOSER_VERSION=%{version}%{?subver:-%{subver}} \
82 %{__php} -d phar.readonly=0 ./bin/compile
83
84 # sanity check
85 %{__php} composer.phar --version
86
87 install -d build
88 %{__php} -r '$phar = new Phar($argv[1]); $phar->extractTo($argv[2]);' composer.phar build
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
93 cd build
94 cp -a bin src res vendor $RPM_BUILD_ROOT%{_appdir}
95 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %files
101 %defattr(644,root,root,755)
102 %doc README.md CHANGELOG.md LICENSE PORTING_INFO
103 %attr(755,root,root) %{_bindir}/composer
104 %dir %{_appdir}
105 %dir %{_appdir}/bin
106 %attr(755,root,root) %{_appdir}/bin/*
107 %{_appdir}/res
108 %{_appdir}/src
109 %{_appdir}/vendor
This page took 0.060093 seconds and 3 git commands to generate.