summaryrefslogtreecommitdiffstats
path: root/php-psr-link.spec
blob: 5ee154930c9113acfa3770425d649a420d2dc236 (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
# remirepo spec file for php-psr-link, from:
#
# Fedora spec file for php-psr-link
#
# Copyright (c) 2017-2021 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please preserve changelog entries
#

%global github_owner     php-fig
%global github_name      link
%global github_version   1.1.1
%global github_commit    846c25f58a1f02b93a00f2404e3626b6bf9b7807

%global composer_vendor  psr
%global composer_project link

# "php": ">=8.0.0"
%global php_min_ver 8.0.0

%{!?phpdir:  %global phpdir  %{_datadir}/php}

Name:          php-%{composer_vendor}-%{composer_project}
Version:       %{github_version}
Release:       1%{?github_release}%{?dist}
Summary:       Common interfaces for HTTP links (PSR-13)

License:       MIT
URL:           http://www.php-fig.org/psr/psr-13/
Source0:       https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz

BuildArch:     noarch
# Minimal autoloader test
BuildRequires: php-cli >= %{php_min_ver}
## Autoloader
BuildRequires: php-composer(fedora/autoloader)

# composer.json
Requires:      php(language) >= %{php_min_ver}
# phpcompatinfo (computed from version 1.0.0)
#     <none>
# Autoloader
Requires:      php-composer(fedora/autoloader)

# Composer
Provides:      php-composer(%{composer_vendor}/%{composer_project}) = %{version}

%description
This package holds all interfaces/classes/traits related to PSR-13 [1].

Note that this is not an HTTP link implementation of its own. It is merely an
interface that describes an HTTP link. See the specification for more details.

Autoloader: %{phpdir}/Psr/Link/autoload.php

[1] https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-13-links.md


%prep
%setup -qn %{github_name}-%{github_commit}


%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/autoload.php
<?php
/**
 * Autoloader for %{name} and its' dependencies
 * (created by %{name}-%{version}-%{release}).
 */
require_once '%{phpdir}/Fedora/Autoloader/autoload.php';

\Fedora\Autoloader\Autoload::addPsr4('Psr\\Link\\', __DIR__);
AUTOLOAD


%install
mkdir -p %{buildroot}%{phpdir}/Psr
cp -rp src %{buildroot}%{phpdir}/Psr/Link


%check
: Minimal autoloader test
%{_bindir}/php -r '
    require "%{buildroot}%{phpdir}/Psr/Link/autoload.php";
    exit(interface_exists("Psr\\Link\\LinkInterface") ? 0 : 1);
'


%files
# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE.md
%doc README.md
%doc composer.json
%dir %{phpdir}/Psr
     %{phpdir}/Psr/Link


%changelog
* Wed Apr 14 2021 Remi Collet <remi@remirepo.net> - 1.1.1-1
- update to 1.1.1
- raise dependency on PHP 8.0

* Sun Jun 11 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1
- Initial package