Shawn Iwinski 6446b17
#
Shawn Iwinski e2c2ee5
# Fedora spec file for php-doctrine-doctrine-cache-bundle
Shawn Iwinski 6446b17
#
d7b8a8c
# Copyright (c) 2015-2018 Shawn Iwinski <shawn.iwinski@gmail.com>
Shawn Iwinski 6446b17
#
Shawn Iwinski 6446b17
# License: MIT
Shawn Iwinski 6446b17
# http://opensource.org/licenses/MIT
Shawn Iwinski 6446b17
#
Shawn Iwinski 6446b17
# Please preserve changelog entries
Shawn Iwinski 6446b17
#
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%global github_owner     doctrine
Shawn Iwinski 6446b17
%global github_name      DoctrineCacheBundle
87154ee
%global github_version   1.4.0
87154ee
%global github_commit    6bee2f9b339847e8a984427353670bad4e7bdccb
c740b1b
%global github_short     %(c=%{github_commit}; echo ${c:0:7})
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%global composer_vendor  doctrine
Shawn Iwinski 6446b17
%global composer_project doctrine-cache-bundle
Shawn Iwinski 6446b17
87154ee
# "php": "^7.1"
87154ee
%global php_min_ver 7.1
Shawn Iwinski a07e4e7
# "doctrine/cache": "^1.4.2"
Shawn Iwinski a07e4e7
%global cache_min_ver 1.4.2
Shawn Iwinski 6446b17
%global cache_max_ver 2.0
Shawn Iwinski 6446b17
# "doctrine/inflector": "~1.0"
Shawn Iwinski 6446b17
%global inflector_min_ver 1.0
Shawn Iwinski 6446b17
%global inflector_max_ver 2.0
87154ee
# "symfony/doctrine-bridge":  "^3.4|^4.0"
87154ee
# "symfony/yaml":             "^3.4|^4.0",
87154ee
# "symfony/validator":        "^3.4|^4.0",
87154ee
# "symfony/console":          "^3.4|^4.0",
87154ee
# "symfony/finder":           "^3.4|^4.0",
87154ee
# "symfony/framework-bundle": "^3.4|^4.0",
87154ee
%global symfony_min_ver 3.4
775bc52
%global symfony_max_ver 5
87154ee
# "symfony/security-acl":     "^2.8",
87154ee
%global secacl_min_ver 2.8
87154ee
%global secacl_max_ver 3
Shawn Iwinski 6446b17
c4196dc
# Build using "--with tests" to enable tests
c4196dc
%global with_tests 0%{?_with_tests:1}
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%{!?phpdir:  %global phpdir  %{_datadir}/php}
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
Name:          php-%{composer_vendor}-%{composer_project}
Shawn Iwinski 6446b17
Version:       %{github_version}
6afa23e
Release:       8%{?dist}
Shawn Iwinski 6446b17
Summary:       Symfony2 Bundle for Doctrine Cache
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
License:       MIT
Shawn Iwinski 6446b17
URL:           https://github.com/%{github_owner}/%{github_name}
c740b1b
Source0:       %{name}-%{github_version}-%{github_short}.tgz
c740b1b
Source1:       makesrc.sh
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
BuildArch:     noarch
Shawn Iwinski 6446b17
# Tests
Shawn Iwinski 6446b17
%if %{with_tests}
Shawn Iwinski 6446b17
## composer.json
f98aec5
BuildRequires: php(language) >= %{php_min_ver}
d7b8a8c
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
d7b8a8c
BuildRequires: (php-composer(doctrine/cache) >= %{cache_min_ver} with php-composer(doctrine/cache) <  %{cache_max_ver})
d7b8a8c
BuildRequires: (php-composer(doctrine/inflector) >= %{inflector_min_ver} with php-composer(doctrine/inflector) <  %{inflector_max_ver})
87154ee
BuildRequires: (php-composer(symfony/security-acl) >= %{secacl_min_ver} with php-composer(symfony/security-acl) <  %{secacl_max_ver})
d7b8a8c
# ensure we use same version of all components
d7b8a8c
BuildRequires: php-symfony4-console
d7b8a8c
BuildRequires: php-symfony4-doctrine-bridge
d7b8a8c
BuildRequires: php-symfony4-finder
d7b8a8c
BuildRequires: php-symfony4-framework-bundle
d7b8a8c
BuildRequires: php-symfony4-validator
d7b8a8c
BuildRequires: php-symfony4-yaml
Shawn Iwinski a07e4e7
%else
87154ee
BuildRequires: php-doctrine-cache >= %{cache_min_ver}
87154ee
BuildRequires: php-doctrine-inflector >= %{inflector_min_ver}
87154ee
BuildRequires: php-symfony-security-acl
87154ee
BuildRequires: php-symfony4-console
87154ee
BuildRequires: php-symfony4-doctrine-bridge
87154ee
BuildRequires: php-symfony4-finder
87154ee
BuildRequires: php-symfony4-framework-bundle
87154ee
BuildRequires: php-symfony4-validator
87154ee
BuildRequires: php-symfony4-yaml
Shawn Iwinski a07e4e7
%endif
87154ee
BuildRequires: phpunit7
87154ee
%global phpunit %{_bindir}/phpunit7
c740b1b
## phpcompatinfo (computed from version 1.3.4)
Shawn Iwinski 6446b17
BuildRequires: php-hash
Shawn Iwinski 6446b17
BuildRequires: php-reflection
Shawn Iwinski 6446b17
BuildRequires: php-spl
Shawn Iwinski 6446b17
## Autoloader
f98aec5
BuildRequires: php-composer(fedora/autoloader)
Shawn Iwinski 6446b17
%endif
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
# composer.json
f98aec5
Requires:      php(language) >= %{php_min_ver}
d7b8a8c
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
d7b8a8c
Requires:      (php-composer(doctrine/cache) >= %{cache_min_ver} with php-composer(doctrine/cache) <  %{cache_max_ver})
d7b8a8c
Requires:      (php-composer(doctrine/inflector) >= %{inflector_min_ver} with php-composer(doctrine/inflector) <  %{inflector_max_ver})
d7b8a8c
Requires:      (php-composer(symfony/doctrine-bridge) >= %{symfony_min_ver} with php-composer(symfony/doctrine-bridge) <  %{symfony_max_ver})
d7b8a8c
%else
87154ee
Requires:      php-doctrine-cache >= %{cache_min_ver}
87154ee
Requires:      php-doctrine-inflector >= %{inflector_min_ver}
87154ee
Requires:      php-symfony4-doctrine-bridge >= %{symfony_min_ver}
d7b8a8c
%endif
87154ee
# phpcompatinfo (computed from version 1.4.0)
Shawn Iwinski 6446b17
Requires:      php-hash
Shawn Iwinski 6446b17
Requires:      php-reflection
Shawn Iwinski 6446b17
Requires:      php-spl
Shawn Iwinski 6446b17
# Autoloader
f98aec5
Requires:      php-composer(fedora/autoloader)
Shawn Iwinski a07e4e7
# Weak dependencies
d7b8a8c
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
Shawn Iwinski a07e4e7
Suggests:      php-pecl(memcache)
Shawn Iwinski a07e4e7
Suggests:      php-pecl(memcached)
Shawn Iwinski a07e4e7
Suggests:      php-pecl(mongo)
Shawn Iwinski a07e4e7
Suggests:      php-composer(symfony/security-acl)
Shawn Iwinski a07e4e7
%endif
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
# Composer
Shawn Iwinski 6446b17
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%description
Shawn Iwinski 6446b17
%{summary}.
Shawn Iwinski 6446b17
Shawn Iwinski a07e4e7
Autoloader: %{phpdir}/Doctrine/Bundle/DoctrineCacheBundle/autoload.php
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%prep
Shawn Iwinski 6446b17
%setup -qn %{github_name}-%{github_commit}
Shawn Iwinski 6446b17
f98aec5
f98aec5
%build
Shawn Iwinski 6446b17
: Create autoloader
Shawn Iwinski a07e4e7
cat <<'AUTOLOAD' | tee autoload.php
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
/**
Shawn Iwinski a07e4e7
 * Autoloader for %{name} and its' dependencies
Shawn Iwinski a07e4e7
 * (created by %{name}-%{version}-%{release}).
Shawn Iwinski 6446b17
 */
f98aec5
require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
Shawn Iwinski 6446b17
f98aec5
\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Bundle\\DoctrineCacheBundle\\', __DIR__);
Shawn Iwinski a07e4e7
87154ee
\Fedora\Autoloader\Dependencies::required([
f98aec5
    '%{phpdir}/Doctrine/Common/Cache/autoload.php',
f98aec5
    '%{phpdir}/Doctrine/Common/Inflector/autoload.php',
87154ee
    [
775bc52
        (getenv('RPM_SYMFONY_TREE')?:'%{phpdir}/Symfony4') . '/Bridge/Doctrine/autoload.php',
775bc52
        '%{phpdir}/Symfony3/Bridge/Doctrine/autoload.php',
87154ee
    ],
87154ee
]);
Shawn Iwinski a07e4e7
87154ee
\Fedora\Autoloader\Dependencies::optional([
87154ee
    [
2cd4f5e
        '%{phpdir}/Symfony/Component/Security/autoload.php',
87154ee
    ],
87154ee
]);
Shawn Iwinski 6446b17
AUTOLOAD
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%install
Shawn Iwinski 6446b17
mkdir -p %{buildroot}%{phpdir}/Doctrine/Bundle/DoctrineCacheBundle
Shawn Iwinski 6446b17
cp -pr Acl Command DependencyInjection Resources Tests *.php \
Shawn Iwinski 6446b17
    %{buildroot}%{phpdir}/Doctrine/Bundle/DoctrineCacheBundle/
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%check
Shawn Iwinski 6446b17
%if %{with_tests}
Shawn Iwinski a07e4e7
: Create tests bootstrap
Shawn Iwinski a07e4e7
cat <<'BOOTSTRAP' | tee bootstrap.php
Shawn Iwinski a07e4e7
f98aec5
require_once '%{buildroot}%{phpdir}/Doctrine/Bundle/DoctrineCacheBundle/autoload.php';
f98aec5
87154ee
\Fedora\Autoloader\Dependencies::required([
87154ee
    [
d7b8a8c
        '%{phpdir}/Symfony4/Bundle/FrameworkBundle/autoload.php',
2cd4f5e
        '%{phpdir}/Symfony3/Bundle/FrameworkBundle/autoload.php',
87154ee
    ], [
d7b8a8c
        '%{phpdir}/Symfony4/Component/Console/autoload.php',
2cd4f5e
        '%{phpdir}/Symfony3/Component/Console/autoload.php',
87154ee
    ], [
d7b8a8c
        '%{phpdir}/Symfony4/Component/Finder/autoload.php',
2cd4f5e
        '%{phpdir}/Symfony3/Component/Finder/autoload.php',
87154ee
    ], [
d7b8a8c
        '%{phpdir}/Symfony4/Component/Validator/autoload.php',
2cd4f5e
        '%{phpdir}/Symfony3/Component/Validator/autoload.php',
87154ee
    ], [
d7b8a8c
        '%{phpdir}/Symfony4/Component/Yaml/autoload.php',
2cd4f5e
        '%{phpdir}/Symfony3/Component/Yaml/autoload.php',
87154ee
    ],
87154ee
]);
Shawn Iwinski a07e4e7
BOOTSTRAP
Shawn Iwinski a07e4e7
Shawn Iwinski 6446b17
: Modify PHPUnit config
Shawn Iwinski 6446b17
sed -e 's#\./#%{buildroot}%{phpdir}/Doctrine/Bundle/DoctrineCacheBundle/#g' \
Shawn Iwinski 6446b17
    -e 's#>\.<#>%{buildroot}%{phpdir}/Doctrine/Bundle/DoctrineCacheBundle<#' \
Shawn Iwinski 6446b17
    -i phpunit.xml.dist
Shawn Iwinski 6446b17
Shawn Iwinski a07e4e7
: Remove tests requiring a server to connect to
Shawn Iwinski a07e4e7
pushd %{buildroot}%{phpdir}/Doctrine/Bundle/DoctrineCacheBundle/Tests
Shawn Iwinski a07e4e7
    rm -f \
Shawn Iwinski a07e4e7
        Functional/Fixtures/config/predis.xml \
Shawn Iwinski a07e4e7
        Functional/PredisCacheTest.php
Shawn Iwinski a07e4e7
popd
Shawn Iwinski a07e4e7
f98aec5
: Upstream tests
f98aec5
RETURN_CODE=0
87154ee
for cmdarg in "php %{phpunit}" php71 php72 php73 php74; do
c740b1b
    if which $cmdarg; then
c740b1b
        set $cmdarg
c740b1b
        $1 ${2:-%{_bindir}/phpunit7} --verbose --bootstrap bootstrap.php \
f98aec5
            || RETURN_CODE=1
f98aec5
    fi
f98aec5
done
f98aec5
exit $RETURN_CODE
Shawn Iwinski 6446b17
%else
Shawn Iwinski 6446b17
: Tests skipped
Shawn Iwinski 6446b17
%endif
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%files
Shawn Iwinski 6446b17
%{!?_licensedir:%global license %%doc}
Shawn Iwinski 6446b17
%license LICENSE
Shawn Iwinski 6446b17
%doc *.md
Shawn Iwinski 6446b17
%doc composer.json
Shawn Iwinski 6446b17
%dir %{phpdir}/Doctrine/Bundle
Shawn Iwinski 6446b17
     %{phpdir}/Doctrine/Bundle/DoctrineCacheBundle
Shawn Iwinski 6446b17
%exclude %{phpdir}/Doctrine/Bundle/DoctrineCacheBundle/Tests
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
%changelog
6afa23e
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-8
6afa23e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
6afa23e
3207eae
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-7
3207eae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
3207eae
69dac4c
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-6
69dac4c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
69dac4c
9c0d238
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-5
9c0d238
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
9c0d238
fcea871
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-4
fcea871
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
fcea871
7f88168
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-3
7f88168
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
7f88168
11a432c
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-2
11a432c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
11a432c
87154ee
* Wed Mar 25 2020 Remi Collet <remi@remirepo.net> - 1.4.0-1
87154ee
- update to 1.4.0
87154ee
- raise dependency on PHP 7.1
87154ee
- raise dependency on Symfony 3.4
87154ee
c4196dc
* Sun Feb 23 2020 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.5-5
c4196dc
- Disable tests by default (for now) to fix FTBFS (RHBZ #1799868)
c4196dc
23fcc0b
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.5-4
23fcc0b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
23fcc0b
60bc5a4
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.5-3
60bc5a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
60bc5a4
d1b6a38
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.5-2
d1b6a38
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d1b6a38
e818ccf
* Fri Nov  9 2018 Remi Collet <remi@remirepo.net> - 1.3.5-1
e818ccf
- update to 1.3.5
e818ccf
c740b1b
* Thu Nov  8 2018 Remi Collet <remi@remirepo.net> - 1.3.4-1
c740b1b
- update to 1.3.4 (no change)
c740b1b
- sources from git snapshot
c740b1b
- use phpunit7
c740b1b
d7b8a8c
* Wed Oct 17 2018 Remi Collet <remi@remirepo.net> - 1.3.3-1
d7b8a8c
- update to 1.3.3
d7b8a8c
- switch to Symfony 4 for test suite
d7b8a8c
- use range dependencies
d7b8a8c
85b7089
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-3
85b7089
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
85b7089
7f9e101
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-2
7f9e101
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7f9e101
e9423cb
* Fri Nov 10 2017 Remi Collet <remi@remirepo.net> - 1.3.2-1
e9423cb
- Update to 1.3.2
e9423cb
- fix FTBFS from Koschei
869a74c
- ensure we use same version of all component at build time
775bc52
- allow symfony/doctrine-bridge v4
e9423cb
fceb465
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-7
fceb465
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fceb465
f143fff
* Wed May 31 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-6
f143fff
- Fix test failures with Symfony 2.8.21 (see
f143fff
  https://github.com/doctrine/DoctrineCacheBundle/pull/112)
f143fff
c5ae94d
* Tue May 30 2017 Remi Collet <remi@remirepo.net> - 1.3.0-5
c5ae94d
- allow to force Symfony version using RPM_SYMFONY_TREE
c5ae94d
2cd4f5e
* Sun May 14 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-4
2cd4f5e
- Fix autoloder for Symfony 3
2cd4f5e
f98aec5
* Fri May 12 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-3
f98aec5
- Switch autoloader to php-composer(fedora/autoloader)
f98aec5
- Add max versions to build dependencies
f98aec5
- Test with SCLs if available
f98aec5
9950070
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-2
9950070
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9950070
Shawn Iwinski a07e4e7
* Thu Mar 31 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-1
Shawn Iwinski a07e4e7
- Updated to 1.3.0 (RHBZ #1279828)
Shawn Iwinski a07e4e7
- Updated dependency versions for their autoloaders and modified autoloader
Shawn Iwinski a07e4e7
  to use those autoloaders
Shawn Iwinski a07e4e7
8b2a2b9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-4
8b2a2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
8b2a2b9
Shawn Iwinski 31f0263
* Sat Jun 27 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-3
Shawn Iwinski f94c6ca
- Updated autoloader with trailing separator
Shawn Iwinski f94c6ca
Shawn Iwinski 6446b17
* Tue Jun 16 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-2
Shawn Iwinski 6446b17
- Fix dependencies
Shawn Iwinski 6446b17
Shawn Iwinski 6446b17
* Thu Jun 11 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-1
Shawn Iwinski 6446b17
- Initial package