summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-01-11 15:40:23 +0100
committerRemi Collet <fedora@famillecollet.com>2014-01-11 15:40:23 +0100
commitc89a7307dbe2d943c8f40ffd2d5f7d02372bbde4 (patch)
treefe24254d518ed531ded43df51e7e22c793878b69
php-doctrine-orm: import from rawhide
-rw-r--r--php-doctrine-orm-bin.patch24
-rw-r--r--php-doctrine-orm.spec119
2 files changed, 143 insertions, 0 deletions
diff --git a/php-doctrine-orm-bin.patch b/php-doctrine-orm-bin.patch
new file mode 100644
index 0000000..7cf73e5
--- /dev/null
+++ b/php-doctrine-orm-bin.patch
@@ -0,0 +1,24 @@
+diff --git a/bin/doctrine.php b/bin/doctrine.php
+index c735562..99014f4 100755
+--- a/bin/doctrine.php
++++ b/bin/doctrine.php
+@@ -1,3 +1,4 @@
++#!/usr/bin/php
+ <?php
+ /*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+@@ -20,7 +21,13 @@
+ use Symfony\Component\Console\Helper\HelperSet;
+ use Doctrine\ORM\Tools\Console\ConsoleRunner;
+
+-(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php';
++require_once '/usr/share/php/Doctrine/Common/ClassLoader.php';
++
++$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
++$classLoader->register();
++
++$classLoader = new \Doctrine\Common\ClassLoader('Symfony');
++$classLoader->register();
+
+ $directories = array(getcwd(), getcwd() . DIRECTORY_SEPARATOR . 'config');
+
diff --git a/php-doctrine-orm.spec b/php-doctrine-orm.spec
new file mode 100644
index 0000000..ca79f1d
--- /dev/null
+++ b/php-doctrine-orm.spec
@@ -0,0 +1,119 @@
+%global github_owner doctrine
+%global github_name doctrine2
+%global github_version 2.4.1
+%global github_commit 84373d05a4198ec380918d535abf83c454c3867f
+
+# "php": ">=5.3.2"
+%global php_min_ver 5.3.2
+# "doctrine/collections": "~1.1"
+%global collections_min_ver 1.1
+%global collections_max_ver 2.0
+# "doctrine/dbal": "~2.4"
+%global dbal_min_ver 2.4
+%global dbal_max_ver 3.0
+# "symfony/console": "~2.0"
+# "symfony/yaml": "~2.1"
+%global symfony_min_ver 2.1
+%global symfony_max_ver 3.0
+
+Name: php-%{github_owner}-orm
+Version: %{github_version}
+Release: 2%{?dist}
+Summary: Doctrine Object-Relational-Mapper (ORM)
+
+Group: Development/Libraries
+License: MIT
+URL: http://www.doctrine-project.org/projects/orm.html
+Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+# Update bin script:
+# 1) Add she-bang
+# 2) Auto-load using Doctrine\Common\ClassLoader
+Patch0: %{name}-bin.patch
+
+BuildArch: noarch
+
+Requires: php(language) >= %{php_min_ver}
+Requires: php-doctrine-collections >= %{collections_min_ver}
+Requires: php-doctrine-collections < %{collections_max_ver}
+Requires: php-doctrine-dbal >= %{dbal_min_ver}
+Requires: php-doctrine-dbal < %{dbal_max_ver}
+Requires: php-symfony-console >= %{symfony_min_ver}
+Requires: php-symfony-console < %{symfony_max_ver}
+Requires: php-symfony-yaml >= %{symfony_min_ver}
+Requires: php-symfony-yaml < %{symfony_max_ver}
+# phpcompatinfo (computed from v2.4.1)
+Requires: php-ctype
+Requires: php-dom
+Requires: php-pcre
+Requires: php-pdo
+Requires: php-reflection
+Requires: php-simplexml
+Requires: php-spl
+Requires: php-tokenizer
+
+# PEAR
+Provides: php-pear(pear.doctrine-project.org/DoctrineORM) = %{version}
+# Rename
+Obsoletes: php-doctrine-DoctrineORM < %{version}
+Provides: php-doctrine-DoctrineORM = %{version}
+
+%description
+Object relational mapper (ORM) for PHP that sits on top of a powerful database
+abstraction layer (DBAL). One of its' key features is the option to write
+database queries in a proprietary object oriented SQL dialect called Doctrine
+Query Language (DQL), inspired by Hibernate's HQL. This provides developers
+with a powerful alternative to SQL that maintains flexibility without requiring
+unnecessary code duplication.
+
+Optional caches (see Doctrine\ORM\Tools\Setup::createConfiguration()):
+* APC (php-pecl-apc)
+* Memcache (php-pecl-memcache)
+* Redis (php-pecl-redis)
+* XCache (php-xcache)
+
+
+%prep
+%setup -q -n %{github_name}-%{github_commit}
+
+# Patch bin script
+%patch0 -p1
+
+# Remove empty file
+rm -f lib/Doctrine/ORM/README.markdown
+
+# Remove unnecessary executable bit
+chmod a-x lib/Doctrine/ORM/Tools/Pagination/Paginator.php
+
+
+%build
+# Empty build section, nothing required
+
+
+%install
+mkdir -p %{buildroot}/%{_datadir}/php
+cp -rp lib/Doctrine %{buildroot}/%{_datadir}/php/
+
+mkdir -p %{buildroot}/%{_bindir}
+install -pm 0755 bin/doctrine.php %{buildroot}/%{_bindir}/doctrine
+
+
+%check
+# No upstream tests provided in source
+
+
+%files
+%doc LICENSE *.md *.markdown composer.json
+%{_datadir}/php/Doctrine/ORM
+%{_bindir}/doctrine
+
+
+%changelog
+* Sat Jan 04 2014 Shawn Iwinski <shawn.iwinski@gmail.com> 2.4.1-2
+- Conditional %%{?dist}
+- Bin script patch instead of inline update and use Doctrine Common classloader
+- Updated optional cache information in %%description
+- Removed empty file
+- Removed unnecessary executable bit
+
+* Sat Dec 28 2013 Shawn Iwinski <shawn.iwinski@gmail.com> 2.4.1-1
+- Initial package