summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json14
-rw-r--r--php-doctrine-dbal3-bin.patch40
-rw-r--r--php-doctrine-dbal3.spec93
3 files changed, 83 insertions, 64 deletions
diff --git a/composer.json b/composer.json
index 2571ac4..0909566 100644
--- a/composer.json
+++ b/composer.json
@@ -18,7 +18,6 @@
"queryobject",
"sasql",
"sql",
- "sqlanywhere",
"sqlite",
"sqlserver",
"sqlsrv"
@@ -32,8 +31,8 @@
{"name": "Jonathan Wage", "email": "jonwage@gmail.com"}
],
"require": {
- "php": "^7.3 || ^8",
- "ext-pdo": "*",
+ "php": "^7.3 || ^8.0",
+ "composer/package-versions-deprecated": "^1.11.99",
"doctrine/cache": "^1.0",
"doctrine/event-manager": "^1.0"
},
@@ -41,6 +40,7 @@
"doctrine/coding-standard": "^8.1",
"jetbrains/phpstorm-stubs": "^2019.1",
"phpstan/phpstan": "^0.12.40",
+ "phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.4",
"psalm/plugin-phpunit": "^0.10.0",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
@@ -51,16 +51,16 @@
},
"bin": ["bin/doctrine-dbal"],
"config": {
- "sort-packages": true,
"platform": {
"php": "7.3.0"
- }
+ },
+ "sort-packages": true
},
"autoload": {
- "psr-4": { "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" }
+ "psr-4": { "Doctrine\\DBAL\\": "src" }
},
"autoload-dev": {
- "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" }
+ "psr-4": { "Doctrine\\DBAL\\Tests\\": "tests" }
},
"extra": {
"branch-alias": {
diff --git a/php-doctrine-dbal3-bin.patch b/php-doctrine-dbal3-bin.patch
index 2d1269f..0f12483 100644
--- a/php-doctrine-dbal3-bin.patch
+++ b/php-doctrine-dbal3-bin.patch
@@ -1,24 +1,16 @@
diff -up ./bin/doctrine-dbal.php.rpm ./bin/doctrine-dbal.php
---- ./bin/doctrine-dbal.php.rpm 2020-09-21 12:14:14.995837618 +0200
-+++ ./bin/doctrine-dbal.php 2020-09-21 12:16:37.888455856 +0200
-@@ -1,27 +1,22 @@
+--- ./bin/doctrine-dbal.php.rpm 2020-11-16 12:02:16.000000000 +0100
++++ ./bin/doctrine-dbal.php 2020-11-16 12:21:56.895094784 +0100
+@@ -1,25 +1,14 @@
+#!/usr/bin/env php
<?php
-+require_once '/usr/share/php/Doctrine/Common/ClassLoader.php';
-+
-+$classLoaderDoctrine = new \Doctrine\Common\ClassLoader('Doctrine');
-+$classLoaderDoctrine->register();
-+
-+$classLoaderSymfony = new \Doctrine\Common\ClassLoader('Symfony');
-+$classLoaderSymfony->register();
-+
- use Doctrine\DBAL\Tools\Console\ConnectionProvider;
use Doctrine\DBAL\Tools\Console\ConsoleRunner;
- use Symfony\Component\Console\Helper\HelperSet;
-$files = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php'];
-$loader = null;
++require '/usr/share/php/Doctrine/DBAL3/autoload.php';
++
$cwd = getcwd();
$directories = [$cwd, $cwd . DIRECTORY_SEPARATOR . 'config'];
$configFile = null;
@@ -38,3 +30,25 @@ diff -up ./bin/doctrine-dbal.php.rpm ./bin/doctrine-dbal.php
foreach ($directories as $directory) {
$configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php';
+diff -up ./src/Tools/Console/ConsoleRunner.php.rpm ./src/Tools/Console/ConsoleRunner.php
+--- ./src/Tools/Console/ConsoleRunner.php.rpm 2020-11-16 12:07:38.948729149 +0100
++++ ./src/Tools/Console/ConsoleRunner.php 2020-11-16 12:08:24.685526402 +0100
+@@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Tools\Console;
+ use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand;
+ use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
+ use Exception;
+-use PackageVersions\Versions;
+ use Symfony\Component\Console\Application;
+ use Symfony\Component\Console\Command\Command;
+
+@@ -25,9 +24,7 @@ class ConsoleRunner
+ */
+ public static function run(ConnectionProvider $connectionProvider, $commands = [])
+ {
+- $cli = new Application('Doctrine Command Line Interface', Versions::getVersion(
+- Versions::rootPackageName()
+- ));
++ $cli = new Application('Doctrine Command Line Interface', '@VERSION@');
+
+ $cli->setCatchExceptions(true);
+ self::addCommands($cli, $connectionProvider);
diff --git a/php-doctrine-dbal3.spec b/php-doctrine-dbal3.spec
index 5d93176..86cd072 100644
--- a/php-doctrine-dbal3.spec
+++ b/php-doctrine-dbal3.spec
@@ -13,8 +13,9 @@
%global github_owner doctrine
%global github_name dbal
-%global github_version 2.12.1
-%global github_commit adce7a954a1c2f14f85e94aed90c8489af204086
+%global github_version 3.0.0
+%global github_commit ee6d1260d5cc20ec506455a585945d7bdb98662c
+%global major 3
%global composer_vendor doctrine
%global composer_project dbal
@@ -28,15 +29,16 @@
%global doctrine_event_min_ver 1.0
%global doctrine_event_max_ver 2
# "symfony/console": "^2.0.5|^3.0|^4.0|^5.0"
-%global symfony_console_min_ver 2.0.5
-%global symfony_console_max_ver 5
+# ignore v2
+%global symfony_console_min_ver 3.0
+%global symfony_console_max_ver 6
%{!?phpdir: %global phpdir %{_datadir}/php}
# Build using "--without tests" to disable tests
%bcond_without tests
-Name: php-%{composer_vendor}-%{composer_project}
+Name: php-%{composer_vendor}-%{composer_project}%{major}
Version: %{github_version}
Release: 1%{?github_release}%{?dist}
Summary: Doctrine Database Abstraction Layer (DBAL)
@@ -67,20 +69,21 @@ BuildRequires:(php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver}
BuildRequires:(php-composer(symfony/console) >= %{symfony_console_min_ver} with php-composer(symfony/console) < %{symfony_console_max_ver})
# remirepo:9
%else
-BuildRequires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
-BuildRequires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
-BuildRequires: php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver}
-BuildRequires: php-composer(doctrine/event-manager) < %{doctrine_event_max_ver}
+BuildRequires: php-doctrine-cache >= %{doctrine_cache_min_ver}
+BuildRequires: php-doctrine-cache < %{doctrine_cache_max_ver}
+BuildRequires: php-doctrine-event-manager >= %{doctrine_event_min_ver}
+BuildRequires: php-doctrine-event-manager < %{doctrine_event_max_ver}
## composer.json (optional)
-BuildRequires: php-composer(symfony/console) >= %{symfony_console_min_ver}
-BuildRequires: php-composer(symfony/console) < %{symfony_console_max_ver}
+BuildRequires: php-symfony4-console >= %{symfony_console_min_ver}
+BuildRequires: php-symfony4-console < %{symfony_console_max_ver}
%endif
-## phpcompatinfo (computed from version 2.12)
+## phpcompatinfo (computed from version 3.0)
BuildRequires: php-date
-BuildRequires: php-json
BuildRequires: php-hash
+BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-pdo
+BuildRequires: php-posix
BuildRequires: php-reflection
BuildRequires: php-spl
## Autoloader
@@ -97,32 +100,27 @@ Requires: (php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver}
Requires: (php-composer(symfony/console) >= %{symfony_console_min_ver} with php-composer(symfony/console) < %{symfony_console_max_ver})
# remirepo:9
%else
-Requires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
-Requires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
-Requires: php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver}
-Requires: php-composer(doctrine/event-manager) < %{doctrine_event_max_ver}
+Requires: php-doctrine-cache >= %{doctrine_cache_min_ver}
+Requires: php-doctrine-cache < %{doctrine_cache_max_ver}
+Requires: php-doctrine-event-manager >= %{doctrine_event_min_ver}
+Requires: php-doctrine-event-manager < %{doctrine_event_max_ver}
# composer.json (optional)
-Requires: php-composer(symfony/console) >= %{symfony_console_min_ver}
-Requires: php-composer(symfony/console) < %{symfony_console_max_ver}
+Requires: php-symfony4-console >= %{symfony_console_min_ver}
+Requires: php-symfony4-console < %{symfony_console_max_ver}
%endif
-Requires: php-pdo
-# phpcompatinfo (computed from version 2.12)
+# phpcompatinfo (computed from version 3.0)
Requires: php-date
-Requires: php-json
Requires: php-hash
+Requires: php-json
Requires: php-pcre
-Requires: php-reflection
+Requires: php-pdo
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
-# PEAR
-Provides: php-pear(pear.doctrine-project.org/DoctrineDBAL) = %{version}
-# Rename
-Obsoletes: php-doctrine-DoctrineDBAL < %{version}
-Provides: php-doctrine-DoctrineDBAL = %{version}
+
%description
The Doctrine database abstraction & access layer (DBAL) offers a lightweight
@@ -135,22 +133,21 @@ to implement custom drivers that may use existing native or self-made APIs. For
example, the DBAL ships with a driver for Oracle databases that uses the oci8
extension under the hood.
-Autoloader: %{phpdir}/Doctrine/DBAL/autoload.php
+Autoloader: %{phpdir}/Doctrine/DBAL%{major}/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
-: Patch bin script
+: Patch bin script and drop composer/package-versions-deprecated usage
%patch0 -p1 -b .rpm
-
-: Remove empty file
-rm -f lib/Doctrine/DBAL/README.markdown
+sed -e 's/@VERSION@/%{github_version}/' -i src/Tools/Console/ConsoleRunner.php
+find . -name \*.rpm -delete
%build
: Create autoloader
-cat <<'AUTOLOAD' | tee lib/Doctrine/DBAL/autoload.php
+cat <<'AUTOLOAD' | tee src/autoload.php
<?php
/**
* Autoloader for %{name} and its' dependencies
@@ -167,33 +164,36 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::optional([
[
- (getenv('RPM_SYMFONY_TREE')?:'%{phpdir}/Symfony4') . '/Component/Console/autoload.php',
+ (getenv('RPM_SYMFONY_TREE')?:'%{phpdir}/Symfony5') . '/Component/Console/autoload.php',
+ '%{phpdir}/Symfony4/Component/Console/autoload.php',
'%{phpdir}/Symfony3/Component/Console/autoload.php',
- '%{phpdir}/Symfony/Component/Console/autoload.php',
],
]);
AUTOLOAD
%install
-mkdir -p %{buildroot}/%{phpdir}
-cp -rp lib/Doctrine %{buildroot}/%{phpdir}/
+mkdir -p %{buildroot}/%{phpdir}/Doctrine
+cp -rp src %{buildroot}/%{phpdir}/Doctrine/DBAL%{major}
mkdir -p %{buildroot}/%{_bindir}
-install -pm 0755 bin/doctrine-dbal.php %{buildroot}/%{_bindir}/doctrine-dbal
+install -pm 0755 bin/doctrine-dbal.php %{buildroot}/%{_bindir}/doctrine-dbal%{major}
%check
%if %{with tests}
cat > bs.php <<'BOOTSTRAP'
<?php
-require_once '%{buildroot}/%{phpdir}/Doctrine/DBAL/autoload.php';
+require_once '%{buildroot}/%{phpdir}/Doctrine/DBAL%{major}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4(
- 'Doctrine\\Tests\\',
- __DIR__ . '/tests/Doctrine/Tests'
+ 'Doctrine\\DBAL\\Tests\\',
+ __DIR__ . '/tests'
);
BOOTSTRAP
+: ignore test using PHPStan
+find tests -name \*php -exec grep -q PHPStan {} \; -print -delete
+
: Upstream tests
RETURN_CODE=0
for PHP_EXEC in php php73 php74 php80; do
@@ -215,11 +215,16 @@ exit $RETURN_CODE
%license LICENSE
%doc *.md
%doc composer.json
-%{phpdir}/Doctrine/DBAL
-%{_bindir}/doctrine-dbal
+%{phpdir}/Doctrine/DBAL%{major}
+%{_bindir}/doctrine-dbal%{major}
%changelog
+* Mon Nov 16 2020 Remi Collet <remi@remirepo.net> - 3.0.0-1
+- update to 3.0.0
+- rename to php-doctrine-dbal3
+- move to /usr/share/php/Doctrine/DBAL3
+
* Mon Nov 16 2020 Remi Collet <remi@remirepo.net> - 2.12.1-1
- update to 2.12.1