Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d3299d284 | ||
|
|
22b7fc261e | ||
|
|
e504657e99 | ||
|
|
f7c5e45f10 |
4 changed files with 104 additions and 37 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -1 +1,7 @@
|
|||
/php-composer-ca-bundle-1.0.2-a2995e5.tgz
|
||||
clog
|
||||
/php-composer-ca-bundle-1.2.8-8a7ecad.tgz
|
||||
/php-composer-ca-bundle-1.2.9-78a0e28.tgz
|
||||
/php-composer-ca-bundle-1.2.10-9fdb22c.tgz
|
||||
/php-composer-ca-bundle-1.2.11-0b072d5.tgz
|
||||
/php-composer-ca-bundle-1.3.0-6793336.tgz
|
||||
/php-composer-ca-bundle-1.3.1-4c67918.tgz
|
||||
|
|
|
|||
|
|
@ -1,12 +1,24 @@
|
|||
diff -up src/CaBundle.php.rpm src/CaBundle.php
|
||||
--- src/CaBundle.php.rpm 2016-04-30 09:44:06.624946839 +0200
|
||||
+++ src/CaBundle.php 2016-04-30 09:44:37.576088602 +0200
|
||||
@@ -129,7 +129,7 @@ class CaBundle
|
||||
diff -up ./src/CaBundle.php.rpm ./src/CaBundle.php
|
||||
--- ./src/CaBundle.php.rpm 2021-01-12 13:54:38.000000000 +0100
|
||||
+++ ./src/CaBundle.php 2021-01-12 13:55:35.957422992 +0100
|
||||
@@ -125,7 +125,7 @@ class CaBundle
|
||||
*/
|
||||
public static function getBundledCaBundlePath()
|
||||
{
|
||||
- return __DIR__.'/../res/cacert.pem';
|
||||
+ return '/etc/pki/tls/certs/ca-bundle.crt'; // System CA, always
|
||||
}
|
||||
- $caBundleFile = __DIR__.'/../res/cacert.pem';
|
||||
+ $caBundleFile = '/etc/pki/tls/certs/ca-bundle.crt'; // System CA, always
|
||||
|
||||
/**
|
||||
// cURL does not understand 'phar://' paths
|
||||
// see https://github.com/composer/ca-bundle/issues/10
|
||||
diff -up ./tests/CaBundleTest.php.rpm ./tests/CaBundleTest.php
|
||||
--- ./tests/CaBundleTest.php.rpm 2021-01-12 13:55:35.957422992 +0100
|
||||
+++ ./tests/CaBundleTest.php 2021-01-12 13:56:54.872069486 +0100
|
||||
@@ -124,7 +124,7 @@ class CaBundleTest extends TestCase
|
||||
public function testOpenBaseDir()
|
||||
{
|
||||
$oldValue = ini_get('open_basedir') ?: '';
|
||||
- ini_set('open_basedir', dirname(__DIR__));
|
||||
+ ini_set('open_basedir', '/usr/share/php:' . dirname(__DIR__));
|
||||
$certFilePath = CaBundle::getSystemCaRootBundlePath();
|
||||
$validResult = CaBundle::validateCaFile($certFilePath, null);
|
||||
$this->assertTrue($validResult);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
# remirepo/fedora spec file for php-composer-ca-bundle
|
||||
#
|
||||
# Copyright (c) 2016 Remi Collet
|
||||
# Copyright (c) 2016-2019 Remi Collet
|
||||
# License: CC-BY-SA
|
||||
# http://creativecommons.org/licenses/by-sa/4.0/
|
||||
#
|
||||
# Please, preserve the changelog entries
|
||||
#
|
||||
%global gh_commit a2995e5fe351055f2c7630166af12ce8fd03edfc
|
||||
|
||||
%bcond_without tests
|
||||
|
||||
%global gh_commit 4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b
|
||||
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
|
||||
%global gh_owner composer
|
||||
%global gh_project ca-bundle
|
||||
|
|
@ -14,42 +17,57 @@
|
|||
%global with_tests 0%{!?_without_tests:1}
|
||||
|
||||
Name: php-composer-ca-bundle
|
||||
Version: 1.0.2
|
||||
Version: 1.3.1
|
||||
Release: 1%{?dist}
|
||||
Summary: Lets you find a path to the system CA
|
||||
|
||||
Group: Development/Libraries
|
||||
License: MIT
|
||||
URL: https://github.com/%{gh_owner}/%{gh_project}
|
||||
# git snapshot to get everything, despite .gitattributes
|
||||
Source0: %{name}-%{version}-%{gh_short}.tgz
|
||||
Source1: makesrc.sh
|
||||
Source2: %{name}-autoload.php
|
||||
|
||||
# Never bundle a CA file
|
||||
Patch0: %{name}-rpm.patch
|
||||
|
||||
BuildArch: noarch
|
||||
%if %{with_tests}
|
||||
# For tests
|
||||
BuildRequires: php(language) >= 5.3.2
|
||||
BuildRequires: php-openssl
|
||||
BuildRequires: php-pcre
|
||||
BuildRequires: php-cli
|
||||
# From composer.json, "require": {
|
||||
# "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
|
||||
# "psr/log": "^1.0",
|
||||
# "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0"
|
||||
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
|
||||
BuildRequires: phpunit8
|
||||
%global phpunit %{_bindir}/phpunit8
|
||||
BuildRequires: (php-composer(psr/log) >= 1.0 with php-composer(psr/log) < 2)
|
||||
BuildRequires: (php-composer(symfony/process) >= 2.5 with php-composer(symfony/process) < 6)
|
||||
%else
|
||||
BuildRequires: phpunit
|
||||
%global phpunit %{_bindir}/phpunit
|
||||
BuildRequires: php-PsrLog
|
||||
BuildRequires: php-symfony-process
|
||||
%endif
|
||||
# Autoloader
|
||||
BuildRequires: php-composer(symfony/class-loader)
|
||||
BuildRequires: php-composer(fedora/autoloader)
|
||||
# ca-certificates
|
||||
BuildRequires: %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
|
||||
%endif
|
||||
|
||||
# From composer.json, "require": {
|
||||
# "php": "^5.3.2 || ^7.0"
|
||||
# "ext-openssl": "*",
|
||||
# "ext-pcre": "*",
|
||||
# "php": "^5.3.2 || ^7.0 || ^8.0"
|
||||
Requires: php(language) >= 5.3.2
|
||||
# From phpcompatinfo report for version 1.0.2
|
||||
Requires: php-openssl
|
||||
Requires: php-pcre
|
||||
# From phpcompatinfo report for version 1.0.3
|
||||
#nothing
|
||||
# Autoloader
|
||||
Requires: php-composer(symfony/class-loader)
|
||||
Requires: php-composer(fedora/autoloader)
|
||||
# ca-certificates
|
||||
Requires: %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
|
||||
|
||||
|
|
@ -59,22 +77,30 @@ Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
|
|||
%description
|
||||
Small utility library that lets you find a path to the system CA bundle.
|
||||
|
||||
Autoloader: %{php_home}/Composer/CaBundle/autoload.php
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{gh_project}-%{gh_commit}
|
||||
|
||||
cp %{SOURCE2} src/autoload.php
|
||||
%patch0 -p0 -b .rpm
|
||||
|
||||
find src -name \*.rpm -exec rm {} \;
|
||||
|
||||
cat << 'EOF' | tee src/autoload.php
|
||||
<?php
|
||||
/* Autoloader for %{gh_owner}/%{gh_project} and its dependencies */
|
||||
|
||||
require_once '%{php_home}/Fedora/Autoloader/autoload.php';
|
||||
|
||||
\Fedora\Autoloader\Autoload::addPsr4('Composer\\CaBundle\\', __DIR__);
|
||||
EOF
|
||||
|
||||
|
||||
%build
|
||||
# Empty build section, most likely nothing required.
|
||||
|
||||
|
||||
%install
|
||||
|
||||
: Library
|
||||
mkdir -p %{buildroot}%{php_home}/Composer/
|
||||
cp -pr src %{buildroot}%{php_home}/Composer/CaBundle
|
||||
|
|
@ -82,19 +108,29 @@ cp -pr src %{buildroot}%{php_home}/Composer/CaBundle
|
|||
|
||||
%check
|
||||
%if %{with_tests}
|
||||
php -r '
|
||||
use Composer\CaBundle\CaBundle as CA;
|
||||
require "%{buildroot}%{php_home}/Composer/CaBundle/autoload.php";
|
||||
$file = CA::getSystemCaRootBundlePath();
|
||||
if ($file != "/etc/pki/tls/certs/ca-bundle.crt") {
|
||||
echo "Unexpected $file\n";
|
||||
exit(1);
|
||||
}
|
||||
if (!CA::validateCaFile($file)) {
|
||||
echo "Cannot validate $file\n";
|
||||
exit(1);
|
||||
}
|
||||
'
|
||||
mkdir vendor
|
||||
cat << 'EOF' | tee vendor/autoload.php
|
||||
<?php
|
||||
require_once '%{buildroot}%{php_home}/Composer/CaBundle/autoload.php';
|
||||
\Fedora\Autoloader\Dependencies::required(array(
|
||||
array(
|
||||
'%{php_home}/Symfony5/Component/Process/autoload.php',
|
||||
'%{php_home}/Symfony4/Component/Process/autoload.php',
|
||||
'%{php_home}/Symfony3/Component/Process/autoload.php',
|
||||
'%{php_home}/Symfony/Component/Process/autoload.php',
|
||||
),
|
||||
'%{php_home}/Psr/Log/autoload.php',
|
||||
));
|
||||
EOF
|
||||
|
||||
ret=0
|
||||
for cmdarg in "php %{phpunit}" "php56 %{_bindir}/phpunit" "php70 %{_bindir}/phpunit6" "php71 %{_bindir}/phpunit7" php72 php73 php74; do
|
||||
if which $cmdarg; then
|
||||
set $cmdarg
|
||||
$1 ${2:-%{_bindir}/phpunit8} --verbose || ret=1
|
||||
fi
|
||||
done
|
||||
exit $ret
|
||||
%else
|
||||
: Test suite disabled
|
||||
%endif
|
||||
|
|
@ -110,6 +146,19 @@ if (!CA::validateCaFile($file)) {
|
|||
|
||||
|
||||
%changelog
|
||||
* Sat Oct 30 2021 Remi Collet <remi@remirepo.net> - 1.3.1-1
|
||||
- update to 1.3.1
|
||||
|
||||
* Wed Apr 8 2020 Remi Collet <remi@remirepo.net> - 1.2.7-1
|
||||
- update to 1.2.7
|
||||
|
||||
* Tue Jan 14 2020 Remi Collet <remi@remirepo.net> - 1.2.6-1
|
||||
- update to 1.2.6
|
||||
|
||||
* Sat Aug 3 2019 Remi Collet <remi@remirepo.net> - 1.2.3-1
|
||||
- update to 1.2.3
|
||||
- run upstream test suite
|
||||
- switch from symfony/class-loader to fedora/autoloader
|
||||
|
||||
* Sat Apr 30 2016 Remi Collet <remi@fedoraproject.org> - 1.0.2-1
|
||||
- initial package, version 1.0.2
|
||||
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
ea6b9651560975dd2f3018f9fd5a1013 php-composer-ca-bundle-1.0.2-a2995e5.tgz
|
||||
SHA512 (php-composer-ca-bundle-1.3.1-4c67918.tgz) = d4e66c86d08b2f02d43e4b7a268852be5dd69de8c42558d63159dedc5b038825941db0f50ad804017ea631166cd8f6d6a963fdd1344a47396594ad6747587062
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue