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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
# remirepo/fedora spec file for pie
#
# Copyright (c) 2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
# remirepo:3
# For compatibility with SCL
%undefine __brp_mangle_shebangs
%bcond_with generators
%global gh_commit 51f0d5072d7346c90d20bf9a5633e67938fefcca
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20241003
%global gh_branch main
%global gh_owner php
%global gh_project pie
%global upstream_version 0.1.0
#global upstream_prever dev
#global upstream_lower DEV
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null)
%global bashcomproot %(dirname %{bashcompdir} 2>/dev/null)
Name: pie
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
Release: 2%{?dist}
Summary: PHP Installer for Extensions
# SPDX: pie is BSD-3-Clause, all dependencies are MIT
License: BSD-3-Clause AND MIT
URL: https://github.com/php/pie
# tarball generated by makesrc.sh
Source0: %{gh_project}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tgz
Source1: %{name}-bash-completion
# Create a git snapshot with dependencies
Source9: makesrc.sh
# Fix autoloader path
Patch0: %{name}-rpm.patch
# Don't use XDG directories
Patch1: %{name}-noxdg.patch
# Don't use bundled cacert.pem
Patch2: %{name}-nocacert.patch
BuildArch: noarch
# platform set in makesrc.sh
BuildRequires: php(language) >= 8.1
BuildRequires: php-cli
BuildRequires: php-json
BuildRequires: php-zip
BuildRequires: pkgconfig(bash-completion)
%if %{with generators}
BuildRequires: composer-generators
%endif
# From composer.json, "require": {
# "php": "8.1.*||8.2.*||8.3.*||8.4.*",
# "ext-zip": "*",
Requires: php(language) >= 8.1
Requires: php-cli
Requires: php-zip
# System certificates
Requires: ca-certificates
# From phpcompatinfo
# Ignored: core, date, filter, hash, pcre, random, reflection, spl, standard
Requires: php-ctype
Requires: php-curl
Requires: php-dom
Requires: php-intl
Requires: php-json
Requires: php-mbstring
Requires: php-posix
Requires: php-phar
%if %{without generators}
# Bundled libraries
# License MIT
Provides: bundled(php-composer(composer/ca-bundle)) = 1.5.2
Provides: bundled(php-composer(composer/class-map-generator)) = 1.4.0
Provides: bundled(php-composer(composer/composer)) = dev-main
Provides: bundled(php-composer(composer/metadata-minifier)) = 1.0.0
Provides: bundled(php-composer(composer/pcre)) = 3.3.1
Provides: bundled(php-composer(composer/semver)) = 3.4.3
Provides: bundled(php-composer(composer/spdx-licenses)) = 1.5.8
Provides: bundled(php-composer(composer/xdebug-handler)) = 3.0.5
Provides: bundled(php-composer(guzzlehttp/guzzle)) = 7.9.2
Provides: bundled(php-composer(guzzlehttp/promises)) = 2.0.4
Provides: bundled(php-composer(guzzlehttp/psr7)) = 2.7.0
Provides: bundled(php-composer(illuminate/container)) = v10.48.22
Provides: bundled(php-composer(illuminate/contracts)) = v10.48.22
Provides: bundled(php-composer(justinrainbow/json-schema)) = 5.3.0
Provides: bundled(php-composer(psr/container)) = 2.0.2
Provides: bundled(php-composer(psr/http-client)) = 1.0.3
Provides: bundled(php-composer(psr/http-factory)) = 1.1.0
Provides: bundled(php-composer(psr/http-message)) = 2.0
Provides: bundled(php-composer(psr/log)) = 3.0.2
Provides: bundled(php-composer(psr/simple-cache)) = 3.0.0
Provides: bundled(php-composer(ralouphie/getallheaders)) = 3.0.3
Provides: bundled(php-composer(react/promise)) = v3.2.0
Provides: bundled(php-composer(seld/jsonlint)) = 1.11.0
Provides: bundled(php-composer(seld/phar-utils)) = 1.2.1
Provides: bundled(php-composer(seld/signal-handler)) = 2.0.2
Provides: bundled(php-composer(symfony/console)) = v6.4.13
Provides: bundled(php-composer(symfony/deprecation-contracts)) = v3.5.0
Provides: bundled(php-composer(symfony/filesystem)) = v6.4.13
Provides: bundled(php-composer(symfony/finder)) = v6.4.13
Provides: bundled(php-composer(symfony/polyfill-ctype)) = v1.31.0
Provides: bundled(php-composer(symfony/polyfill-intl-grapheme)) = v1.31.0
Provides: bundled(php-composer(symfony/polyfill-intl-normalizer)) = v1.31.0
Provides: bundled(php-composer(symfony/polyfill-mbstring)) = v1.31.0
Provides: bundled(php-composer(symfony/polyfill-php73)) = v1.31.0
Provides: bundled(php-composer(symfony/polyfill-php80)) = v1.31.0
Provides: bundled(php-composer(symfony/polyfill-php81)) = v1.31.0
Provides: bundled(php-composer(symfony/process)) = v6.4.13
Provides: bundled(php-composer(symfony/service-contracts)) = v3.5.0
Provides: bundled(php-composer(symfony/string)) = v6.4.13
Provides: bundled(php-composer(webmozart/assert)) = 1.11.0
# Composer library
Provides: php-composer(php/pie) = %{version}
%endif
%description
PIE (PHP Installer for Extensions).
PIE can install an extension to any installed PHP version.
A list of extensions that support PIE can be found on
https://packagist.org/extensions.
Documentation: /usr/share/doc/pie/docs/usage.md
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch -P0 -p1 -b .rpm
%patch -P1 -p1 -b .noxdg
%patch -P2 -p1 -b .nocacert
find . \( -name \*.rpm -o -name \*noxdg -o -name \*nocacert \) -delete -print
rm vendor/composer/ca-bundle/res/cacert.pem
: Set version
sed -e 's/@pie_version@/%{upstream_version}%{?upstream_prever}/' -i bin/pie
%if %{without generators}
: List bundled libraries and Licenses
php -r '
$pkgs = file_get_contents("vendor/composer/installed.json");
$pkgs = json_decode($pkgs, true);
if (!is_array($pkgs) || !isset($pkgs["packages"])) {
echo "cant decode json file\n";
exit(3);
}
$res = [];
foreach($pkgs["packages"] as $pkg) {
$lic = implode(" and ", $pkg["license"]);
if (!isset($res[$lic])) $res[$lic] = [];
$res[$lic][] = sprintf("Provides: bundled(php-composer(%s)) = %s", $pkg["name"], $pkg["version"]);
}
foreach($res as $lic => $lib) {
sort($lib);
printf("# License %s\n%s\n", $lic, implode("\n", $lib));
}'
%endif
%build
# Nothing
%install
: Bash auto-completion
install -Dpm 644 %{SOURCE1} %{buildroot}%{bashcompdir}/%{name}
: Sources and dependencies
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr src %{buildroot}%{_datadir}/%{name}/src
cp -pr vendor %{buildroot}%{_datadir}/%{name}/vendor
: Command
install -Dpm 755 bin/%{name} %{buildroot}%{_bindir}/%{name}
: Licenses
cd vendor
for lic in */*/LICENSE
do dir=$(dirname $lic)
own=$(dirname $dir)
prj=$(basename $dir)
ln -sf ../../pie/vendor/$own/$prj/LICENSE ../$own-$prj-LICENSE
done
%files
%license LICENSE.md
%license *LICENSE
%doc README.md
%doc docs
%doc composer.json
%{_bindir}/%{name}
%{_datadir}/%{name}
%{bashcomproot}
%changelog
* Wed Oct 30 2024 Remi Collet <remi@remirepo.net> - 0.1.0-2
- refresh dependencies
- add patches from composer to skip XDG and drop bundled cacert.rpm
* Thu Oct 10 2024 Remi Collet <remi@remirepo.net> - 0.1.0-1
- update to 0.1.0 (pre-release)
* Fri Oct 4 2024 Remi Collet <remi@remirepo.net> - 0.0.0~DEV-1.20241003.bbb9b6b
- Initial package from dev-main
|