summaryrefslogtreecommitdiffstats
path: root/php-jms-serializer.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-09-25 07:35:18 +0200
committerRemi Collet <remi@remirepo.net>2017-09-25 07:35:18 +0200
commita33673e63e7e85740df0b340eafb96c8682a084a (patch)
tree86f85365e9b0728e9c3ffda6206d18c95790c34f /php-jms-serializer.spec
parent30440a731d3126f568d58b22a534fe92fee858a0 (diff)
backport stuff
Diffstat (limited to 'php-jms-serializer.spec')
-rw-r--r--php-jms-serializer.spec20
1 files changed, 16 insertions, 4 deletions
diff --git a/php-jms-serializer.spec b/php-jms-serializer.spec
index 79eb595..3923771 100644
--- a/php-jms-serializer.spec
+++ b/php-jms-serializer.spec
@@ -1,3 +1,4 @@
+# remirepo spec file for php-jms-serializer, from
#
# Fedora spec file for php-jms-serializer
#
@@ -58,7 +59,11 @@
# "twig/twig": "~1.12|~2.0"
# NOTE: Min version not 1.12 because autoloader required
%global twig_min_ver 1.18.2
+%if 0%{?fedora} >= 25
%global twig_max_ver 3.0
+%else
+%global twig_max_ver 2.0
+%endif
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -153,10 +158,12 @@ Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
+%if 0%{?fedora}
# Weak dependencies
Suggests: php-composer(symfony/yaml)
Suggests: php-composer(doctrine/collections)
Suggests: php-composer(cache)
+%endif
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -233,6 +240,14 @@ require '%{buildroot}%{phpdir}/JMS/Serializer/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('JMS\\Serializer\\Tests\\', __DIR__.'/tests');
+if (PHP_VERSION_ID < 70000) {
+ $twig = '%{phpdir}/Twig/autoload.php';
+} else {
+ $twig = [
+ '%{phpdir}/Twig2/autoload.php',
+ '%{phpdir}/Twig/autoload.php',
+ ];
+}
\Fedora\Autoloader\Dependencies::required([
'%{phpdir}/Doctrine/ORM/autoload.php',
'%{phpdir}/Symfony/Component/ExpressionLanguage/autoload.php',
@@ -240,10 +255,7 @@ require '%{buildroot}%{phpdir}/JMS/Serializer/autoload.php';
'%{phpdir}/Symfony/Component/Form/autoload.php',
'%{phpdir}/Symfony/Component/Translation/autoload.php',
'%{phpdir}/Symfony/Component/Validator/autoload.php',
- [
- '%{phpdir}/Twig2/autoload.php',
- '%{phpdir}/Twig/autoload.php',
- ],
+ $twig,
]);
use Doctrine\Common\Annotations\AnnotationRegistry;