summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json9
l---------makesrc.sh1
-rw-r--r--php-jms-serializer.spec95
3 files changed, 90 insertions, 15 deletions
diff --git a/composer.json b/composer.json
index 13251ad..62caf3d 100644
--- a/composer.json
+++ b/composer.json
@@ -4,7 +4,7 @@
"description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.",
"keywords": ["serialization", "deserialization", "json", "jaxb", "xml"],
"homepage": "http://jmsyst.com/libs/serializer",
- "license": "Apache-2.0",
+ "license": "MIT",
"authors": [
{
"name": "Johannes M. Schmitt",
@@ -16,8 +16,8 @@
}
],
"require": {
- "php": ">=5.5.0",
- "jms/metadata": "~1.1",
+ "php": "^5.5|^7.0",
+ "jms/metadata": "^1.3",
"jms/parser-lib": "1.*",
"phpoption/phpoption": "^1.1",
"phpcollection/phpcollection": "~0.1",
@@ -25,7 +25,6 @@
"doctrine/instantiator": "^1.0.3"
},
"conflict": {
- "jms/serializer-bundle": "<1.2.1",
"twig/twig": "<1.12"
},
"suggest": {
@@ -62,7 +61,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.10-dev"
+ "dev-1.x": "1.14-dev"
}
}
}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 120000
index 0000000..7f5a70b
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1 @@
+php-jms-serializer-get-source.sh \ No newline at end of file
diff --git a/php-jms-serializer.spec b/php-jms-serializer.spec
index 1dd02bf..b2bd532 100644
--- a/php-jms-serializer.spec
+++ b/php-jms-serializer.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-jms-serializer
#
-# Copyright (c) 2017-2019 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2017-2020 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,12 +12,19 @@
%global github_owner schmittjoh
%global github_name serializer
-%global github_version 1.10.0
+%global github_version 1.14.1
%global github_commit 62c7ff6d61f8692eac8be024c542b3d9d0ab8c8a
%global composer_vendor jms
%global composer_project serializer
+# Deprecate Symfony 2 on Fedora 32+ and EPEL 8+
+%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
+%global with_symfony2 0
+%else
+%global with_symfony2 1
+%endif
+
# "php": ">=5.5.0"
%global php_min_ver 5.5.0
# "doctrine/annotations": "^1.0"
@@ -57,8 +64,12 @@
# "symfony/translation": "^2.1|^3.0"
# "symfony/validator": "^2.2|^3.0"
# "symfony/yaml": "^2.1|^3.0"
+%if %{with_symfony2}
# NOTE: Min version not 2.6 because autoloader required
%global symfony_min_ver 2.7.1
+%else
+%global symfony_min_ver 3.3
+%endif
%global symfony_max_ver 4.0
# "twig/twig": "~1.12|~2.0"
# NOTE: Min version not 1.12 because autoloader required
@@ -72,14 +83,27 @@
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
+# Range dependencies supported?
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+%global with_range_dependencies 1
+%else
+%global with_range_dependencies 0
+%endif
+
+# Weak dependencies supported?
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+%global with_weak_dependencies 1
+%else
+%global with_weak_dependencies 0
+%endif
+
%{!?phpdir: %global phpdir %{_datadir}/php}
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 5%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: Library for (de-)serializing data of any complexity
-Group: Development/Libraries
License: ASL 2.0
URL: http://jmsyst.com/libs/serializer
@@ -94,6 +118,25 @@ BuildArch: noarch
BuildRequires: php-cli
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(phpunit/phpunit)
+%if %{with_range_dependencies}
+BuildRequires: (php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver} with php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver})
+BuildRequires: (php-composer(doctrine/instantiator) >= %{doctrine_instantiator_min_ver} with php-composer(doctrine/instantiator) < %{doctrine_instantiator_max_ver})
+BuildRequires: (php-composer(doctrine/orm) >= %{doctrine_orm_min_ver} with php-composer(doctrine/orm) < %{doctrine_orm_max_ver})
+BuildRequires: (php-composer(jms/metadata) >= %{jms_metadata_min_ver} with php-composer(jms/metadata) < %{jms_metadata_max_ver})
+BuildRequires: (php-JMSParser >= %{jms_parser_lib_min_ver} with php-composer(jms/parser-lib) < %{jms_parser_lib_max_ver})
+BuildRequires: (php-composer(phpcollection/phpcollection) >= %{phpcollection_min_ver} with php-composer(phpcollection/phpcollection) < %{phpcollection_max_ver})
+BuildRequires: (php-composer(phpoption/phpoption) >= %{phpoption_min_ver} with php-composer(phpoption/phpoption) < %{phpoption_max_ver})
+BuildRequires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver})
+BuildRequires: (php-composer(symfony/dependency-injection) >= %{symfony_min_ver} with php-composer(symfony/dependency-injection) < %{symfony_max_ver})
+BuildRequires: (php-composer(symfony/expression-language) >= %{symfony_min_ver} with php-composer(symfony/expression-language) < %{symfony_max_ver})
+BuildRequires: (php-composer(symfony/filesystem) >= %{symfony_min_ver} with php-composer(symfony/filesystem) < %{symfony_max_ver})
+BuildRequires: (php-composer(symfony/form) >= %{symfony_min_ver} with php-composer(symfony/form) < %{symfony_max_ver})
+BuildRequires: (php-composer(symfony/translation) >= %{symfony_min_ver} with php-composer(symfony/translation) < %{symfony_max_ver})
+BuildRequires: (php-composer(symfony/validator) >= %{symfony_min_ver} with php-composer(symfony/validator) < %{symfony_max_ver})
+BuildRequires: (php-composer(symfony/yaml) >= %{symfony_min_ver} with php-composer(symfony/yaml) < %{symfony_max_ver})
+BuildRequires: (php-composer(twig/twig) >= %{twig_min_ver} with php-composer(twig/twig) < %{twig_max_ver})
+%else
BuildRequires: php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver}
BuildRequires: php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver}
BuildRequires: php-composer(doctrine/instantiator) < %{doctrine_instantiator_max_ver}
@@ -109,7 +152,6 @@ BuildRequires: php-composer(phpcollection/phpcollection) < %{phpcollection_max_
BuildRequires: php-composer(phpcollection/phpcollection) >= %{phpcollection_min_ver}
BuildRequires: php-composer(phpoption/phpoption) < %{phpoption_max_ver}
BuildRequires: php-composer(phpoption/phpoption) >= %{phpoption_min_ver}
-BuildRequires: php-composer(phpunit/phpunit)
BuildRequires: php-composer(psr/container) < %{psr_container_max_ver}
BuildRequires: php-composer(psr/container) >= %{psr_container_min_ver}
BuildRequires: php-composer(symfony/dependency-injection) < %{symfony_max_ver}
@@ -121,7 +163,10 @@ BuildRequires: php-composer(symfony/validator) < %{symfony_max_ver}
BuildRequires: php-composer(symfony/yaml) < %{symfony_max_ver}
BuildRequires: php-composer(twig/twig) < %{twig_max_ver}
BuildRequires: php-composer(twig/twig) >= %{twig_min_ver}
-## phpcompatinfo (computed from version 1.7.1)
+%endif
+## phpcompatinfo (computed from version 1.14.1)
+BuildRequires: php-composer(doctrine/cache) < 2
+BuildRequires: php-composer(doctrine/persistence) < 2
BuildRequires: php-date
BuildRequires: php-dom
BuildRequires: php-json
@@ -136,6 +181,14 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
+%if %{with_range_dependencies}
+Requires: (php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver} with php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver})
+Requires: (php-composer(doctrine/instantiator) >= %{doctrine_instantiator_min_ver} with php-composer(doctrine/instantiator) < %{doctrine_instantiator_max_ver})
+Requires: (php-composer(jms/metadata) >= %{jms_metadata_min_ver} with php-composer(jms/metadata) < %{jms_metadata_max_ver})
+Requires: (php-JMSParser >= %{jms_parser_lib_min_ver} with php-composer(jms/parser-lib) < %{jms_parser_lib_max_ver})
+Requires: (php-composer(phpcollection/phpcollection) >= %{phpcollection_min_ver} with php-composer(phpcollection/phpcollection) < %{phpcollection_max_ver})
+Requires: (php-composer(phpoption/phpoption) >= %{phpoption_min_ver} with php-composer(phpoption/phpoption) < %{phpoption_max_ver})
+%else
Requires: php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver}
Requires: php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver}
Requires: php-composer(doctrine/instantiator) < %{doctrine_instantiator_max_ver}
@@ -149,7 +202,9 @@ Requires: php-composer(phpcollection/phpcollection) < %{phpcollection_max_
Requires: php-composer(phpcollection/phpcollection) >= %{phpcollection_min_ver}
Requires: php-composer(phpoption/phpoption) < %{phpoption_max_ver}
Requires: php-composer(phpoption/phpoption) >= %{phpoption_min_ver}
-# phpcompatinfo (computed from version 1.7.1)
+%endif
+# phpcompatinfo (computed from version 1.14.1)
+Requires: php-composer(doctrine/persistence) < 2
Requires: php-date
Requires: php-dom
Requires: php-json
@@ -160,11 +215,11 @@ Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
-%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+%if %{with_weak_dependencies}
# Weak dependencies
Suggests: php-composer(symfony/yaml)
Suggests: php-composer(doctrine/collections)
-Suggests: php-composer(cache)
+Suggests: php-composer(doctrine/cache)
%endif
# Composer
@@ -213,6 +268,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required([
'%{phpdir}/Doctrine/Common/Annotations/autoload.php',
+ '%{phpdir}/Doctrine/Common/Persistence/autoload.php',
'%{phpdir}/Doctrine/Instantiator/autoload.php',
'%{phpdir}/JMS/Parser/autoload.php',
'%{phpdir}/Metadata/autoload.php',
@@ -223,10 +279,14 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::optional([
'%{phpdir}/Doctrine/Common/Cache/autoload.php',
'%{phpdir}/Doctrine/Common/Collections/autoload.php',
+%if %{with_symfony2}
[
'%{phpdir}/Symfony3/Component/Yaml/autoload.php',
'%{phpdir}/Symfony/Component/Yaml/autoload.php',
],
+%else
+ '%{phpdir}/Symfony3/Component/Yaml/autoload.php',
+%endif
]);
AUTOLOAD
@@ -248,6 +308,7 @@ require '%{buildroot}%{phpdir}/JMS/Serializer/autoload.php';
\Fedora\Autoloader\Dependencies::required([
'%{phpdir}/Doctrine/ORM/autoload.php',
'%{phpdir}/Psr/Container/autoload.php',
+%if %{with_symfony2}
[
'%{phpdir}/Symfony3/Component/DependencyInjection/autoload.php',
'%{phpdir}/Symfony/Component/DependencyInjection/autoload.php',
@@ -272,6 +333,14 @@ require '%{buildroot}%{phpdir}/JMS/Serializer/autoload.php';
'%{phpdir}/Symfony3/Component/Validator/autoload.php',
'%{phpdir}/Symfony/Component/Validator/autoload.php',
],
+%else
+ '%{phpdir}/Symfony3/Component/DependencyInjection/autoload.php',
+ '%{phpdir}/Symfony3/Component/ExpressionLanguage/autoload.php',
+ '%{phpdir}/Symfony3/Component/Filesystem/autoload.php',
+ '%{phpdir}/Symfony3/Component/Form/autoload.php',
+ '%{phpdir}/Symfony3/Component/Translation/autoload.php',
+ '%{phpdir}/Symfony3/Component/Validator/autoload.php',
+%endif
(PHP_VERSION_ID < 70000)
? '%{phpdir}/Twig/autoload.php'
: [
@@ -291,7 +360,7 @@ sed 's/function testInlineArray/function SKIP_testInlineArray/' \
: Upstream tests
RETURN_CODE=0
PHPUNIT=$(which phpunit)
-for PHP_EXEC in php php71 php72 php73; do
+for PHP_EXEC in php php72 php73 php74; do
if [ "php" = "$PHP_EXEC" ] || which $PHP_EXEC; then
if [ $($PHP_EXEC -r 'echo PHP_VERSION_ID;') -lt 70200 ]; then
sed \
@@ -318,6 +387,12 @@ exit $RETURN_CODE
%changelog
+* Tue Aug 18 2020 Shawn Iwinski <shawn@iwin.ski> - 1.14.1-1
+- Update to 1.14.1
+- Fix FTBFS (RHBZ #1865219)
+- Conditionally use range dependencies
+- Conditionally drop Symfony 2 interoperability
+
* Tue Feb 26 2019 Remi Collet <remi@remirepo.net> - 1.10.0-5
- cleanup for EL-8