Shawn Iwinski f6170f9
#
Shawn Iwinski 80a4896
# Fedora spec file for php-doctrine-collections
Shawn Iwinski f6170f9
#
Shawn Iwinski 5a108f2
# Copyright (c) 2013-2015 Shawn Iwinski <shawn.iwinski@gmail.com>
Shawn Iwinski f6170f9
#
Shawn Iwinski f6170f9
# License: MIT
Shawn Iwinski f6170f9
# http://opensource.org/licenses/MIT
Shawn Iwinski f6170f9
#
Shawn Iwinski f6170f9
# Please preserve changelog entries
Shawn Iwinski f6170f9
#
Shawn Iwinski f6170f9
Shawn Iwinski f6170f9
%global github_owner     doctrine
Shawn Iwinski f6170f9
%global github_name      collections
Shawn Iwinski 5a108f2
%global github_version   1.3.0
Shawn Iwinski 5a108f2
%global github_commit    6c1e4eef75f310ea1b3e30945e9f06e652128b8a
Shawn Iwinski f6170f9
Shawn Iwinski f6170f9
%global composer_vendor  doctrine
Shawn Iwinski f6170f9
%global composer_project collections
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
# "php": ">=5.3.2"
Shawn Iwinski f6170f9
%global php_min_ver      5.3.2
Shawn Iwinski 0e9f70f
Shawn Iwinski f6170f9
# Build using "--without tests" to disable tests
Shawn Iwinski 5a108f2
%global with_tests 0%{!?_without_tests:1}
Shawn Iwinski 5a108f2
Shawn Iwinski 5a108f2
%{!?phpdir:  %global phpdir  %{_datadir}/php}
Shawn Iwinski f6170f9
Shawn Iwinski f6170f9
Name:          php-%{composer_vendor}-%{composer_project}
Shawn Iwinski 0e9f70f
Version:       %{github_version}
Shawn Iwinski 0af0380
Release:       3%{?github_release}%{?dist}
Shawn Iwinski 0e9f70f
Summary:       Collections abstraction library
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Group:         Development/Libraries
Shawn Iwinski 0e9f70f
License:       MIT
Shawn Iwinski 0e9f70f
URL:           https://github.com/%{github_owner}/%{github_name}
Shawn Iwinski 0e9f70f
Source0:       %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
BuildArch:     noarch
Shawn Iwinski 5a108f2
# Tests
Shawn Iwinski f6170f9
%if %{with_tests}
Shawn Iwinski 5a108f2
## composer.json
Shawn Iwinski 5a108f2
BuildRequires: %{_bindir}/phpunit
Shawn Iwinski 0e9f70f
BuildRequires: php(language) >= %{php_min_ver}
Shawn Iwinski 5a108f2
## phpcompatinfo (computed from version 1.3.0)
Shawn Iwinski 0e9f70f
BuildRequires: php-spl
Shawn Iwinski 5009f44
# Autoloader
Shawn Iwinski 5009f44
BuildRequires: php-composer(symfony/class-loader)
Shawn Iwinski f6170f9
%endif
Shawn Iwinski 0e9f70f
Shawn Iwinski 5a108f2
# composer.json
Shawn Iwinski 0e9f70f
Requires:      php(language) >= %{php_min_ver}
Shawn Iwinski 5a108f2
# phpcompatinfo (computed from version 1.3.0)
Shawn Iwinski 0e9f70f
Requires:      php-spl
Shawn Iwinski 5009f44
# Autoloader
Shawn Iwinski 5009f44
Requires:      php-composer(symfony/class-loader)
Shawn Iwinski 0e9f70f
Shawn Iwinski f6170f9
# Composer
Shawn Iwinski f6170f9
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}
Shawn Iwinski f6170f9
Shawn Iwinski 0e9f70f
# Extracted from Doctrine Common as of version 2.4
Shawn Iwinski 0e9f70f
Conflicts:     php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%description
Shawn Iwinski 0e9f70f
%{summary}.
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%prep
Shawn Iwinski f6170f9
%setup -qn %{github_name}-%{github_commit}
Shawn Iwinski 0e9f70f
Shawn Iwinski 5a108f2
: Create autoloader
Shawn Iwinski 5a108f2
(cat <<'AUTOLOAD'
Shawn Iwinski 5a108f2
Shawn Iwinski 5a108f2
/**
Shawn Iwinski 5a108f2
 * Autoloader created by %{name}-%{version}-%{release}
Shawn Iwinski 5a108f2
 *
Shawn Iwinski 5a108f2
 * @return \Symfony\Component\ClassLoader\ClassLoader
Shawn Iwinski 5a108f2
 */
Shawn Iwinski 5a108f2
Shawn Iwinski 5a108f2
if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
Shawn Iwinski 5a108f2
    if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
Shawn Iwinski 5a108f2
        require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
Shawn Iwinski 5a108f2
    }
Shawn Iwinski 5a108f2
Shawn Iwinski 5a108f2
    $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
Shawn Iwinski 5a108f2
    $fedoraClassLoader->register();
Shawn Iwinski 5a108f2
}
Shawn Iwinski 5a108f2
Shawn Iwinski 0af0380
$fedoraClassLoader->addPrefix('Doctrine\\Common\\Collections\\', dirname(dirname(dirname(__DIR__))));
Shawn Iwinski 5a108f2
Shawn Iwinski 5a108f2
return $fedoraClassLoader;
Shawn Iwinski 5a108f2
AUTOLOAD
Shawn Iwinski 5a108f2
) | tee lib/Doctrine/Common/Collections/autoload.php
Shawn Iwinski 5a108f2
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%build
Shawn Iwinski 0e9f70f
# Empty build section, nothing required
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%install
Shawn Iwinski 5009f44
mkdir -p %{buildroot}%{phpdir}
Shawn Iwinski 5009f44
cp -rp lib/* %{buildroot}%{phpdir}/
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%check
Shawn Iwinski f6170f9
%if %{with_tests}
Shawn Iwinski 5a108f2
: Create tests autoloader
Shawn Iwinski 5a108f2
(cat <<'AUTOLOAD'
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Shawn Iwinski 5a108f2
$fedoraClassLoader =
Shawn Iwinski 5009f44
    require_once '%{buildroot}%{phpdir}/Doctrine/Common/Collections/autoload.php';
Shawn Iwinski 0e9f70f
Shawn Iwinski 5a108f2
$fedoraClassLoader->addPrefix('Doctrine\\Tests', __DIR__ . '/tests');
Shawn Iwinski 5a108f2
AUTOLOAD
Shawn Iwinski 5a108f2
) | tee autoload.php
Shawn Iwinski 5a108f2
Shawn Iwinski 5a108f2
: Run tests
Shawn Iwinski 5a108f2
%{_bindir}/phpunit -v --bootstrap autoload.php
Shawn Iwinski f6170f9
%else
Shawn Iwinski f6170f9
: Tests skipped
Shawn Iwinski f6170f9
%endif
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%files
Shawn Iwinski 5a108f2
%{!?_licensedir:%global license %%doc}
Shawn Iwinski 5a108f2
%license LICENSE
Shawn Iwinski 5a108f2
%doc *.md
Shawn Iwinski 5a108f2
%doc composer.json
Shawn Iwinski 5a108f2
%dir %{phpdir}/Doctrine
Shawn Iwinski 5a108f2
%dir %{phpdir}/Doctrine/Common
Shawn Iwinski 5a108f2
     %{phpdir}/Doctrine/Common/Collections
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
Shawn Iwinski 0e9f70f
%changelog
Shawn Iwinski 0af0380
* Sat Jun 27 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-3
Shawn Iwinski 0af0380
- Updated autoloader with trailing separator
Shawn Iwinski 0af0380
Shawn Iwinski 5009f44
* Wed Jun 24 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-2
Shawn Iwinski 5009f44
- Added autoloader dependencies
Shawn Iwinski 5009f44
Shawn Iwinski 5a108f2
* Wed Jun 24 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-1
Shawn Iwinski 5a108f2
- Updated to 1.3.0 (RHBZ #1211818)
Shawn Iwinski 5a108f2
- Added autoloader
Shawn Iwinski 5a108f2
- %%license usage
Shawn Iwinski 5a108f2
5bd6c2d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-4
5bd6c2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5bd6c2d
Shawn Iwinski f6170f9
* Fri Jun 20 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2-3
Shawn Iwinski f6170f9
- Added php-composer(%%{composer_vendor}/%%{composer_project}) virtual provide
Shawn Iwinski f6170f9
- Added option to build without tests ("--without tests")
Shawn Iwinski f6170f9
73df135
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-2
73df135
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
73df135
Shawn Iwinski f6170f9
* Wed Feb 12 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2-1
Shawn Iwinski 704d963
- Updated to 1.2 (BZ #1061117)
Shawn Iwinski 704d963
Shawn Iwinski f6170f9
* Mon Jan 06 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1-3.20131221git8198717
Shawn Iwinski e4c935e
- Minor syntax changes
Shawn Iwinski e4c935e
Shawn Iwinski f6170f9
* Fri Jan 03 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1-2.20131221git8198717
Shawn Iwinski 0e9f70f
- Conditional %%{?dist}
Shawn Iwinski 0e9f70f
- Added conflict w/ PEAR-based DoctrineCommon pkg (version < 2.4)
Shawn Iwinski 0e9f70f
Shawn Iwinski f6170f9
* Mon Dec 23 2013 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1-1.20131221git8198717
Shawn Iwinski 0e9f70f
- Initial package