diff --git a/.gitignore b/.gitignore index a31dcbb..ff78d3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /php-doctrine-migrations-1.8.1-215438c.tgz +/php-doctrine-migrations-2.0.0-0101f5b.tgz diff --git a/php-doctrine-migrations-rpm.patch b/php-doctrine-migrations-rpm.patch new file mode 100644 index 0000000..69be9f8 --- /dev/null +++ b/php-doctrine-migrations-rpm.patch @@ -0,0 +1,40 @@ +diff -up ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php.rpm ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php +--- ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php.rpm 2019-03-27 09:58:41.000000000 +0100 ++++ ./lib/Doctrine/Migrations/Tools/Console/ConsoleRunner.php 2019-03-27 10:19:22.365477263 +0100 +@@ -15,7 +15,6 @@ use Doctrine\Migrations\Tools\Console\Co + use Doctrine\Migrations\Tools\Console\Command\StatusCommand; + use Doctrine\Migrations\Tools\Console\Command\UpToDateCommand; + use Doctrine\Migrations\Tools\Console\Command\VersionCommand; +-use PackageVersions\Versions; + use Symfony\Component\Console\Application; + use Symfony\Component\Console\Helper\HelperSet; + +@@ -38,7 +37,7 @@ class ConsoleRunner + /** @param AbstractCommand[] $commands */ + public static function createApplication(HelperSet $helperSet, array $commands = []) : Application + { +- $cli = new Application('Doctrine Migrations', Versions::getVersion('doctrine/migrations')); ++ $cli = new Application('Doctrine Migrations', '2.0.0'); + $cli->setCatchExceptions(true); + $cli->setHelperSet($helperSet); + self::addCommands($cli); +diff -up ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php.rpm ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php +--- ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php.rpm 2019-03-27 10:20:22.799818585 +0100 ++++ ./tests/Doctrine/Migrations/Tests/Functional/CliTest.php 2019-03-27 10:20:48.070961326 +0100 +@@ -17,7 +17,6 @@ use Doctrine\Migrations\Tools\Console\Co + use Doctrine\ORM\EntityManager; + use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; + use Doctrine\ORM\Tools\Setup as OrmSetup; +-use PackageVersions\Versions; + use ReflectionClass; + use RuntimeException; + use Symfony\Component\Console\Application; +@@ -227,7 +226,7 @@ class CliTest extends MigrationTestCase + ); + + $this->conn = $this->getSqliteConnection(); +- $this->application = new Application('Doctrine Migrations Test', Versions::getVersion('doctrine/migrations')); ++ $this->application = new Application('Doctrine Migrations Test', '@VERSION@'); + $this->application->setCatchExceptions(false); + $this->application->setAutoExit(false); + $this->application->getHelperSet()->set( diff --git a/php-doctrine-migrations.spec b/php-doctrine-migrations.spec index 3f454dd..3fa3cf6 100644 --- a/php-doctrine-migrations.spec +++ b/php-doctrine-migrations.spec @@ -8,7 +8,7 @@ # %global bootstrap 0 -%global gh_commit 215438c0eef3e5f9b7da7d09c6b90756071b43e6 +%global gh_commit 0101f5bd7f4e5043bf8630db2930f8fd7da552b6 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner doctrine %global gh_project migrations @@ -25,8 +25,8 @@ %endif Name: php-%{pk_vendor}-%{pk_project} -Version: 1.8.1 -Release: 2%{?dist} +Version: 2.0.0 +Release: 1%{?dist} Summary: PHP Doctrine Migrations project License: MIT @@ -34,6 +34,9 @@ URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh +# get rid of ocramius/package-versions +Patch0: %{name}-rpm.patch + BuildArch: noarch BuildRequires: php-fedora-autoloader-devel %if %{with_tests} @@ -48,19 +51,27 @@ BuildRequires: php-pcre BuildRequires: php-phar BuildRequires: php-spl BuildRequires: (php-composer(doctrine/dbal) >= 2.6 with php-composer(doctrine/dbal) < 3) -BuildRequires: (php-composer(symfony/console) >= 3.3 with php-composer(symfony/console) < 5) -BuildRequires: (php-composer(ocramius/proxy-manager) >= 2.0 with php-composer(ocramius/proxy-manager) < 3) +BuildRequires: (php-composer(symfony/console) >= 3.4 with php-composer(symfony/console) < 5) +BuildRequires: (php-composer(symfony/stopwatch) >= 3.4 with php-composer(symfony/stopwatch) < 5) +BuildRequires: (php-composer(ocramius/proxy-manager) >= 2.0.2 with php-composer(ocramius/proxy-manager) < 3) # From composer.json # "require-dev": { -# "doctrine/orm": "~2.5", -# "symfony/yaml": "~3.3|^4.0", -# "phpunit/phpunit": "~7.0", -# "doctrine/coding-standard": "^1.0", -# "jdorn/sql-formatter": "~1.1", +# "ext-pdo_sqlite": "*", +# "doctrine/coding-standard": "^5.0", +# "doctrine/orm": "^2.6", +# "jdorn/sql-formatter": "^1.1", # "mikey179/vfsStream": "^1.6", -# "squizlabs/php_codesniffer": "^3.0" -BuildRequires: (php-composer(doctrine/orm) >= 2.5 with php-composer(doctrine/orm) < 3) -BuildRequires: (php-composer(symfony/yaml) >= 3.3 with php-composer(symfony/yaml) < 5) +# "phpstan/phpstan": "^0.10", +# "phpstan/phpstan-deprecation-rules": "^0.10", +# "phpstan/phpstan-phpunit": "^0.10", +# "phpstan/phpstan-strict-rules": "^0.10", +# "phpunit/phpunit": "^7.0", +# "symfony/process": "^3.4||^4.0", +# "symfony/yaml": "^3.4||^4.0" +BuildRequires: php-pdo_sqlite +BuildRequires: (php-composer(doctrine/orm) >= 2.6 with php-composer(doctrine/orm) < 3) +BuildRequires: (php-composer(symfony/process) >= 3.4 with php-composer(symfony/process) < 5) +BuildRequires: (php-composer(symfony/yaml) >= 3.4 with php-composer(symfony/yaml) < 5) BuildRequires: (php-composer(jdorn/sql-formatter) >= 1.1 with php-composer(jdorn/sql-formatter) < 2) BuildRequires: (php-composer(mikey179/vfsStream) >= 1.6 with php-composer(mikey179/vfsStream) < 2) BuildRequires: phpunit7 @@ -69,17 +80,20 @@ BuildRequires: phpunit7 # From composer.json # "require": { # "php": "^7.1", -# "doctrine/dbal": "~2.6", -# "symfony/console": "~3.3|^4.0", -# "ocramius/proxy-manager": "^1.0|^2.0" +# "doctrine/dbal": "^2.6", +# "ocramius/package-versions": "^1.3", +# "ocramius/proxy-manager": "^2.0.2", +# "symfony/console": "^3.4||^4.0", +# "symfony/stopwatch": "^3.4||^4.0" # "suggest": { # "jdorn/sql-formatter": "Allows to generate formatted SQL with the diff command.", # "symfony/yaml": "Allows the use of yaml for migration configuration files." Requires: php(language) >= 7.1 Requires: (php-composer(doctrine/dbal) >= 2.6 with php-composer(doctrine/dbal) < 3) -Requires: (php-composer(symfony/console) >= 3.3 with php-composer(symfony/console) < 5) -Requires: (php-composer(ocramius/proxy-manager) >= 2.0 with php-composer(ocramius/proxy-manager) < 3) +Requires: (php-composer(symfony/console) >= 3.4 with php-composer(symfony/console) < 5) +Requires: (php-composer(symfony/stopwatch) >= 3.4 with php-composer(symfony/stopwatch) < 5) +Requires: (php-composer(ocramius/proxy-manager) >= 2.0.2 with php-composer(ocramius/proxy-manager) < 3) Recommends: (php-composer(mikey179/vfsStream) >= 1.6 with php-composer(mikey179/vfsStream) < 2) Recommends: (php-composer(symfony/yaml) >= 3.3 with php-composer(symfony/yaml) < 5) # From phpcompatinfo report for version 1.8.1 @@ -104,20 +118,28 @@ easily deploying changes to it. It is a very easy to use and a powerful tool. Documentation: https://www.doctrine-project.org/projects/migrations.html -Autoloader: %{_datadir}/php/%{ns_vendor}/DBAL/%{ns_project}/autoload.php +Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} +: Cleanup to get rid of ocramius/package-versions +%patch0 -p1 -b .rpm +sed -e 's/@VERSION@/%{version}/' -i \ + lib/%{ns_vendor}/%{ns_project}/Tools/Console/ConsoleRunner.php \ + tests/%{ns_vendor}/%{ns_project}/Tests/Functional/CliTest.php +grep 'new Application' lib/%{ns_vendor}/%{ns_project}/Tools/Console/ConsoleRunner.php +find lib -name \*.rpm -delete -print + %build : Generate a simple autoloader %{_bindir}/phpab \ - --output lib/%{ns_vendor}/DBAL/%{ns_project}/autoload.php \ + --output lib/%{ns_vendor}/%{ns_project}/autoload.php \ --template fedora \ lib/%{ns_vendor} -cat << 'EOF' | tee -a lib/%{ns_vendor}/DBAL/%{ns_project}/autoload.php +cat << 'EOF' | tee -a lib/%{ns_vendor}/%{ns_project}/autoload.php // Dependencies \Fedora\Autoloader\Dependencies::required([ @@ -126,11 +148,19 @@ cat << 'EOF' | tee -a lib/%{ns_vendor}/DBAL/%{ns_project}/autoload.php '%{_datadir}/php/Symfony4/Component/Console/autoload.php', '%{_datadir}/php/Symfony3/Component/Console/autoload.php', ], + [ + '%{_datadir}/php/Symfony4/Component/Stopwatch/autoload.php', + '%{_datadir}/php/Symfony3/Component/Stopwatch/autoload.php', + ], '%{_datadir}/php/ProxyManager/autoload.php', ]); \Fedora\Autoloader\Dependencies::optional([ '%{_datadir}/php/jdorn-sql-formatter/autoload.php', [ + '%{_datadir}/php/Symfony4/Component/Process/autoload.php', + '%{_datadir}/php/Symfony3/Component/Process/autoload.php', + ], + [ '%{_datadir}/php/Symfony4/Component/Yaml/autoload.php', '%{_datadir}/php/Symfony3/Component/Yaml/autoload.php', ], @@ -141,7 +171,6 @@ EOF %install mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} cp -pr lib/%{ns_vendor}/%{ns_project} %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project} -cp -pr lib/%{ns_vendor}/DBAL %{buildroot}%{_datadir}/php/%{ns_vendor}/DBAL %check @@ -155,14 +184,14 @@ mkdir vendor cat << 'EOF' | tee -a vendor/autoload.php \Fedora\Autoloader\Dependencies::required([ - '%{buildroot}%{_datadir}/php/%{ns_vendor}/DBAL/%{ns_project}/autoload.php', + '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php', '%{_datadir}/php/%{ns_vendor}/ORM/autoload.php', '%{_datadir}/php/org/bovigo/vfs/autoload.php', ]); EOF # need investigation (migrations directory deleted during test suite?) -chmod -w tests/Doctrine/DBAL/Migrations/Tests/Functional/_files +chmod -w tests/Doctrine/Migrations/Tests/Functional/_files : Run test suite ret=0 @@ -175,7 +204,7 @@ for cmd in php php71 php72 php73; do done # restore -chmod +w tests/Doctrine/DBAL/Migrations/Tests/Functional/_files +chmod +w tests/Doctrine/Migrations/Tests/Functional/_files exit $ret %else @@ -188,10 +217,14 @@ exit $ret %doc *.md %doc composer.json %{_datadir}/php/%{ns_vendor}/%{ns_project}/ -%{_datadir}/php/%{ns_vendor}/DBAL/%{ns_project} %changelog +* Wed Mar 27 2019 Remi Collet - 2.0.0-1 +- update to 2.0.0 +- raise dependency on symfony 3.4 +- add dependency on symfony/stopwatch 3.4 + * Thu Jan 3 2019 Remi Collet - 1.8.1-2 - move autoloader in Doctrine/DBAL/Migration for compatibility with version 1.5.0 diff --git a/sources b/sources index 9952799..d40db29 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-doctrine-migrations-1.8.1-215438c.tgz) = 1e35403316720801ecc867516ba483d9145100a0767b53d6e9a421382c89474785c5165f4e6922e01b39e6bcb5c6431b37e16df45aa1908dbf758b62da41cbb8 +SHA512 (php-doctrine-migrations-2.0.0-0101f5b.tgz) = 5c5e9def5239158c876640a6f8da52977b537375378bea8cc636f706ebadbd7ebc8fdd5e85ab8a8f8f3ca7faef4a77d7c27334249828f5cc0219d934c31980f6