summaryrefslogtreecommitdiff
path: root/composer.spec
diff options
context:
space:
mode:
Diffstat (limited to 'composer.spec')
-rw-r--r--composer.spec140
1 files changed, 76 insertions, 64 deletions
diff --git a/composer.spec b/composer.spec
index 8789216..c446f15 100644
--- a/composer.spec
+++ b/composer.spec
@@ -1,6 +1,6 @@
%undefine __brp_mangle_shebangs
-%global gh_commit 623e5e1de055e65bc6c3c61b8348dc4662d75e2b
+%global gh_commit 2a7c71266b2545a3bed9f4860734081963f6e688
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_branch 2.0-dev
%global gh_owner composer
@@ -8,7 +8,7 @@
%global api_version 2.6.0
%global run_version 2.2.2
-%global upstream_version 2.6.2
+%global upstream_version 2.8.3
%global _phpunit %{_bindir}/phpunit9
%global bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null)
@@ -35,51 +35,24 @@ Source5: makesrc.sh
Patch0: %{name}-rpm.patch
# Disable XDG support as only partially implemented
Patch1: %{name}-noxdg.patch
-# Use Huaweicloud mirror by default
-Patch10: composer-add-huaweicloud-repository.patch
BuildArch: noarch
# platform set in makesrc.sh
BuildRequires: php(language) >= 7.2.5
BuildRequires: php-cli
+BuildRequires: php-json
BuildRequires: pkgconfig(bash-completion)
-Requires: php(language) >= 7.2.5
+Requires: php(language) >= 7.2.5
Requires: php-cli
Supplements: php-cli
# System certificates
Requires: ca-certificates
-# Bundled libraries
-# License MIT
-Provides: bundled(php-composer-ca-bundle) = 1.3.7
-Provides: bundled(php-composer-class-map-generator) = 1.1.0
-Provides: bundled(php-composer-metadata-minifier) = 1.0.0
-Provides: bundled(php-composer-pcre) = 2.1.0
-Provides: bundled(php-composer-semver) = 3.4.0
-Provides: bundled(php-composer-spdx-licenses) = 1.5.7
-Provides: bundled(php-composer-xdebug-handler) = 3.0.3
-Provides: bundled(php-justinrainbow-json-schema) = 5.2.12
-Provides: bundled(php-psr-container) = 1.1.1
-Provides: bundled(php-psr-log) = 1.1.4
-Provides: bundled(php-react-promise) = v3.0.0
-Provides: bundled(php-seld-jsonlint) = 1.10.0
-Provides: bundled(php-seld-phar-utils) = 1.2.1
-Provides: bundled(php-seld-signal-handler) = 2.0.2
-Provides: bundled(php-symfony-console) = v5.4.28
-Provides: bundled(php-symfony-deprecation-contracts) = v2.5.2
-Provides: bundled(php-symfony-filesystem) = v5.4.25
-Provides: bundled(php-symfony-finder) = v5.4.27
-Provides: bundled(php-symfony-polyfill-ctype) = v1.28.0
-Provides: bundled(php-symfony-polyfill-intl-grapheme) = v1.28.0
-Provides: bundled(php-symfony-polyfill-intl-normalizer) = v1.28.0
-Provides: bundled(php-symfony-polyfill-mbstring) = v1.28.0
-Provides: bundled(php-symfony-polyfill-php73) = v1.28.0
-Provides: bundled(php-symfony-polyfill-php80) = v1.28.0
-Provides: bundled(php-symfony-polyfill-php81) = v1.28.0
-Provides: bundled(php-symfony-process) = v5.4.28
-Provides: bundled(php-symfony-service-contracts) = v2.5.2
-Provides: bundled(php-symfony-string) = v5.4.26
+# From composer.json, suggest
+# "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
+# "ext-zip": "Enabling the zip extension allows you to unzip archives",
+# "ext-zlib": "Allow gzip compression of HTTP requests"
Requires: php-openssl
Requires: php-zip
Requires: php-zlib
@@ -92,6 +65,7 @@ Requires: php-filter
Requires: php-hash
Requires: php-iconv
Requires: php-intl
+Requires: php-json
Requires: php-libxml
Requires: php-mbstring
Requires: php-pcntl
@@ -104,8 +78,39 @@ Requires: php-tokenizer
Requires: php-xsl
Requires: php-zlib
+# Bundled libraries
+# License MIT
+Provides: bundled(php-composer(composer/ca-bundle)) = 1.5.3
+Provides: bundled(php-composer(composer/class-map-generator)) = 1.4.0
+Provides: bundled(php-composer(composer/metadata-minifier)) = 1.0.0
+Provides: bundled(php-composer(composer/pcre)) = 2.3.2
+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(justinrainbow/json-schema)) = 5.3.0
+Provides: bundled(php-composer(psr/container)) = 1.1.1
+Provides: bundled(php-composer(psr/log)) = 1.1.4
+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)) = v5.4.47
+Provides: bundled(php-composer(symfony/deprecation-contracts)) = v2.5.3
+Provides: bundled(php-composer(symfony/filesystem)) = v5.4.45
+Provides: bundled(php-composer(symfony/finder)) = v5.4.45
+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)) = v5.4.47
+Provides: bundled(php-composer(symfony/service-contracts)) = v2.5.3
+Provides: bundled(php-composer(symfony/string)) = v5.4.47
# Composer library
Provides: php-composer(composer/composer) = %{version}
+
# Special internal for Plugin API
Provides: php-composer(composer-plugin-api) = %{api_version}
Provides: php-composer(composer-runtime-api) = %{run_version}
@@ -122,23 +127,11 @@ Documentation: https://getcomposer.org/doc/
find . \( -name \*.rpm -o -name \*noxdg \) -delete -print
-if grep -r '\.\./res'; then
- : Patch need to fixed
- exit 1
-fi
-
-rm src/bootstrap.php
-rm src/Composer/vendor/composer/ca-bundle/res/cacert.pem
-
-: symlink autoloader for library
-ln -s vendor/autoload.php src/Composer/autoload.php
-
-: fix layout
-sed -e "s:/../..' . '/src/Composer::" -i src/Composer/vendor/composer/autoload_static.php
+rm vendor/composer/ca-bundle/res/cacert.pem
: List bundled libraries and Licenses
php -r '
- $pkgs = file_get_contents("src/Composer/vendor/composer/installed.json");
+ $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";
@@ -148,7 +141,7 @@ php -r '
foreach($pkgs["packages"] as $pkg) {
$lic = implode(" and ", $pkg["license"]);
if (!isset($res[$lic])) $res[$lic] = [];
- $res[$lic][] = sprintf("Provides: bundled(php-%s) = %s", str_replace(["/", "_"], ["-", "-"], $pkg["name"]), $pkg["version"]);
+ $res[$lic][] = sprintf("Provides: bundled(php-composer(%s)) = %s", $pkg["name"], $pkg["version"]);
}
foreach($res as $lic => $lib) {
sort($lib);
@@ -163,7 +156,7 @@ sed -e '/BRANCH_ALIAS_VERSION/s/@package_branch_alias_version@//' \
: check Plugin API version
php -r '
namespace Composer;
-include "src/Composer/autoload.php";
+include "src/bootstrap.php";
if (version_compare(Plugin\PluginInterface::PLUGIN_API_VERSION, "%{api_version}")) {
printf("Plugin API version is %s, expected %s\n", Plugin\PluginInterface::PLUGIN_API_VERSION, "%{api_version}");
exit(1);
@@ -173,27 +166,49 @@ if (version_compare(Composer::RUNTIME_API_VERSION, "%{run_version}")) {
exit(1);
}'
-
%build
-# Nothing
+# Nothing to build
%install
+: Profile scripts
install -Dpm 644 %{SOURCE1} %{buildroot}%{bashcompdir}/%{name}
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -m 644 %{SOURCE3} %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/
-mkdir -p %{buildroot}%{_datadir}/php
-cp -pr src/* %{buildroot}%{_datadir}/php
-
-mkdir -p %{buildroot}%{_datadir}/%{name}
-cp -pr res %{buildroot}%{_datadir}/%{name}/res
-cp -p LICENSE %{buildroot}%{_datadir}/%{name}/LICENSE
+: Library autoloader for compatibility
+mkdir -p %{buildroot}%{_datadir}/php/Composer
+ln -s ../../composer/vendor/autoload.php %{buildroot}%{_datadir}/php/Composer/autoload.php
-ln -sf %{_datadir}/%{name}/LICENSE LICENSE
+: Sources
+mkdir -p %{buildroot}%{_datadir}/%{name}
+cp -pr src res vendor LICENSE\
+ %{buildroot}%{_datadir}/%{name}/
+: Command
install -Dpm 755 bin/%{name} %{buildroot}%{_bindir}/%{name}
+: Licenses
+ln -sf ../../%{name}/LICENSE LICENSE
+cd vendor
+for lic in */*/LICENSE
+do dir=$(dirname $lic)
+ own=$(dirname $dir)
+ prj=$(basename $dir)
+ ln -sf ../../composer/vendor/$own/$prj/LICENSE ../$own-$prj-LICENSE
+done
+
+%check
+: Check autoloader
+php -r '
+ include "%{buildroot}%{_datadir}/%{name}/src/bootstrap.php";
+ exit (class_exists("Composer\\Composer") ? 0 : 1);
+'
+: Check compatibility autoloader
+php -r '
+ include "%{buildroot}%{_datadir}/php/Composer/autoload.php";
+ exit (class_exists("Composer\\Composer") ? 0 : 2);
+'
%files
%license LICENSE
@@ -206,8 +221,5 @@ install -Dpm 755 bin/%{name} %{buildroot}%{_bindir}/%{name}
%{bashcomproot}
%changelog
-* Mon Sep 04 2023 Funda Wang <fundawang@yeah.net> - 2.6.2-1
-- New version 2.6.2
-
-* Mon Jul 10 2023 Funda Wang <fundawang@yeah.net> - 2.5.8-1
+* Wed Nov 27 2024 Funda Wang <fundawang@yeah.net> - 2.8.3-1
- Import package from Remi