Shawn Iwinski c3a3f80
#
Shawn Iwinski ab032da
# Fedora spec file for php-doctrine-inflector
Shawn Iwinski c3a3f80
#
cb18cd3
# Copyright (c) 2013-2019 Shawn Iwinski <shawn.iwinski@gmail.com>
Shawn Iwinski c3a3f80
#
Shawn Iwinski c3a3f80
# License: MIT
Shawn Iwinski c3a3f80
# http://opensource.org/licenses/MIT
Shawn Iwinski c3a3f80
#
Shawn Iwinski c3a3f80
# Please preserve changelog entries
Shawn Iwinski c3a3f80
#
Shawn Iwinski c3a3f80
Shawn Iwinski c3a3f80
%global github_owner     doctrine
Shawn Iwinski c3a3f80
%global github_name      inflector
cb18cd3
%global github_version   1.3.1
cb18cd3
%global github_commit    ec3a55242203ffa6a4b27c58176da97ff0a7aec1
Shawn Iwinski c3a3f80
Shawn Iwinski c3a3f80
%global composer_vendor  doctrine
Shawn Iwinski c3a3f80
%global composer_project inflector
Shawn Iwinski feeaff8
325db60
# "php": "^7.1"
325db60
%global php_min_ver 7.1
Shawn Iwinski c3a3f80
Shawn Iwinski c3a3f80
# Build using "--without tests" to disable tests
Shawn Iwinski b5acbf3
%global with_tests 0%{!?_without_tests:1}
Shawn Iwinski b5acbf3
Shawn Iwinski b5acbf3
%{!?phpdir:  %global phpdir  %{_datadir}/php}
Shawn Iwinski feeaff8
Shawn Iwinski c3a3f80
Name:          php-%{composer_vendor}-%{composer_project}
Shawn Iwinski feeaff8
Version:       %{github_version}
cb18cd3
Release:       1%{?github_release}%{?dist}
Shawn Iwinski feeaff8
Summary:       Common string manipulations with regard to casing and singular/plural rules
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
License:       MIT
Shawn Iwinski feeaff8
URL:           https://github.com/%{github_owner}/%{github_name}
325db60
325db60
# GitHub export does not include tests.
325db60
# Run php-doctrine-inflector-get-source.sh to create full source.
325db60
Source0:       %{name}-%{github_version}-%{github_commit}.tar.gz
325db60
Source1:       %{name}-get-source.sh
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
BuildArch:     noarch
Shawn Iwinski b5acbf3
# Tests
Shawn Iwinski c3a3f80
%if %{with_tests}
Shawn Iwinski b5acbf3
## composer.json
Shawn Iwinski b5acbf3
BuildRequires: %{_bindir}/phpunit
Shawn Iwinski feeaff8
BuildRequires: php(language) >= %{php_min_ver}
325db60
## phpcompatinfo (computed from version 1.3.0)
Shawn Iwinski feeaff8
BuildRequires: php-pcre
Shawn Iwinski b5acbf3
# Autoloader
f5f2228
BuildRequires: php-composer(fedora/autoloader)
Shawn Iwinski c3a3f80
%endif
Shawn Iwinski feeaff8
Shawn Iwinski b5acbf3
# composer.json
Shawn Iwinski feeaff8
Requires:      php(language) >= %{php_min_ver}
325db60
# phpcompatinfo (computed from version 1.3.0)
Shawn Iwinski feeaff8
Requires:      php-pcre
Shawn Iwinski b5acbf3
# Autoloader
f5f2228
Requires:      php-composer(fedora/autoloader)
Shawn Iwinski feeaff8
Shawn Iwinski c3a3f80
# Composer
Shawn Iwinski c3a3f80
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}
Shawn Iwinski c3a3f80
Shawn Iwinski feeaff8
%description
Shawn Iwinski feeaff8
Doctrine Inflector is a small library that can perform string manipulations
Shawn Iwinski feeaff8
with regard to upper-/lowercase and singular/plural forms of words.
Shawn Iwinski feeaff8
Shawn Iwinski 1953cef
Autoloader: %{phpdir}/Doctrine/Common/Inflector/autoload.php
Shawn Iwinski 1953cef
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
%prep
Shawn Iwinski c3a3f80
%setup -qn %{github_name}-%{github_commit}
Shawn Iwinski feeaff8
f5f2228
f5f2228
%build
Shawn Iwinski b5acbf3
: Create autoloader
Shawn Iwinski 1953cef
cat <<'AUTOLOAD' | tee lib/Doctrine/Common/Inflector/autoload.php
Shawn Iwinski b5acbf3
Shawn Iwinski b5acbf3
/**
Shawn Iwinski 1953cef
 * Autoloader for %{name} and its' dependencies
Shawn Iwinski 1953cef
 * (created by %{name}-%{version}-%{release}).
Shawn Iwinski b5acbf3
 */
f5f2228
require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
Shawn Iwinski b5acbf3
f5f2228
\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\Inflector\\', __DIR__);
Shawn Iwinski b5acbf3
AUTOLOAD
Shawn Iwinski b5acbf3
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
%install
Shawn Iwinski b5acbf3
mkdir -p %{buildroot}%{phpdir}
Shawn Iwinski b5acbf3
cp -rp lib/* %{buildroot}%{phpdir}/
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
%check
Shawn Iwinski c3a3f80
%if %{with_tests}
f5f2228
: Create tests bootstrap
f5f2228
cat <<'BOOTSTRAP' | tee bootstrap.php
Shawn Iwinski b5acbf3
f5f2228
require_once '%{buildroot}%{phpdir}/Doctrine/Common/Inflector/autoload.php';
f5f2228
\Fedora\Autoloader\Autoload::addPsr0('Doctrine\\Tests', __DIR__.'/tests');
f5f2228
BOOTSTRAP
f5f2228
f5f2228
: Upstream tests
f5f2228
RETURN_CODE=0
f5f2228
PHPUNIT=$(which phpunit)
cb18cd3
for PHP_EXEC in "" php71 php72 php73 php74; do
f5f2228
    if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
f5f2228
        $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \
f5f2228
            || RETURN_CODE=1
f5f2228
    fi
f5f2228
done
f5f2228
exit $RETURN_CODE
Shawn Iwinski c3a3f80
%else
Shawn Iwinski c3a3f80
: Tests skipped
Shawn Iwinski c3a3f80
%endif
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
%files
Shawn Iwinski 51976d6
%{!?_licensedir:%global license %%doc}
Shawn Iwinski 51976d6
%license LICENSE
Shawn Iwinski 1953cef
%doc *.md
Shawn Iwinski 1953cef
%doc composer.json
Shawn Iwinski b5acbf3
%dir %{phpdir}/Doctrine
Shawn Iwinski b5acbf3
%dir %{phpdir}/Doctrine/Common
Shawn Iwinski b5acbf3
     %{phpdir}/Doctrine/Common/Inflector
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
Shawn Iwinski feeaff8
%changelog
cb18cd3
* Wed Nov 13 2019 Remi Collet <remi@remirepo.net> - 1.3.1-1
cb18cd3
- update to 1.3.1
cb18cd3
34e3a3f
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-4
34e3a3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
34e3a3f
fd96cf2
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-3
fd96cf2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
fd96cf2
742be6d
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-2
742be6d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
742be6d
325db60
* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-1
325db60
- Update to 1.3.0 (RHBZ #1473993)
325db60
- Add get source script
325db60
- Add composer.json to repo
325db60
b45f05e
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-6
b45f05e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b45f05e
4beb9f5
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
4beb9f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4beb9f5
f5f2228
* Sat May 13 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1.0-4
f5f2228
- Switch autoloader to php-composer(fedora/autoloader)
f5f2228
- Test with SCLs if available
f5f2228
0801d21
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
0801d21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
0801d21
23b82ba
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
23b82ba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
23b82ba
Shawn Iwinski 1953cef
* Sun Jan 03 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1.0-1
Shawn Iwinski 1953cef
- Updated to 1.1.0 (RHBZ #1279884)
Shawn Iwinski 1953cef
Shawn Iwinski fb2581b
* Sat Jun 27 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-5
Shawn Iwinski fb2581b
- Updated autoloader with trailing separator
Shawn Iwinski fb2581b
Shawn Iwinski b5acbf3
* Wed Jun 24 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-4
Shawn Iwinski b5acbf3
- Added autoloader
Shawn Iwinski b5acbf3
aa02193
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-3
aa02193
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
aa02193
Shawn Iwinski 51976d6
* Sun Dec 28 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-2
Shawn Iwinski 51976d6
- %%license usage
Shawn Iwinski 51976d6
Shawn Iwinski b1c22ce
* Sun Dec 28 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.1-1
Shawn Iwinski b1c22ce
- Updated to 1.0.1 (BZ #1176943)
Shawn Iwinski b1c22ce
Shawn Iwinski c3a3f80
* Fri Jun 20 2014 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0-4.20131221gita81c334
Shawn Iwinski c3a3f80
- Added php-composer(%%{composer_vendor}/%%{composer_project}) virtual provide
Shawn Iwinski c3a3f80
- Added option to build without tests ("--without tests")
Shawn Iwinski c3a3f80
dcf3b55
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3.20131221gita81c334
dcf3b55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
dcf3b55
Shawn Iwinski 9bf0d38
* Mon Jan 06 2014 Shawn Iwinski <shawn.iwinski@gmail.com> 1.0-2.20131221gita81c334
Shawn Iwinski 9bf0d38
- Conditional %%{?dist}
Shawn Iwinski 9bf0d38
Shawn Iwinski feeaff8
* Mon Dec 23 2013 Shawn Iwinski <shawn.iwinski@gmail.com> 1.0-1.20131221gita81c334
Shawn Iwinski feeaff8
- Initial package