From e21e82ba33fddf9bbdcb6007e6a5b734efef98d7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 21 Nov 2019 12:51:54 +0100 Subject: duplicate v1 stuff --- .gitignore | 8 + composer.json | 73 ++++++ makesrc.sh | 1 + php-doctrine-doctrine-bundle2-get-source.sh | 64 +++++ php-doctrine-doctrine-bundle2-vendor.patch | 24 ++ php-doctrine-doctrine-bundle2.spec | 360 ++++++++++++++++++++++++++++ 6 files changed, 530 insertions(+) create mode 100644 .gitignore create mode 100644 composer.json create mode 120000 makesrc.sh create mode 100755 php-doctrine-doctrine-bundle2-get-source.sh create mode 100644 php-doctrine-doctrine-bundle2-vendor.patch create mode 100644 php-doctrine-doctrine-bundle2.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9ad06ef --- /dev/null +++ b/composer.json @@ -0,0 +1,73 @@ +{ + "name": "doctrine/doctrine-bundle", + "type": "symfony-bundle", + "description": "Symfony DoctrineBundle", + "keywords": ["DBAL", "ORM", "Database", "Persistence"], + "homepage": "http://www.doctrine-project.org", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Doctrine Project", + "homepage": "http://www.doctrine-project.org/" + } + ], + "require": { + "php": "^7.1", + "doctrine/dbal": "^2.5.12", + "doctrine/doctrine-cache-bundle": "~1.2", + "jdorn/sql-formatter": "^1.2.16", + "symfony/config": "^3.4.30|^4.3.3", + "symfony/console": "^3.4.30|^4.3.3", + "symfony/dependency-injection": "^3.4.30|^4.3.3", + "symfony/doctrine-bridge": "^3.4.30|^4.3.3", + "symfony/framework-bundle": "^3.4.30|^4.3.3" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "doctrine/orm": "^2.6", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^7.5", + "symfony/cache": "^3.4.30|^4.3.3", + "symfony/phpunit-bridge": "^4.2", + "symfony/property-info": "^3.4.30|^4.3.3", + "symfony/twig-bridge": "^3.4|^4.1", + "symfony/validator": "^3.4.30|^4.3.3", + "symfony/web-profiler-bundle": "^3.4.30|^4.3.3", + "symfony/yaml": "^3.4.30|^4.3.3", + "twig/twig": "^1.34|^2.12" + }, + "config": { + "sort-packages": true + }, + "conflict": { + "doctrine/orm": "<2.6", + "twig/twig": "<1.34|>=2.0,<2.4" + }, + "suggest": { + "doctrine/orm": "The Doctrine ORM integration is optional in the bundle.", + "symfony/web-profiler-bundle": "To use the data collector." + }, + "autoload": { + "psr-4": { "Doctrine\\Bundle\\DoctrineBundle\\": "" } + }, + "autoload-dev": { + "psr-4": { "": "Tests/DependencyInjection" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.12.x-dev" + } + } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..dd0245d --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-doctrine-doctrine-bundle2-get-source.sh \ No newline at end of file diff --git a/php-doctrine-doctrine-bundle2-get-source.sh b/php-doctrine-doctrine-bundle2-get-source.sh new file mode 100755 index 0000000..f8f69e8 --- /dev/null +++ b/php-doctrine-doctrine-bundle2-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-doctrine-bundle2-vendor.patch b/php-doctrine-doctrine-bundle2-vendor.patch new file mode 100644 index 0000000..8903194 --- /dev/null +++ b/php-doctrine-doctrine-bundle2-vendor.patch @@ -0,0 +1,24 @@ +diff -up ./Tests/ProfilerTest.php.rpm ./Tests/ProfilerTest.php +--- ./Tests/ProfilerTest.php.rpm 2019-11-20 15:05:37.038969160 +0100 ++++ ./Tests/ProfilerTest.php 2019-11-20 15:07:34.760380533 +0100 +@@ -41,7 +41,7 @@ class ProfilerTest extends BaseTestCase + $this->collector->addLogger('foo', $this->logger); + + $twigLoaderFilesystem = new FilesystemLoader(__DIR__ . '/../Resources/views/Collector'); +- $twigLoaderFilesystem->addPath(__DIR__ . '/../vendor/symfony/web-profiler-bundle/Resources/views', 'WebProfiler'); ++ $twigLoaderFilesystem->addPath('/usr/share/php/Symfony4/Bundle/WebProfilerBundle/Resources/views', 'WebProfiler'); + $this->twig = new Environment($twigLoaderFilesystem, ['debug' => true, 'strict_variables' => true]); + + $fragmentHandler = $this->getMockBuilder(FragmentHandler::class)->disableOriginalConstructor()->getMock(); +diff -up ./Tests/ServiceRepositoryTest.php.rpm ./Tests/ServiceRepositoryTest.php +--- ./Tests/ServiceRepositoryTest.php.rpm 2019-11-20 14:45:37.000000000 +0100 ++++ ./Tests/ServiceRepositoryTest.php 2019-11-20 15:05:37.038969160 +0100 +@@ -36,7 +36,7 @@ class ServiceRepositoryTest extends Test + public function testRepositoryServiceWiring() + { + // needed for older versions of Doctrine +- AnnotationRegistry::registerFile(__DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); ++ AnnotationRegistry::registerFile('/usr/share/php/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); + + $container = new ContainerBuilder(new ParameterBag([ + 'kernel.name' => 'app', diff --git a/php-doctrine-doctrine-bundle2.spec b/php-doctrine-doctrine-bundle2.spec new file mode 100644 index 0000000..63f21aa --- /dev/null +++ b/php-doctrine-doctrine-bundle2.spec @@ -0,0 +1,360 @@ +# remirepo spec file for php-doctrine-doctrine-bundle, from: +# +# Fedora spec file for php-doctrine-doctrine-bundle +# +# Copyright (c) 2015-2019 Shawn Iwinski +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + +%global github_owner doctrine +%global github_name DoctrineBundle +%global github_version 1.12.0 +%global github_commit a374f3bc54fe7c23ddb722ef6b9ddd2d9dcb9115 + +%global composer_vendor doctrine +%global composer_project doctrine-bundle + +# "php": "^7.1" +%global php_min_ver 7.1 +# "doctrine/dbal": "^2.5.12" +%global dbal_min_ver 2.5.12 +%global dbal_max_ver 3.0 +# "doctrine/doctrine-cache-bundle": "~1.2" +%global cache_bundle_min_ver 1.2 +%global cache_bundle_max_ver 2.0 +# "doctrine/orm": "~2.6" +%global orm_min_ver 2.6 +%global orm_max_ver 3.0 +# "jdorn/sql-formatter": "^1.2.16" +%global sql_formatter_min_ver 1.2.16 +%global sql_formatter_max_ver 2.0 +# "symfony/config": "^3.4.30|^4.3.3", +# "symfony/console": "^3.4.30|^4.3.3" +# "symfony/dependency-injection": "^3.4.30|^4.3.3" +# "symfony/doctrine-bridge": "^3.4.30|^4.3.3" +# "symfony/framework-bundle": "^3.4.30|^4.3.3" +# "symfony/cache": "^3.4.30|^4.3.3", +# "symfony/property-info": "^3.4.30|^4.3.3" +# "symfony/twig-bridge": "^3.4|^4.1", +# "symfony/validator": "^3.4.30|^4.3.3" +# "symfony/web-profiler-bundle": "^3.4.30|^4.3.3" +# "symfony/yaml": "^3.4.30|^4.3.3" +%global symfony_min_ver 3.4 +%global symfony_max_ver 5 +%global symfony_br_ver 4.3.3 +# "twig/twig": "~1.34|~2.12" +%global twig_min_ver 1.34 +%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 +%global twig_max_ver 3 +%else +%global twig_max_ver 2 +%endif + +# Build using "--without tests" to disable tests +%global with_tests 0%{!?_without_tests:1} + +%{!?phpdir: %global phpdir %{_datadir}/php} + +Name: php-%{composer_vendor}-%{composer_project} +Version: %{github_version} +Release: 1%{?dist} +Summary: Symfony Bundle for Doctrine + +License: MIT +URL: https://github.com/%{github_owner}/%{github_name} +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh + +Patch0: %{name}-vendor.patch + +BuildArch: noarch +# Tests +%if %{with_tests} +## composer.json +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-theseer-autoload +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires:(php-composer(doctrine/dbal) >= %{dbal_min_ver} with php-composer(doctrine/dbal) < %{dbal_max_ver}) +BuildRequires:(php-composer(doctrine/doctrine-cache-bundle) >= %{cache_bundle_min_ver} with php-composer(doctrine/doctrine-cache-bundle) < %{cache_bundle_max_ver}) +BuildRequires:(php-composer(doctrine/orm) >= %{orm_min_ver} with php-composer(doctrine/orm) < %{orm_max_ver}) +BuildRequires:(php-composer(jdorn/sql-formatter) >= %{sql_formatter_min_ver} with php-composer(jdorn/sql-formatter) < %{sql_formatter_max_ver}) +BuildRequires:(php-composer(twig/twig) >= %{twig_min_ver} with php-composer(twig/twig) < %{twig_max_ver}) +# remirepo:12 +%else +BuildRequires: php-composer(doctrine/dbal) < %{dbal_max_ver} +BuildRequires: php-composer(doctrine/dbal) >= %{dbal_min_ver} +BuildRequires: php-composer(doctrine/doctrine-cache-bundle) < %{cache_bundle_max_ver} +BuildRequires: php-composer(doctrine/doctrine-cache-bundle) >= %{cache_bundle_min_ver} +BuildRequires: php-composer(doctrine/orm) < %{orm_max_ver} +BuildRequires: php-composer(doctrine/orm) >= %{orm_min_ver} +BuildRequires: php-composer(jdorn/sql-formatter) < %{sql_formatter_max_ver} +BuildRequires: php-composer(jdorn/sql-formatter) >= %{sql_formatter_min_ver} +BuildRequires: php-composer(twig/twig) < %{twig_max_ver} +BuildRequires: php-composer(twig/twig) >= %{twig_min_ver} +%endif +# ensure same version of all components is used +# "require" +BuildRequires: php-symfony4-config >= %{symfony_br_ver} +BuildRequires: php-symfony4-console >= %{symfony_br_ver} +BuildRequires: php-symfony4-dependency-injection >= %{symfony_br_ver} +BuildRequires: php-symfony4-doctrine-bridge >= %{symfony_br_ver} +BuildRequires: php-symfony4-framework-bundle >= %{symfony_br_ver} +# "require-dev" +BuildRequires: php-symfony4-cache >= %{symfony_br_ver} +BuildRequires: php-symfony4-property-info >= %{symfony_br_ver} +BuildRequires: php-symfony4-twig-bridge >= %{symfony_br_ver} +BuildRequires: php-symfony4-validator >= %{symfony_br_ver} +BuildRequires: php-symfony4-web-profiler-bundle >= %{symfony_br_ver} +BuildRequires: php-symfony4-yaml >= %{symfony_br_ver} +BuildRequires: phpunit7 >= 7.5 +## phpcompatinfo (computed from version 1.11.0) +BuildRequires: php-dom +BuildRequires: php-pcre +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/dbal) >= %{dbal_min_ver} with php-composer(doctrine/dbal) < %{dbal_max_ver}) +Requires: (php-composer(doctrine/doctrine-cache-bundle) >= %{cache_bundle_min_ver} with php-composer(doctrine/doctrine-cache-bundle) < %{cache_bundle_max_ver}) +Requires: (php-composer(jdorn/sql-formatter) >= %{sql_formatter_min_ver} with php-composer(jdorn/sql-formatter) < %{sql_formatter_max_ver}) +Requires: (php-composer(symfony/config) >= %{symfony_min_ver} with php-composer(symfony/config) < %{symfony_max_ver}) +Requires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +Requires: (php-composer(symfony/dependency-injection) >= %{symfony_min_ver} with php-composer(symfony/dependency-injection) < %{symfony_max_ver}) +Requires: (php-composer(symfony/doctrine-bridge) >= %{symfony_min_ver} with php-composer(symfony/doctrine-bridge) < %{symfony_max_ver}) +Requires: (php-composer(symfony/framework-bundle) >= %{symfony_min_ver} with php-composer(symfony/framework-bundle) < %{symfony_max_ver}) +# remirepo:18 +%else +Requires: php-composer(doctrine/dbal) >= %{dbal_min_ver} +Requires: php-composer(doctrine/dbal) < %{dbal_max_ver} +Requires: php-composer(doctrine/doctrine-cache-bundle) >= %{cache_bundle_min_ver} +Requires: php-composer(doctrine/doctrine-cache-bundle) < %{cache_bundle_max_ver} +Requires: php-composer(jdorn/sql-formatter) >= %{sql_formatter_min_ver} +Requires: php-composer(jdorn/sql-formatter) < %{sql_formatter_max_ver} +Requires: php-composer(symfony/config) >= %{symfony_min_ver} +Requires: php-composer(symfony/config) < %{symfony_max_ver} +Requires: php-composer(symfony/console) >= %{symfony_min_ver} +Requires: php-composer(symfony/console) < %{symfony_max_ver} +Requires: php-composer(symfony/dependency-injection) >= %{symfony_min_ver} +Requires: php-composer(symfony/dependency-injection) < %{symfony_max_ver} +Requires: php-composer(symfony/doctrine-bridge) >= %{symfony_min_ver} +Requires: php-composer(symfony/doctrine-bridge) < %{symfony_max_ver} +Requires: php-composer(symfony/framework-bundle) >= %{symfony_min_ver} +Requires: php-composer(symfony/framework-bundle) < %{symfony_max_ver} +%endif +# phpcompatinfo (computed from version 1.11.0) +Requires: php-pcre +Requires: php-reflection +Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) + +# Composer +Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} + +# Weak dependencies +# remirepo:1 +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 +Suggests: php-composer(doctrine/orm) +Suggests: php-composer(symfony/web-profiler-bundle) +Suggests: php-composer(twig/twig) +# remirepo:1 +%endif + +%description +Doctrine DBAL & ORM Bundle for the Symfony Framework. + +Autoloader: %{phpdir}/Doctrine/Bundle/DoctrineBundle/autoload.php + + +%prep +%setup -qn %{github_name}-%{github_commit} +%patch0 -p1 -b .rpm + +find . -name \*.rpm -delete -print + +: Licenses and docs +mkdir -p .rpm/{docs,licenses} +mv *.md composer.* .rpm/docs +mkdir -p .rpm/docs/Resources +mv Resources/doc .rpm/docs/Resources/ +mv LICENSE .rpm/licenses + + +%build +: Create autoloader +cat <<'AUTOLOAD' | tee autoload.php +phpunit.xml + +: Upstream tests with SCLs if available +RETURN_CODE=0 +for SCL in php php71 php72 php73 php74; do + if which $SCL; then + $SCL %{_bindir}/phpunit7 \ + --filter '^((?!(testBacktraceLogged)).)*$' \ + --bootstrap bs.php \ + --verbose || RETURN_CODE=1 + fi +done +exit $RETURN_CODE +%else +: Tests skipped +%endif + + +%files +# remirepo:1 +%{!?_licensedir:%global license %%doc} +%license .rpm/licenses/* +%doc .rpm/docs/* +%{phpdir}/Doctrine/Bundle/DoctrineBundle +%exclude %{phpdir}/Doctrine/Bundle/DoctrineBundle/phpunit.* +%exclude %{phpdir}/Doctrine/Bundle/DoctrineBundle/Tests + + +%changelog +* Wed Nov 20 2019 Remi Collet - 1.12.0-1 +- update to 1.12.0 +- add dependency on symfony/config +- raise build dependency on Symfony 4.3.3 + +* Tue Jun 4 2019 Remi Collet - 1.11.2-1 +- update to 1.11.2 + +* Tue May 14 2019 Remi Collet - 1.11.1-1 +- update to 1.11.1 + +* Mon May 13 2019 Remi Collet - 1.11.0-1 +- update to 1.11.0 +- raise dependency on PHP 7.1 +- raise dependency on symfony 3.4 +- use phpunit7 + +* Fri Feb 8 2019 Remi Collet - 1.10.2-1 +- update to 1.10.2 + +* Tue Jan 8 2019 Remi Collet - 1.10.1-1 +- update to 1.10.1 +- prefer symfony 4 + +* Wed Oct 17 2018 Remi Collet - 1.9.1-1 +- update to 1.9.1 +- raise dependency on doctrine/dbal 2.5.12 +- raise dependency on jdorn/sql-formatter 1.2.16 + +* Fri Nov 10 2017 Remi Collet - 1.6.13-1 +- Update to 1.6.13 +- fix autoloader to allow symfony 2, 3 and 4 +- ensure we use same version of all component at build time +- raise dependency on doctrine/doctrine-cache-bundle 1.2 +- raise dependency on twig/twig 1.12 + +* Sat Mar 04 2017 Shawn Iwinski - 1.6.7-1 +- Updated to 1.6.7 (RHBZ #1416390) +- Removed optional dependencies' conflicts +- Changed autoloader to use short array format + +* Sun Jan 8 2017 Remi Collet - 1.6.6-1 +- update to 1.6.6 +- allow twig 2 +- don't allow symfony 3 (autoloader not ready) +- raise dependency on PHP 5.5.9 + +* Fri Jan 6 2017 Remi Collet - 1.6.4-2 +- drop conflict with twig 2 +- ensure twig 1 is used during the build + +* Fri Dec 30 2016 Shawn Iwinski - 1.6.4-1 +- Updated to 1.6.4 (RHBZ #1279827) +- Use php-composer(fedora/autoloader) +- Run upstream tests with SCLs if they are available +- Set Resources/doc as %%doc + +* Sat Sep 05 2015 Shawn Iwinski - 1.5.2-1 +- Updated to 1.5.2 (RHBZ #1253092 / CVE-2015-5723) +- Updated autoloader to load dependencies after self registration + +* Sat Jun 27 2015 Remi Collet - 1.5.0-3 +- backport for remi repo + +* Fri Jun 26 2015 Shawn Iwinski - 1.5.0-3 +- Autoloader updates + +* Tue Jun 16 2015 Shawn Iwinski - 1.5.0-2 +- Fixed dependencies +- Added optional dependency version conflicts + +* Thu Jun 11 2015 Shawn Iwinski - 1.5.0-1 +- Initial package -- cgit