From 71195395d5d5808978db68a75050f11b9708ea31 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 14 May 2017 17:58:58 +0200 Subject: sync with Fedora --- .gitignore | 7 +++ composer.json | 31 ++++++++++++++ php-doctrine-annotations-get-source.sh | 4 +- php-doctrine-annotations.spec | 78 +++++++++++++++++----------------- 4 files changed, 79 insertions(+), 41 deletions(-) create mode 100644 .gitignore create mode 100644 composer.json 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/composer.json b/composer.json new file mode 100644 index 0000000..1c65f6c --- /dev/null +++ b/composer.json @@ -0,0 +1,31 @@ +{ + "name": "doctrine/annotations", + "type": "library", + "description": "Docblock Annotations Parser", + "keywords": ["annotations", "docblock", "parser"], + "homepage": "http://www.doctrine-project.org", + "license": "MIT", + "authors": [ + {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, + {"name": "Roman Borschel", "email": "roman@code-factory.org"}, + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, + {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} + ], + "require": { + "php": ">=5.3.2", + "doctrine/lexer": "1.*" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" + }, + "autoload": { + "psr-0": { "Doctrine\\Common\\Annotations\\": "lib/" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + } +} diff --git a/php-doctrine-annotations-get-source.sh b/php-doctrine-annotations-get-source.sh index e283587..f8f69e8 100755 --- a/php-doctrine-annotations-get-source.sh +++ b/php-doctrine-annotations-get-source.sh @@ -37,6 +37,8 @@ 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..." @@ -45,6 +47,7 @@ pushd $TEMP_DIR pushd $GIT_DIR print "Checking out commit..." $GIT checkout $GIT_COMMIT + cp composer.json $CMP_FILE popd TAR_DIR=${GIT_NAME}-${GIT_COMMIT} @@ -52,7 +55,6 @@ pushd $TEMP_DIR mv $GIT_DIR $TAR_DIR - TAR_FILE=`$RPM --eval='%{_sourcedir}'`/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz print "TAR_FILE = $TAR_FILE" [ -e $TAR_FILE ] && rm -f $TAR_FILE diff --git a/php-doctrine-annotations.spec b/php-doctrine-annotations.spec index c255ca3..430b1fd 100644 --- a/php-doctrine-annotations.spec +++ b/php-doctrine-annotations.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-doctrine-annotations # -# Copyright (c) 2013-2015 Shawn Iwinski +# Copyright (c) 2013-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -36,7 +36,7 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 4%{?github_release}%{?dist} Summary: PHP docblock annotations parser library Group: Development/Libraries @@ -48,14 +48,15 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{name}-%{version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests %if %{with_tests} ## composer.json -BuildRequires: %{_bindir}/phpunit -BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-composer(doctrine/cache) < %{cache_max_ver} BuildRequires: php-composer(doctrine/cache) >= %{cache_min_ver} +BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: php-composer(doctrine/lexer) < %{lexer_max_ver} #BuildRequires: php-composer(doctrine/lexer) >= %%{lexer_min_ver} BuildRequires: php-doctrine-lexer >= %{lexer_min_ver} ## phpcompatinfo (computed from version 1.2.7) @@ -67,11 +68,11 @@ BuildRequires: php-reflection BuildRequires: php-spl BuildRequires: php-tokenizer # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json -Requires: php(language) >= %{php_min_ver} +Requires: php(language) >= %{php_min_ver} #Requires: php-composer(doctrine/lexer) >= %%{lexer_min_ver} Requires: php-doctrine-lexer >= %{lexer_min_ver} Requires: php-composer(doctrine/lexer) < %{lexer_max_ver} @@ -84,7 +85,7 @@ Requires: php-reflection Requires: php-spl Requires: php-tokenizer # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -95,42 +96,32 @@ Conflicts: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4 %description %{summary} (extracted from Doctrine Common). +Autoloader: %{phpdir}/Doctrine/Common/Annotations/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} + +%build : Create autoloader cat <<'AUTOLOAD' | tee lib/Doctrine/Common/Annotations/autoload.php register(); -} +\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\Annotations\\', __DIR__); -$fedoraClassLoader->addPrefix('Doctrine\\Common\\Annotations\\', dirname(dirname(dirname(__DIR__)))); - -require_once '%{phpdir}/Doctrine/Common/Lexer/autoload.php'; - -return $fedoraClassLoader; +\Fedora\Autoloader\Dependencies::required(array( + '%{phpdir}/Doctrine/Common/Lexer/autoload.php', +)); AUTOLOAD -%build -# Empty build section, nothing required - - %install -rm -rf %{buildroot} mkdir -p %{buildroot}%{phpdir} cp -rp lib/* %{buildroot}%{phpdir}/ @@ -144,26 +135,28 @@ sed "s#require.*autoload.*#require_once '%{buildroot}%{phpdir}/Doctrine/Common/A : Create tests bootstrap cat <<'BOOTSTRAP' | tee bootstrap.php - 1.2.7-4 +- Switch autoloader to php-composer(fedora/autoloader) +- Add max versions to build dependencies +- Test with SCLs if available + * Sat Sep 05 2015 Shawn Iwinski - 1.2.7-1 - Updated to 1.2.7 (RHBZ #1258669 / CVE-2015-5723) - Updated autoloader to load dependencies after self registration -- cgit