]> git.pld-linux.org Git - packages/composer.git/blobdiff - composer.spec
woot, 1.0.0 stable release
[packages/composer.git] / composer.spec
index 94f74aa5244ead79ad41d6488518f97bc62b4ecb..aa598a5b84778948b8276f99bf7e0ffafbef2d5a 100644 (file)
@@ -1,31 +1,37 @@
+#
+# Conditional build:
+%bcond_without tests           # build with tests
+
 # NOTE
 # - release tarballs: http://getcomposer.org/download/
 
-%define                rel             14
-#define                githash 5744981
-# $ git rev-list 1.0.0-alpha11..%{githash} --count
-#define                commits 216
-%define                subver  alpha11
 %define                php_min_version 5.3.4
 %include       /usr/lib/rpm/macros.php
 Summary:       Dependency Manager for PHP
 Name:          composer
 Version:       1.0.0
-Release:       %{rel}.%{subver}%{?commits:.%{commits}}%{?githash:.g%{githash}}
+Release:       18
 License:       MIT
 Group:         Development/Languages/PHP
-#Source0:       https://github.com/composer/composer/archive/%{githash}/%{name}-%{version}-%{subver}-%{commits}-g%{githash}.tar.gz
-Source0:       https://github.com/composer/composer/archive/%{version}-%{subver}/%{name}-%{version}-%{subver}.tar.gz
-# Source0-md5: 5e4ff16cff75fae31285196c5f51a8f8
+Source0:       https://github.com/composer/composer/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 9705bcf15d272acad2169a9b369cafd9
 Source2:       https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer
 # Source2-md5: cdeebf0a0da1fd07d0fd886d0461642e
 Source3:       autoload.php
 Patch0:                autoload.patch
 Patch1:                update-memory-limit.patch
 Patch2:                svn-ignore-externals.patch
+Patch3:                version.patch
 URL:           http://www.getcomposer.org/
+BuildRequires: php-devel
 BuildRequires: rpm-php-pearprov >= 4.4.2-11
 BuildRequires: rpmbuild(macros) >= 1.673
+%if %{with tests}
+BuildRequires: composer >= 1.0.0-17.beta1
+BuildRequires: git-core
+BuildRequires: phpab
+BuildRequires: phpunit
+%endif
 Requires:      php(core) >= %{php_min_version}
 Requires:      php(ctype)
 Requires:      php(date)
@@ -42,8 +48,9 @@ Requires:     php(zip)
 Requires:      php(zlib)
 Requires:      php-composer-semver >= 1.0.0
 Requires:      php-composer-spdx-licenses >= 1.0.0
-Requires:      php-justinrainbow-json-schema >= 1.4
-Requires:      php-seld-jsonlint >= 1.1.2
+Requires:      php-justinrainbow-json-schema >= 1.6
+Requires:      php-seld-cli-prompt >= 1.0.0
+Requires:      php-seld-jsonlint >= 1.4
 Requires:      php-seld-phar-utils >= 1.0.0
 Requires:      php-symfony2-ClassLoader >= 2.7.7
 Requires:      php-symfony2-Console >= 2.7.7
@@ -81,6 +88,7 @@ mv composer-*/* .
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 mv composer.lock{,.disabled}
 # NOTE: do not use %{__php} macro here, need unversioned php binary
@@ -88,14 +96,42 @@ mv composer.lock{,.disabled}
 
 cp -p %{SOURCE3} src/Composer/autoload.php
 
+# AutoloadGenerator needs this runtime
+mv LICENSE res
+
+# move to Composer dir, this will simplify testing
+mv res src/Composer
+ln -s src/Composer/res
+
 # cleanup backups after patching
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
+# needs newer phpunit:
+# missing method PHPUnit_Framework_MockObject_Builder_InvocationMocker::willReturn()
+rm tests/Composer/Test/ApplicationTest.php
+rm tests/Composer/Test/EventDispatcher/EventDispatcherTest.php
+rm tests/Composer/Test/IO/ConsoleIOTest.php
+rm tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php
+rm tests/Composer/Test/Package/RootAliasPackageTest.php
+rm tests/Composer/Test/Package/Version/VersionGuesserTest.php
+rm tests/Composer/Test/Util/GitHubTest.php
+rm tests/Composer/Test/Util/GitLabTest.php
+# method PHPUnit_Framework_MockObject_Builder_InvocationMocker::withConsecutive()
+rm tests/Composer/Test/Util/BitbucketTest.php
+# Call to undefined method Composer\Test\Repository\Vcs\GitLabDriverTest::prophesize()
+rm tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php
+
+%build
+%if %{with tests}
+phpab -n -o src/bootstrap.php -e '*/Fixtures/*' src/ tests/
+echo "require 'src/Composer/autoload.php';" >> src/bootstrap.php
+phpunit
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_bindir},%{php_data_dir}/Composer,/var/cache/composer}
 cp -a src/Composer $RPM_BUILD_ROOT%{php_data_dir}
-cp -a res $RPM_BUILD_ROOT%{php_data_dir}/Composer
 install -p bin/composer $RPM_BUILD_ROOT%{_bindir}/%{name}
 
 install -d $RPM_BUILD_ROOT%{bash_compdir}
@@ -106,7 +142,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README.md CHANGELOG.md LICENSE PORTING_INFO
+%doc README.md CHANGELOG.md PORTING_INFO
+%doc src/Composer/res/LICENSE
 %attr(755,root,root) %{_bindir}/composer
 %{php_data_dir}/Composer
 
This page took 0.062716 seconds and 4 git commands to generate.