From ea9718869a37e7037b3cbac13012215e48bf62d8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 22 Sep 2017 15:15:37 +0200 Subject: sync with fedora --- .gitignore | 8 ++++ php-symfony-security-acl.spec | 107 ++++++++++++++++++++---------------------- 2 files changed, 59 insertions(+), 56 deletions(-) create mode 100644 .gitignore 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/php-symfony-security-acl.spec b/php-symfony-security-acl.spec index 7a0c1b1..6e5f86f 100644 --- a/php-symfony-security-acl.spec +++ b/php-symfony-security-acl.spec @@ -22,7 +22,8 @@ %global php_min_ver 5.3.9 # "symfony/phpunit-bridge": "~2.7|~3.0.0" # "symfony/security-core": "~2.4|~3.0.0" -%global symfony_min_ver 2.7 +# NOTE: Min version not 2.7 because autoloader required +%global symfony_min_ver 2.7.1 %global symfony_max_ver 4.0 # "doctrine/common": "~2.2" # NOTE: Min version not 2.2 because autoloader required @@ -34,7 +35,7 @@ %global doctrine_dbal_max_ver 3.0 # "psr/log": "~1.0" # NOTE: Min version not 1.0 because autoloader required -%global psr_log_min_ver 1.0.0-8 +%global psr_log_min_ver 1.0.1 %global psr_log_max_ver 2.0 %global bootstrap 0 @@ -50,7 +51,7 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 4%{?github_release}%{?dist} Summary: Symfony Security Component - ACL (Access Control List) Group: Development/Libraries @@ -59,23 +60,25 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # Tests %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-composer(doctrine/common) < %{doctrine_common_max_ver} BuildRequires: php-composer(doctrine/common) >= %{doctrine_common_min_ver} +BuildRequires: php-composer(doctrine/dbal) < %{doctrine_dbal_max_ver} BuildRequires: php-composer(doctrine/dbal) >= %{doctrine_dbal_min_ver} BuildRequires: php-composer(phpunit/phpunit) -#BuildRequires: php-composer(psr/log) >= %%{psr_log_min_ver} -BuildRequires: php-PsrLog >= %{psr_log_min_ver} +BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} +BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} +BuildRequires: php-composer(symfony/security-core) < %{symfony_max_ver} BuildRequires: php-composer(symfony/security-core) >= %{symfony_min_ver} ## phpcompatinfo (computed from version 2.8.0) BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl ## Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json @@ -87,19 +90,13 @@ Requires: php-pcre Requires: php-reflection Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Weak dependencies %if 0%{?fedora} >= 21 Suggests: php-composer(doctrine/dbal) -%endif -Conflicts: php-doctrine-dbal < %{doctrine_dbal_min_ver} -Conflicts: php-doctrine-dbal >= %{doctrine_dbal_max_ver} -%if 0%{?fedora} >= 21 Suggests: php-composer(symfony/finder) %endif -Conflicts: php-symfony-finder < %{symfony_min_ver} -Conflicts: php-symfony-finder >= %{symfony_max_ver} # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -116,47 +113,38 @@ Autoloader: %{phpdir}/Symfony/Component/Security/Acl/autoload.php %prep %setup -qn %{github_name}-%{github_commit} + +%build : Create autoloader cat <<'AUTOLOAD' | tee autoload.php register(true); -} - -$fedoraPsr4ClassLoader->addPrefix('Symfony\\Component\\Security\\Acl\\', __DIR__); - -// Dependencies (autoloader => required) -foreach(array( - '%{phpdir}/Doctrine/DBAL/autoload.php' => false, - '%{phpdir}/Symfony/Component/Finder/autoload.php' => false, - '%{phpdir}/Symfony/Component/Security/autoload.php' => true, -) as $dependencyAutoloader => $required) { - if ($required || file_exists($dependencyAutoloader)) { - require_once $dependencyAutoloader; - } -} +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\Security\\Acl\\', __DIR__); + +\Fedora\Autoloader\Dependencies::required(array( + '%{phpdir}/Doctrine/DBAL/autoload.php', + array( + '%{phpdir}/Symfony3/Component/Security/autoload.php', + '%{phpdir}/Symfony/Component/Security/autoload.php', + ), +)); + +\Fedora\Autoloader\Dependencies::optional(array( + '%{phpdir}/Doctrine/DBAL/autoload.php', + array( + '%{phpdir}/Symfony3/Component/Finder/autoload.php', + '%{phpdir}/Symfony/Component/Finder/autoload.php', + ), +)); AUTOLOAD -%build -# Empty build section, nothing to build - - %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{phpdir}/Symfony/Component/Security/Acl cp -rp * %{buildroot}%{phpdir}/Symfony/Component/Security/Acl/ @@ -168,26 +156,27 @@ cat <<'BOOTSTRAP' | tee bootstrap.php - 2.8.0-4 +- Add max versions to BuildRequires +- Switch autoloader to fedora/autoloader +- Remove Conflicts for Suggests +- Test with SCLs if available + * Tue May 31 2016 Remi Collet - 2.8.0-1 - add backport stuff for remi repository -- cgit