diff options
| -rw-r--r-- | .gitignore | 9 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | composer.json | 70 | ||||
| l--------- | makesrc.sh | 1 | ||||
| -rw-r--r-- | php-doctrine-dbal3-bin.patch | 40 | ||||
| -rwxr-xr-x | php-doctrine-dbal3-get-source.sh | 64 | ||||
| -rw-r--r-- | php-doctrine-dbal3.spec | 349 | 
7 files changed, 537 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2571ac4 --- /dev/null +++ b/composer.json @@ -0,0 +1,70 @@ +{ +    "name": "doctrine/dbal", +    "type": "library", +    "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", +    "keywords": [ +        "abstraction", +        "database", +        "dbal", +        "db2", +        "mariadb", +        "mssql", +        "mysql", +        "pgsql", +        "postgresql", +        "oci8", +        "oracle", +        "pdo", +        "queryobject", +        "sasql", +        "sql", +        "sqlanywhere", +        "sqlite", +        "sqlserver", +        "sqlsrv" +    ], +    "homepage": "https://www.doctrine-project.org/projects/dbal.html", +    "license": "MIT", +    "authors": [ +        {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, +        {"name": "Roman Borschel", "email": "roman@code-factory.org"}, +        {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, +        {"name": "Jonathan Wage", "email": "jonwage@gmail.com"} +    ], +    "require": { +        "php": "^7.3 || ^8", +        "ext-pdo": "*", +        "doctrine/cache": "^1.0", +        "doctrine/event-manager": "^1.0" +    }, +    "require-dev": { +        "doctrine/coding-standard": "^8.1", +        "jetbrains/phpstorm-stubs": "^2019.1", +        "phpstan/phpstan": "^0.12.40", +        "phpunit/phpunit": "^9.4", +        "psalm/plugin-phpunit": "^0.10.0", +        "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", +        "vimeo/psalm": "^3.17.2" +    }, +    "suggest": { +        "symfony/console": "For helpful console commands such as SQL execution and import of files." +    }, +    "bin": ["bin/doctrine-dbal"], +    "config": { +        "sort-packages": true, +        "platform": { +            "php": "7.3.0" +        } +    }, +    "autoload": { +        "psr-4": { "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" } +    }, +    "autoload-dev": { +        "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" } +    }, +    "extra": { +        "branch-alias": { +            "dev-master": "4.0.x-dev" +        } +    } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..eb32e5b --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-doctrine-dbal3-get-source.sh
\ No newline at end of file diff --git a/php-doctrine-dbal3-bin.patch b/php-doctrine-dbal3-bin.patch new file mode 100644 index 0000000..2d1269f --- /dev/null +++ b/php-doctrine-dbal3-bin.patch @@ -0,0 +1,40 @@ +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 @@ ++#!/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; + $cwd         = getcwd(); + $directories = [$cwd, $cwd . DIRECTORY_SEPARATOR . 'config']; + $configFile  = null; +  +-foreach ($files as $file) { +-    if (file_exists($file)) { +-        $loader = require $file; +- +-        break; +-    } +-} +- +-if (! $loader) { +-    throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?'); +-} +- + foreach ($directories as $directory) { +     $configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php'; +  diff --git a/php-doctrine-dbal3-get-source.sh b/php-doctrine-dbal3-get-source.sh new file mode 100755 index 0000000..f8f69e8 --- /dev/null +++ b/php-doctrine-dbal3-get-source.sh @@ -0,0 +1,64 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then +    echo "ERROR: 'git' command not found" 1>&2 +    exit 1 +elif [ -z "$RPM" ] +then +    echo "ERROR: 'rpm' command not found" 1>&2 +    exit 1 +fi + +function print { +    echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +SPEC=`ls *.spec` +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) +TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz +CMP_FILE=$PWD/composer.json + +pushd $TEMP_DIR +    print "Cloning git repo..." +    $GIT clone $GIT_REPO + +    pushd $GIT_DIR +        print "Checking out commit..." +        $GIT checkout $GIT_COMMIT +        cp composer.json $CMP_FILE +    popd + +    TAR_DIR=${GIT_NAME}-${GIT_COMMIT} +    print "TAR_DIR = $TAR_DIR" + +    mv $GIT_DIR $TAR_DIR + +    print "TAR_FILE = $TAR_FILE" + +    [ -e $TAR_FILE ] && rm -f $TAR_FILE +    tar --exclude-vcs -czf $TAR_FILE $TAR_DIR +popd + +rm -rf $TEMP_DIR diff --git a/php-doctrine-dbal3.spec b/php-doctrine-dbal3.spec new file mode 100644 index 0000000..5d93176 --- /dev/null +++ b/php-doctrine-dbal3.spec @@ -0,0 +1,349 @@ +# remirepo spec file for php-doctrine-dbal, from Fedora: +# +# Fedora spec file for php-doctrine-dbal +# +# Copyright (c) 2013-2020 Shawn Iwinski <shawn.iwinski@gmail.com> +#                         Adam Williamson <awilliam@redhat.com> +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + +%global github_owner     doctrine +%global github_name      dbal +%global github_version   2.12.1 +%global github_commit    adce7a954a1c2f14f85e94aed90c8489af204086 + +%global composer_vendor  doctrine +%global composer_project dbal + +# "php": "^7.3 || ^8" +%global php_min_ver 7.3 +# "doctrine/cache": "^1.0" +%global doctrine_cache_min_ver 1.0 +%global doctrine_cache_max_ver 2 +# "doctrine/event-manager": "^1.0" +%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 + +%{!?phpdir:  %global phpdir  %{_datadir}/php} + +# Build using "--without tests" to disable tests +%bcond_without tests + +Name:          php-%{composer_vendor}-%{composer_project} +Version:       %{github_version} +Release:       1%{?github_release}%{?dist} +Summary:       Doctrine Database Abstraction Layer (DBAL) + +License:       MIT +URL:           http://www.doctrine-project.org/projects/dbal.html + +# Run "php-doctrine-dbal-get-source.sh" to create source +Source0:       %{name}-%{version}-%{github_commit}.tar.gz +Source1:       %{name}-get-source.sh + +# Update bin script: +# 1) Add she-bang +# 2) Auto-load using Doctrine\Common\ClassLoader +Patch0:        %{name}-bin.patch + +BuildArch: noarch +# Tests +%if %{with tests} +BuildRequires: phpunit9 >= 9.4 +## composer.json +BuildRequires: php(language) >= %{php_min_ver} +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires:(php-composer(doctrine/cache) >= %{doctrine_cache_min_ver} with php-composer(doctrine/cache) <  %{doctrine_cache_max_ver}) +BuildRequires:(php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver} with php-composer(doctrine/event-manager) <  %{doctrine_cache_max_ver}) +## composer.json (optional) +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} +## composer.json (optional) +BuildRequires: php-composer(symfony/console) >= %{symfony_console_min_ver} +BuildRequires: php-composer(symfony/console) <  %{symfony_console_max_ver} +%endif +## phpcompatinfo (computed from version 2.12) +BuildRequires: php-date +BuildRequires: php-json +BuildRequires: php-hash +BuildRequires: php-pcre +BuildRequires: php-pdo +BuildRequires: php-reflection +BuildRequires: php-spl +## Autoloader +BuildRequires: php-composer(fedora/autoloader) +%endif + +# composer.json +Requires:      php(language) >= %{php_min_ver} +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires:     (php-composer(doctrine/cache) >= %{doctrine_cache_min_ver} with php-composer(doctrine/cache) <  %{doctrine_cache_max_ver}) +Requires:     (php-composer(doctrine/event-manager) >= %{doctrine_event_min_ver} with php-composer(doctrine/event-manager) <  %{doctrine_cache_max_ver}) +# composer.json (optional) +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} +# composer.json (optional) +Requires:      php-composer(symfony/console) >= %{symfony_console_min_ver} +Requires:      php-composer(symfony/console) <  %{symfony_console_max_ver} +%endif +Requires:      php-pdo +# phpcompatinfo (computed from version 2.12) +Requires:      php-date +Requires:      php-json +Requires:      php-hash +Requires:      php-pcre +Requires:      php-reflection +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 +and thin runtime layer around a PDO-like API and a lot of additional, horizontal +features like database schema introspection and manipulation through an OO API. + +The fact that the Doctrine DBAL abstracts the concrete PDO API away through the +use of interfaces that closely resemble the existing PDO API makes it possible +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 + + +%prep +%setup -qn %{github_name}-%{github_commit} + +: Patch bin script +%patch0 -p1 -b .rpm + +: Remove empty file +rm -f lib/Doctrine/DBAL/README.markdown + + +%build +: Create autoloader +cat <<'AUTOLOAD' | tee lib/Doctrine/DBAL/autoload.php +<?php +/** + * Autoloader for %{name} and its' dependencies + * (created by %{name}-%{version}-%{release}). + */ +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\DBAL\\', __DIR__); + +\Fedora\Autoloader\Dependencies::required(array( +    '%{phpdir}/Doctrine/Common/Cache/autoload.php', +    '%{phpdir}/Doctrine/Common/EventManager/autoload.php', +)); + +\Fedora\Autoloader\Dependencies::optional([ +    [ +        (getenv('RPM_SYMFONY_TREE')?:'%{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}/%{_bindir} +install -pm 0755 bin/doctrine-dbal.php %{buildroot}/%{_bindir}/doctrine-dbal + + +%check +%if %{with tests} +cat > bs.php <<'BOOTSTRAP' +<?php +require_once '%{buildroot}/%{phpdir}/Doctrine/DBAL/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4( +    'Doctrine\\Tests\\', +    __DIR__ . '/tests/Doctrine/Tests' +); +BOOTSTRAP + +: Upstream tests +RETURN_CODE=0 +for PHP_EXEC in php php73 php74 php80; do +    rm -f /tmp/test_nesting.sqlite +    if which $PHP_EXEC; then +        $PHP_EXEC %{_bindir}/phpunit9 \ +            --bootstrap bs.php \ +            --verbose || RETURN_CODE=1 +    fi +done +exit $RETURN_CODE +%else +: Tests skipped +%endif + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *.md +%doc composer.json +%{phpdir}/Doctrine/DBAL +%{_bindir}/doctrine-dbal + + +%changelog +* Mon Nov 16 2020 Remi Collet <remi@remirepo.net> - 2.12.1-1 +- update to 2.12.1 + +* Fri Oct 23 2020 Remi Collet <remi@remirepo.net> - 2.12.0-1 +- update to 2.12.0 + +* Wed Oct 21 2020 Remi Collet <remi@remirepo.net> - 2.11.3-1 +- update to 2.11.3 + +* Mon Oct 19 2020 Remi Collet <remi@remirepo.net> - 2.11.2-1 +- update to 2.11.2 + +* Mon Sep 28 2020 Remi Collet <remi@remirepo.net> - 2.11.1-1 +- update to 2.11.1 + +* Mon Sep 21 2020 Remi Collet <remi@remirepo.net> - 2.11.0-1 +- update to 2.11.0 +- raise dependency on PHP 7.3 +- switch to phpunit9 + +* Mon Sep 14 2020 Remi Collet <remi@remirepo.net> - 2.10.4-1 +- update to 2.10.4 + +* Wed Sep  2 2020 Remi Collet <remi@remirepo.net> - 2.10.3-1 +- update to 2.10.3 + +* Tue Apr 21 2020 Remi Collet <remi@remirepo.net> - 2.10.2-1 +- update to 2.10.2 + +* Mon Jan  6 2020 Remi Collet <remi@remirepo.net> - 2.10.1-1 +- update to 2.10.1 + +* Mon Nov  4 2019 Remi Collet <remi@remirepo.net> - 2.10.0-1 +- update to 2.10.0 +- raise dependencies on PHP 7.2 +- switch to phpunit8 + +* Wed Jan  2 2019 Remi Collet <remi@remirepo.net> - 2.9.2-1 +- update to 2.9.2 + +* Fri Dec 14 2018 Remi Collet <remi@remirepo.net> - 2.9.1-1 +- update to 2.9.1 + +* Mon Dec 10 2018 Remi Collet <remi@remirepo.net> - 2.9.0-1 +- update to 2.9.0 + +* Thu Oct 18 2018 Remi Collet <remi@remirepo.net> - 2.8.0-1 +- update to 2.8.0 +- drop dependency on doctrine/common +- add dependency on doctrine/cache +- add dependency on doctrine/event-manager +- allow Symfony 4 + +* Wed Oct 17 2018 Remi Collet <remi@remirepo.net> - 2.7.2-1 +- update to 2.7.2 +- raise dependencies on PHP 7.1 +- use range dependencies +- switch to phpunit7 + +* Tue May 30 2017 Remi Collet <remi@remirepo.net> - 2.5.12-3 +- allow to force Symfony version using RPM_SYMFONY_TREE + +* Sat Mar 11 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.12-1 +- Updated to 2.5.12 (RHBZ #1412852) +- Switch autoloader to php-composer(fedora/autoloader) +- Run upstream tests with SCLs if available + +* Wed Feb  8 2017 Remi Collet <remi@remirepo.net> - 2.5.12-1 +- update to 2.5.12 + +* Mon Feb  6 2017 Remi Collet <remi@remirepo.net> - 2.5.11-1 +- update to 2.5.11 + +* Tue Jan 24 2017 Remi Collet <remi@remirepo.net> - 2.5.10-1 +- update to 2.5.10 + +* Fri Jan 20 2017 Remi Collet <remi@remirepo.net> - 2.5.9-1 +- update to 2.5.9 + +* Mon Sep 26 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.5-1 +- Updated to 2.5.5 (RHBZ #1374891) + +* Mon Jun 13 2016 Remi Collet <remi@fedoraproject.org> - 2.5.4-2 +- add workaround for test suite with PHPUnit 5.4 + +* Mon Mar 14 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.4-1 +- Updated to 2.5.4 (RHBZ #1153987) +- Added autoloader + +* Wed Jan 14 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.1-1 +- Updated to 2.5.1 (BZ #1153987) + +* Fri Jan 02 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.5.1-0.2.20150101git185b886 +- Updated to latest snapshot +- Fixed bin script +- Added tests + +* Thu Jul 31 2014 Remi Collet <rpms@famillecollet.com> 2.4.2-6 +- backport for remi repo +- fix license handling + +* Tue Jul 29 2014 Adam Williamson <awilliam@redhat.com> - 2.4.2-6 +- really apply the patch + +* Tue Jul 29 2014 Adam Williamson <awilliam@redhat.com> - 2.4.2-5 +- backport another OwnCloud-related pgsql fix from upstream master + +* Fri Jun 20 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.4.2-4 +- Added php-composer(%%{composer_vendor}/%%{composer_project}) virtual provide +- Updated Doctrine dependencies to use php-composer virtual provides + +* Sat Jan 11 2014 Remi Collet <rpms@famillecollet.com> 2.4.2-2 +- backport for remi repo + +* Tue Jan 07 2014 Adam Williamson <awilliam@redhat.com> - 2.4.2-2 +- primary_index: one OwnCloud patch still isn't in upstream + +* Sat Jan 04 2014 Shawn Iwinski <shawn.iwinski@gmail.com> 2.4.2-1 +- Updated to 2.4.2 +- Conditional %%{?dist} + +* Tue Dec 31 2013 Shawn Iwinski <shawn.iwinski@gmail.com> 2.4.1-2.20131231gitd08b11c +- Updated to latest snapshot +- Removed patches (pulled into latest snapshot) + +* Sun Dec 29 2013 Shawn Iwinski <shawn.iwinski@gmail.com> 2.4.1-1 +- Initial package  | 
