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