php-paragonie-constant-time.../php-paragonie-constant-time-encoding.spec
2018-08-20 17:49:33 +02:00

110 lines
3.4 KiB
RPMSpec

%global composer_vendor paragonie
%global composer_project constant_time_encoding
%global composer_namespace ParagonIE/ConstantTime
%global github_owner paragonie
%global github_name constant_time_encoding
%global commit0 2132f0f293d856026d7d11bd81b9f4a23a1dc1f6
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Name: php-%{composer_vendor}-constant-time-encoding
Version: 1.0.4
Release: 2%{?dist}
Summary: Constant-Time Character Encoding in PHP Projects
Group: System Environment/Libraries
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz
# https://github.com/paragonie/constant_time_encoding/pull/16
Patch0: 840f7d9757207c72a3836d303242a74f747bfce3.patch
BuildArch: noarch
BuildRequires: php(language) >= 5.3.0
BuildRequires: php-mbstring
BuildRequires: php-spl
BuildRequires: php-pcre
BuildRequires: php-composer(fedora/autoloader)
BuildRequires: php-composer(paragonie/random_compat)
BuildRequires: %{_bindir}/phpunit
Requires: php(language) >= 5.3.0
Requires: php-mbstring
Requires: php-spl
Requires: php-composer(fedora/autoloader)
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%description
Based on the constant-time base64 implementation made by Steve "Sc00bz"
Thomas, this library aims to offer character encoding functions that do not
leak information about what you are encoding/decoding via processor cache
misses.
%prep
%setup -n %{github_name}-%{commit0}
%patch0 -p1
%build
cat <<'AUTOLOAD' | tee src/autoload.php
<?php
require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('ParagonIE\\ConstantTime\\', __DIR__);
AUTOLOAD
%install
mkdir -p %{buildroot}%{_datadir}/php/%{composer_namespace}
cp -pr src/* %{buildroot}%{_datadir}/php/%{composer_namespace}
%check
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
require_once '%{buildroot}%{_datadir}/php/%{composer_namespace}/autoload.php';
require_once '%{_datadir}/php/random_compat/autoload.php';
EOF
phpunit --no-coverage --verbose
%files
%dir %{_datadir}/php/ParagonIE
%{_datadir}/php/%{composer_namespace}
%doc README.md composer.json
%license LICENSE.txt
%changelog
* Mon Aug 20 2018 François Kooman <fkooman@tuxed.net> - 1.0.4-2
- add patch to fix unit tests on EPEL
* Fri May 11 2018 François Kooman <fkooman@tuxed.net> - 1.0.4-1
- update to 1.0.4
* Mon Apr 30 2018 François Kooman <fkooman@tuxed.net> - 1.0.3-1
- update to 1.0.3
* Sat Mar 10 2018 François Kooman <fkooman@tuxed.net> - 1.0.2-1
- update to 1.0.2
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Mar 15 2017 François Kooman <fkooman@tuxed.net> - 1.0.1-4
- own parent directory
- remove Requires paragonie/random_compat, only needed for build
- BuildRequire php-pcre
- rework check autoloader
* Mon Mar 13 2017 François Kooman <fkooman@tuxed.net> - 1.0.1-3
- better follow SourceURL package guidelines for GH
* Mon Feb 13 2017 François Kooman <fkooman@tuxed.net> - 1.0.1-2
- add random_compat as dependency to be able to run tests on PHP < 7
* Mon Feb 13 2017 François Kooman <fkooman@tuxed.net> - 1.0.1-1
- initial package