blob: 035b2fa22a4e17952a84d8ef085b772079da543d (
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
|
# remirepo/fedora spec file for php-http-message-factory
#
# Copyright (c) 2019-2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# Github
%global gh_commit 4d8778e1c7d405cbb471574821c1ff5b68cc8f57
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner php-http
%global gh_project message-factory
# Packagist
%global pk_vendor %{gh_owner}
%global pk_project %{gh_project}
# Namespace
%global ns_vendor Http
%global ns_project Message
# skip duplicated php prefix
Name: %{pk_vendor}-%{pk_project}
Version: 1.1.0
Release: 1%{?dist}
Summary: Factory interfaces for PSR-7 HTTP Message
License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
# git snapshot for skip .gitattributes
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
BuildArch: noarch
# For tests
BuildRequires: php(language) >= 5.4
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 3)
%else
BuildRequires: php-psr-http-message
%endif
BuildRequires: php-cli
BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
# "php": ">=5.4",
# "psr/http-message": "^1.0 || ^2.0"
Requires: php(language) >= 5.4
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 3)
%else
Requires: php-psr-http-message
%endif
# phpcompatinfo (computed from version 1.0.2)
# only Core
# Autoloader
Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
%description
Factory interfaces for PSR-7 HTTP Message.
Documentation: http://docs.php-http.org/
Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php
%prep
%setup -qn %{gh_project}-%{gh_commit}
%build
: Generate autoloader
%{_bindir}/phpab --template fedora --output src/autoload.php src
cat << 'EOF' | tee -a src/autoload.php
\Fedora\Autoloader\Dependencies::required([
[
'%{_datadir}/php/Psr/Http/Message2/autoload.php',
'%{_datadir}/php/Psr/Http/Message/autoload.php',
],
]);
EOF
%install
mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
cp -rp src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}
%check
: Test autoloader
php -nr '
require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php";
exit (interface_exists("%{ns_vendor}\\%{ns_project}\\RequestFactory") ? 0 : 1);
'
%files
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc composer.json
%{_datadir}/php/%{ns_vendor}
%changelog
* Wed Apr 19 2023 Remi Collet <remi@remirepo.net> - 1.1.0-1
- update to 1.1.0
- allow psr/http-message 2.0
* Fri Jun 28 2019 Remi Collet <remi@remirepo.net> - 1.0.2-1
- Initial package, version 1.0.2
|