diff options
author | Remi Collet <remi@remirepo.net> | 2017-05-14 18:25:22 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-05-14 18:25:22 +0200 |
commit | 8a43b5f7105f62bac6e7f85fe529f5de75c8f4c9 (patch) | |
tree | d4e14c2e19ce5a1bc1b430471c8f4a28294d8096 | |
parent | 515951441ce2c458dfd8403478fb59381d5c84b6 (diff) |
sync with Fedora
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | php-doctrine-lexer.spec | 46 |
2 files changed, 22 insertions, 31 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm 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 |