summaryrefslogtreecommitdiffstats
path: root/php-paragonie-constant-time-encoding.spec
blob: 453e10ef24dfd8e0e3f2125b8e838efdc6927861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# remirepo spec file for php-paragonie-constant-time-encoding, from:
#
# Fedora spec file for php-paragonie-constant-time-encoding
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#
%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 eccf915f45f911bfb189d1d1638d940ec6ee6e33
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})


Name:       php-%{composer_vendor}-constant-time-encoding
Version:    2.2.2
Release:    1%{?dist}
Summary:    Constant-time Implementations of RFC 4648 Encoding

Group:      System Environment/Libraries
License:    MIT

URL:        https://github.com/%{github_owner}/%{github_name}
Source0:    %{url}/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz

BuildArch:  noarch

BuildRequires:  php(language) >= 7.0
BuildRequires:  php-mbstring
BuildRequires:  php-spl
BuildRequires:  %{_bindir}/phpab
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
%global phpunit %{_bindir}/phpunit7
BuildRequires:  phpunit7
%else
%global phpunit %{_bindir}/phpunit6
BuildRequires:  phpunit6
%endif

Requires:   php(language) >= 7.0
Requires:   php-mbstring
Requires:   php-spl

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}

%build
%{_bindir}/phpab -o src/autoload.php src

%install
mkdir -p %{buildroot}%{_datadir}/php/%{composer_namespace}
cp -pr src/* %{buildroot}%{_datadir}/php/%{composer_namespace}

%check
%{_bindir}/phpab -o tests/autoload.php tests
cat <<'AUTOLOAD' | tee -a tests/autoload.php
require_once 'src/autoload.php';
AUTOLOAD

ret=0
for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit6" php71 php72; do
  if which $cmdarg; then
    set $cmdarg
    $1 ${2:-%{_bindir}/phpunit7} --no-coverage --verbose --bootstrap=tests/autoload.php || ret=1
  fi
done
exit $ret


%files
%dir %{_datadir}/php/ParagonIE
%{_datadir}/php/%{composer_namespace}
%doc README.md composer.json
%{!?_licensedir:%global license %%doc}
%license LICENSE.txt

%changelog
* Wed May  2 2018 Remi Collet <remi@remirepo.net> - 2.2.2-1
- update to 2.2.2 from Fedora
- raise dependency on PHP 7.0
- use phpunit6/phpunit7

* Tue May 01 2018 François Kooman <fkooman@tuxed.net> - 2.2.2-1
- update to 2.2.2 for PHP >= 7
- update dependencies
- switch to phpab autoload generator

* Sat Mar 10 2018 François Kooman <fkooman@tuxed.net> - 1.0.2-1
- update to 1.0.2

* Thu Mar 16 2017 Remi Collet <remi@remirepo.net> - 1.0.1-4
- backport for remi repository

* 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