]>
Commit | Line | Data |
---|---|---|
24c65dc2 ER |
1 | # |
2 | # Conditional build: | |
e0a76144 | 3 | %bcond_without tests # build with tests |
24c65dc2 | 4 | |
f21c5b27 ER |
5 | # NOTE |
6 | # - release tarballs: http://getcomposer.org/download/ | |
7 | ||
b85b6bee | 8 | %define rel 15 |
b0da7bb7 | 9 | #define githash 5744981 |
65715e5b | 10 | # $ git rev-list 1.0.0-alpha11..%{githash} --count |
b0da7bb7 | 11 | #define commits 216 |
1fe17f86 | 12 | %define subver alpha11 |
fc4ae5b5 | 13 | %define php_min_version 5.3.4 |
fc4ae5b5 ER |
14 | %include /usr/lib/rpm/macros.php |
15 | Summary: Dependency Manager for PHP | |
734cea69 | 16 | Name: composer |
fc4ae5b5 | 17 | Version: 1.0.0 |
b0da7bb7 | 18 | Release: %{rel}.%{subver}%{?commits:.%{commits}}%{?githash:.g%{githash}} |
fc4ae5b5 ER |
19 | License: MIT |
20 | Group: Development/Languages/PHP | |
b0da7bb7 ER |
21 | #Source0: https://github.com/composer/composer/archive/%{githash}/%{name}-%{version}-%{subver}-%{commits}-g%{githash}.tar.gz |
22 | Source0: https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz | |
1fe17f86 | 23 | # Source0-md5: 5e4ff16cff75fae31285196c5f51a8f8 |
084e990b ER |
24 | Source2: https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer |
25 | # Source2-md5: cdeebf0a0da1fd07d0fd886d0461642e | |
65715e5b | 26 | Source3: autoload.php |
78d564c2 ER |
27 | Patch0: autoload.patch |
28 | Patch1: update-memory-limit.patch | |
29 | Patch2: svn-ignore-externals.patch | |
b85b6bee | 30 | Patch3: version.patch |
fc4ae5b5 ER |
31 | URL: http://www.getcomposer.org/ |
32 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 | |
084e990b | 33 | BuildRequires: rpmbuild(macros) >= 1.673 |
24c65dc2 | 34 | %if %{with tests} |
6c91c8fc | 35 | BuildRequires: composer |
24c65dc2 ER |
36 | BuildRequires: phpab |
37 | BuildRequires: phpunit | |
38 | %endif | |
fc4ae5b5 | 39 | Requires: php(core) >= %{php_min_version} |
64350575 ER |
40 | Requires: php(ctype) |
41 | Requires: php(date) | |
42 | Requires: php(filter) | |
fd5fce61 | 43 | Requires: php(hash) |
64350575 | 44 | Requires: php(json) |
b8b478bb | 45 | Requires: php(openssl) |
64350575 | 46 | Requires: php(pcre) |
d0052d6c | 47 | Requires: php(phar) |
154bbfb4 | 48 | Requires: php(posix) |
64350575 ER |
49 | Requires: php(simplexml) |
50 | Requires: php(spl) | |
b8b478bb | 51 | Requires: php(zip) |
d5534972 | 52 | Requires: php(zlib) |
ef9d1aaf ER |
53 | Requires: php-composer-semver >= 1.0.0 |
54 | Requires: php-composer-spdx-licenses >= 1.0.0 | |
b0da7bb7 | 55 | Requires: php-justinrainbow-json-schema >= 1.4 |
c09cb1dd | 56 | Requires: php-seld-jsonlint >= 1.1.2 |
ef9d1aaf | 57 | Requires: php-seld-phar-utils >= 1.0.0 |
65715e5b ER |
58 | Requires: php-symfony2-ClassLoader >= 2.7.7 |
59 | Requires: php-symfony2-Console >= 2.7.7 | |
60 | Requires: php-symfony2-Finder >= 2.7.7 | |
61 | Requires: php-symfony2-Process >= 2.7.7 | |
ce708d4d | 62 | Suggests: bash-completion-%{name} |
a9025f5d ER |
63 | Suggests: git-core |
64 | Suggests: mercurial | |
a9025f5d | 65 | Suggests: subversion |
fc4ae5b5 ER |
66 | BuildArch: noarch |
67 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
68 | ||
69 | %description | |
d9257928 ER |
70 | Composer is a tool for dependency management in PHP. |
71 | ||
72 | Composer helps you declare, manage and install dependencies of PHP | |
73 | projects, ensuring you have the right stack everywhere. | |
fc4ae5b5 | 74 | |
084e990b ER |
75 | %package -n bash-completion-%{name} |
76 | Summary: Bash completion for Composer | |
77 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Composera | |
78 | Group: Applications/Shells | |
79 | Requires: %{name} | |
80 | Requires: bash-completion >= 2.0 | |
81 | ||
82 | %description -n bash-completion-%{name} | |
83 | Bash completion for Composer package and dependency manager. | |
84 | ||
85 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
86 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera. | |
87 | ||
fc4ae5b5 | 88 | %prep |
ee5e3da9 ER |
89 | %setup -qc -n %{name}-%{version}-%{release} |
90 | mv composer-*/* . | |
78d564c2 ER |
91 | %patch0 -p1 |
92 | %patch1 -p1 | |
93 | %patch2 -p1 | |
b85b6bee | 94 | %patch3 -p1 |
7e4a1874 | 95 | |
89da5e62 | 96 | mv composer.lock{,.disabled} |
5d101a0e ER |
97 | # NOTE: do not use %{__php} macro here, need unversioned php binary |
98 | %{__sed} -i -e '1s,^#!.*env php,#!/usr/bin/php,' bin/* | |
a2a560b6 | 99 | |
65715e5b ER |
100 | cp -p %{SOURCE3} src/Composer/autoload.php |
101 | ||
1295fc99 ER |
102 | # AutoloadGenerator needs this runtime |
103 | mv LICENSE res | |
104 | ||
9fe8f2af ER |
105 | # move to Composer dir, this will simplify testing |
106 | mv res src/Composer | |
107 | ln -s src/Composer/res | |
108 | ||
e3a33933 ER |
109 | # cleanup backups after patching |
110 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
111 | ||
e0a76144 ER |
112 | # needs newer phpunit: |
113 | # missing method PHPUnit_Framework_MockObject_Builder_InvocationMocker::willReturn() | |
114 | rm tests/Composer/Test/EventDispatcher/EventDispatcherTest.php | |
115 | rm tests/Composer/Test/IO/ConsoleIOTest.php | |
116 | rm tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php | |
117 | rm tests/Composer/Test/Package/RootAliasPackageTest.php | |
118 | rm tests/Composer/Test/Package/Version/VersionGuesserTest.php | |
119 | rm tests/Composer/Test/Util/GitHubTest.php | |
120 | ||
24c65dc2 ER |
121 | %build |
122 | %if %{with tests} | |
123 | phpab -n -o src/bootstrap.php -e '*/Fixtures/*' src/ tests/ | |
124 | echo "require 'src/Composer/autoload.php';" >> src/bootstrap.php | |
125 | phpunit | |
126 | %endif | |
127 | ||
fc4ae5b5 ER |
128 | %install |
129 | rm -rf $RPM_BUILD_ROOT | |
65715e5b ER |
130 | install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer,/var/cache/composer} |
131 | cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir} | |
65715e5b | 132 | install -p bin/composer $RPM_BUILD_ROOT%{_bindir}/%{name} |
fc4ae5b5 | 133 | |
084e990b ER |
134 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
135 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{bash_compdir}/composer | |
136 | ||
fc4ae5b5 ER |
137 | %clean |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
140 | %files | |
141 | %defattr(644,root,root,755) | |
1295fc99 ER |
142 | %doc README.md CHANGELOG.md PORTING_INFO |
143 | %doc src/Composer/res/LICENSE | |
fc4ae5b5 | 144 | %attr(755,root,root) %{_bindir}/composer |
65715e5b | 145 | %{php_data_dir}/Composer |
084e990b | 146 | |
fd4b4dad ER |
147 | # top level cachedir, create user cache dirs here manually |
148 | %dir %attr(711,root,http) /var/cache/composer | |
149 | ||
084e990b ER |
150 | %files -n bash-completion-%{name} |
151 | %defattr(644,root,root,755) | |
152 | %{bash_compdir}/composer |