summaryrefslogtreecommitdiffstats
path: root/php-doctrine-lexer.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-doctrine-lexer.spec')
-rw-r--r--php-doctrine-lexer.spec46
1 files changed, 15 insertions, 31 deletions
diff --git a/php-doctrine-lexer.spec b/php-doctrine-lexer.spec
index 1036103..3d1002c 100644
--- a/php-doctrine-lexer.spec
+++ b/php-doctrine-lexer.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-doctrine-lexer
#
-# Copyright (c) 2013-2015 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2013-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -25,7 +25,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 5%{?github_release}%{?dist}
+Release: 8%{?github_release}%{?dist}
Summary: Base library for a lexer that can be used in top-down, recursive descent parsers
Group: Development/Libraries
@@ -33,7 +33,6 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# composer.json
@@ -42,7 +41,7 @@ Requires: php(language) >= %{php_min_ver}
Requires: php-pcre
Requires: php-reflection
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -53,41 +52,28 @@ parsers.
This lexer is used in Doctrine Annotations and in Doctrine ORM (DQL).
+Autoloader: %{phpdir}/Doctrine/Common/Lexer/autoload.php
+
%prep
%setup -qn %{github_name}-%{github_commit}
+
+%build
: Create autoloader
-(cat <<'AUTOLOAD'
+cat <<'AUTOLOAD' | tee lib/Doctrine/Common/Lexer/autoload.php
<?php
/**
- * Autoloader created by %{name}-%{version}-%{release}
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
+ * Autoloader for %{name} and its' dependencies
+ * (created by %{name}-%{version}-%{release}).
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('Doctrine\\Common\\Lexer\\', dirname(dirname(dirname(__DIR__))));
-
-return $fedoraClassLoader;
+\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\Lexer\\', __DIR__);
AUTOLOAD
-) | tee lib/Doctrine/Common/Lexer/autoload.php
-
-
-%build
-# Empty build section, nothing required
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{phpdir}
cp -rp lib/* %{buildroot}%{phpdir}/
@@ -96,12 +82,7 @@ cp -rp lib/* %{buildroot}%{phpdir}/
# No upstream tests
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -112,6 +93,9 @@ rm -rf %{buildroot}
%changelog
+* Sat May 13 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-8
+- Switch autoloader to php-composer(fedora/autoloader)
+
* Sat Jun 27 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-5
- Updated autoloader with trailing separator