summaryrefslogtreecommitdiffstats
path: root/php-Metadata.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-Metadata.spec')
-rw-r--r--php-Metadata.spec71
1 files changed, 56 insertions, 15 deletions
diff --git a/php-Metadata.spec b/php-Metadata.spec
index 699052b..127f728 100644
--- a/php-Metadata.spec
+++ b/php-Metadata.spec
@@ -1,19 +1,38 @@
+#
+# RPM spec file for php-Metadata
+#
+# Copyright (c) 2013-2014 Shawn Iwinski <shawn.iwinski@gmail.com>
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please preserve changelog entries
+#
+
%global github_owner schmittjoh
%global github_name metadata
-%global github_version 1.5.0
-%global github_commit 88ffa28bc987e4c26229fc84a2e541b6ed4e1459
+%global github_version 1.5.1
+%global github_commit 22b72455559a25777cfd28c4ffda81ff7639f353
+
+%global composer_vendor jms
+%global composer_project metadata
-%global lib_name Metadata
+%global lib_name Metadata
# "php": ">=5.3.0"
-%global php_min_ver 5.3.0
+%global php_min_ver 5.3.0
# "doctrine/cache" : "~1.0"
%global doctrine_cache_min_ver 1.0
%global doctrine_cache_max_ver 2.0
+# Build using "--without tests" to disable tests
+%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+
+%{!?__phpunit: %global __phpunit %{_bindir}/phpunit}
+
Name: php-%{lib_name}
Version: %{github_version}
-Release: 2%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: A library for class/method/property metadata management in PHP
Group: Development/Libraries
@@ -23,27 +42,32 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{githu
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
+%if %{with_tests}
# For tests
BuildRequires: php-phpunit-PHPUnit
# For tests: composer.json
-BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-doctrine-cache >= %{doctrine_cache_min_ver}
-BuildRequires: php-doctrine-cache < %{doctrine_cache_max_ver}
-# For tests: phpcompatinfo (computed from version 1.5.0)
+BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
+BuildRequires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
+# For tests: phpcompatinfo (computed from version 1.5.1)
BuildRequires: php-date
BuildRequires: php-reflection
BuildRequires: php-spl
+%endif
-Requires: php-doctrine-cache >= %{doctrine_cache_min_ver}
-Requires: php-doctrine-cache < %{doctrine_cache_max_ver}
+Requires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
+Requires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
Requires: php-symfony-dependencyinjection
# composer.json
-Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.5.0)
+Requires: php(language) >= %{php_min_ver}
+# phpcompatinfo (computed from version 1.5.1)
Requires: php-date
Requires: php-reflection
Requires: php-spl
+# Composer
+Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
+
%description
This library provides some commonly needed base classes for managing metadata
for classes, methods and properties. The metadata can come from many different
@@ -62,11 +86,13 @@ interface for all of them.
%install
+rm -rf %{buildroot}
mkdir -pm 0755 %{buildroot}%{_datadir}/php
cp -rp src/%{lib_name} %{buildroot}%{_datadir}/php/
%check
+%if %{with_tests}
# Rewrite tests' bootstrap
cat > tests/bootstrap.php <<'BOOTSTRAP'
<?php
@@ -79,16 +105,31 @@ BOOTSTRAP
# Create PHPUnit config w/ colors turned off
sed 's/colors\s*=\s*"true"/colors="false"/' phpunit.xml.dist > phpunit.xml
-%{_bindir}/phpunit --include-path="./src:./tests"
+%{__phpunit} --include-path="./src:./tests" -d date.timezone="UTC"
+%else
+: Tests skipped
+%endif
+%clean
+rm -rf %{buildroot}
+
+
+%{!?_licensedir:%global license %%doc}
+
%files
%defattr(-,root,root,-)
-%doc LICENSE README.rst CHANGELOG.md composer.json
+%license LICENSE
+%doc README.rst CHANGELOG.md composer.json
%{_datadir}/php/%{lib_name}
%changelog
+* Sat Jul 19 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.5.1-1
+- Updated to 1.5.1 (BZ #1119425)
+- Added "php-composer(jms/metadata)" virtual provide
+- Added option to build without tests ("--without tests")
+
* Mon Jun 2 2014 Remi Collet <RPMS@famillecollet.com> 1.5.0-2
- merge rawhide change