Blame php-phpdocumentor-reflection-common2.spec

0a54b24
# remirepo/fedora spec file for php-phpdocumentor-reflection-common2
0a54b24
#
0a54b24
# Copyright (c) 2017-2019 Remi Collet, Shawn Iwinski
0a54b24
#
0a54b24
# License: MIT
0a54b24
# http://opensource.org/licenses/MIT
0a54b24
#
0a54b24
# Please preserve changelog entries
0a54b24
#
0a54b24
0a54b24
%global github_owner     phpDocumentor
0a54b24
%global github_name      ReflectionCommon
0a54b24
%global github_version   2.0.0
0a54b24
%global github_commit    63a995caa1ca9e5590304cd845c15ad6d482a62a
0a54b24
0a54b24
%global composer_vendor  phpdocumentor
0a54b24
%global composer_project reflection-common
0a54b24
0a54b24
%global major            2
0a54b24
0a54b24
# "php": ">=7.1"
0a54b24
%global php_min_ver 7.1
0a54b24
0a54b24
# Build using "--without tests" to disable tests
0a54b24
%global with_tests 0%{!?_without_tests:1}
0a54b24
0a54b24
%{!?phpdir:  %global phpdir  %{_datadir}/php}
0a54b24
0a54b24
Name:          php-%{composer_vendor}-%{composer_project}%{major}
0a54b24
Version:       %{github_version}
0a54b24
Release:       2%{?github_release}%{?dist}
0a54b24
Summary:       Common reflection classes used by phpdocumentor
0a54b24
0a54b24
Group:         Development/Libraries
0a54b24
License:       MIT
0a54b24
URL:           https://github.com/%{github_owner}/%{github_name}
0a54b24
# GitHub export does not include tests.
0a54b24
# Run makesrc.sh to create full source.
0a54b24
Source0:       %{name}-%{github_version}-%{github_commit}.tar.gz
0a54b24
Source1:       makesrc.sh
0a54b24
0a54b24
BuildArch:     noarch
0a54b24
# Tests
0a54b24
%if %{with_tests}
0a54b24
## composer.json
0a54b24
BuildRequires: php(language) >= %{php_min_ver}
0a54b24
BuildRequires: phpunit6
0a54b24
## phpcompatinfo (computed from version 2.0.0)
0a54b24
BuildRequires: php-pcre
0a54b24
BuildRequires: php-spl
0a54b24
## Autoloader
0a54b24
BuildRequires: php-fedora-autoloader-devel
0a54b24
%endif
0a54b24
0a54b24
# composer.json
0a54b24
Requires:      php(language) >= %{php_min_ver}
0a54b24
# phpcompatinfo (computed from version 2.0.0)
0a54b24
Requires:      php-pcre
0a54b24
Requires:      php-spl
0a54b24
# Autoloader
0a54b24
Requires:      php-composer(fedora/autoloader)
0a54b24
0a54b24
# Composer
0a54b24
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}
0a54b24
0a54b24
%description
0a54b24
Common reflection classes used by phpdocumentor to reflect the code structure.
0a54b24
0a54b24
Autoloader: %{phpdir}/phpDocumentor/Reflection%{major}/autoload-common.php
0a54b24
0a54b24
0a54b24
%prep
0a54b24
%setup -qn %{github_name}-%{github_commit}
0a54b24
0a54b24
0a54b24
%build
0a54b24
: Create autoloader
0a54b24
%{_bindir}/phpab --template fedora --output src/autoload-common.php src
0a54b24
0a54b24
0a54b24
%install
0a54b24
mkdir -p %{buildroot}%{phpdir}/phpDocumentor
0a54b24
cp -rp src %{buildroot}%{phpdir}/phpDocumentor/Reflection%{major}
0a54b24
0a54b24
0a54b24
%check
0a54b24
%if %{with_tests}
0a54b24
BOOTSTRAP=%{buildroot}%{phpdir}/phpDocumentor/Reflection%{major}/autoload-common.php
0a54b24
0a54b24
: Upstream tests
0a54b24
RETURN_CODE=0
0a54b24
for PHP_EXEC in php php71 php72 php73 php74; do
0a54b24
    if which $PHP_EXEC; then
0a54b24
        $PHP_EXEC -d auto_prepend_file=$BOOTSTRAP \
0a54b24
            %{_bindir}/phpunit6 --verbose || RETURN_CODE=1
0a54b24
    fi
0a54b24
done
0a54b24
exit $RETURN_CODE
0a54b24
%else
0a54b24
: Tests skipped
0a54b24
%endif
0a54b24
0a54b24
0a54b24
%files
0a54b24
%{!?_licensedir:%global license %%doc}
0a54b24
%license LICENSE
0a54b24
%doc *.md
0a54b24
%doc composer.json
0a54b24
%dir %{phpdir}/phpDocumentor
0a54b24
%dir %{phpdir}/phpDocumentor/Reflection%{major}
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/autoload-common.php
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/Element.php
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/File.php
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/Fqsen.php
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/Location.php
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/Project.php
0a54b24
     %{phpdir}/phpDocumentor/Reflection%{major}/ProjectFactory.php
0a54b24
0a54b24
0a54b24
%changelog
0a54b24
* Fri Sep 13 2019 Remi Collet <remi@remirepo.net> - 2.0.0-2
0a54b24
- fix autoloader path in description
0a54b24
0a54b24
* Fri Sep 13 2019 Remi Collet <remi@remirepo.net> - 2.0.0-1
0a54b24
- update to 2.0.0
0a54b24
- rename to php-phpdocumentor-reflection-common2
0a54b24
- move to /usr/share/php/phpDocumentor/Reflection2
0a54b24
- raise dependency on PHP 7.1
0a54b24
- use phpunit6
0a54b24
0a54b24
* Sat Nov 18 2017 Remi Collet <remi@remirepo.net> - 1.0.1-1
0a54b24
- Update to 1.0.1
0a54b24
- ensure current version is used during the test
0a54b24
- use git snapshot as sources for tests
0a54b24
0a54b24
* Sat Mar 11 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0-1
0a54b24
- Initial package