Skip to content

Commit

Permalink
use system ca-certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 19, 2016
1 parent 07d6472 commit 1004f8b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
22 changes: 22 additions & 0 deletions ca-certs.patch
@@ -0,0 +1,22 @@
--- ./src/Composer/Compiler.php.rpm 2016-04-18 22:14:28.000000000 +0200
+++ ./src/Composer/Compiler.php 2016-04-19 07:15:05.421424090 +0200
@@ -138,7 +138,7 @@ class Compiler
}
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../vendor/composer/ClassLoader.php'));

- $this->addFile($phar, new \SplFileInfo(__DIR__ . '/../../res/cacert.pem'), false);
+ $this->addFile($phar, new \SplFileInfo('/etc/pki/tls/certs/ca-bundle.crt'), false);

$this->addComposerBin($phar);

--- ./src/Composer/Util/RemoteFilesystem.php.rpm 2016-04-18 22:14:28.000000000 +0200
+++ ./src/Composer/Util/RemoteFilesystem.php 2016-04-19 07:15:05.421424090 +0200
@@ -925,7 +925,7 @@ class RemoteFilesystem
}
}

- return $caPath = __DIR__.'/../../../res/cacert.pem'; // Bundled with Composer, last resort
+ return $caPath = '/etc/pki/tls/certs/ca-bundle.crt';
}

/**
13 changes: 9 additions & 4 deletions composer.spec
Expand Up @@ -10,7 +10,7 @@
Summary: Dependency Manager for PHP
Name: composer
Version: 1.0.1
Release: 1
Release: 2
License: MIT
Group: Development/Languages/PHP
Source0: https://github.com/composer/composer/archive/%{version}/%{name}-%{version}.tar.gz
Expand All @@ -21,12 +21,13 @@ Source3: autoload.php
Patch0: autoload.patch
Patch1: update-memory-limit.patch
Patch2: svn-ignore-externals.patch
Patch3: ca-certs.patch
URL: http://www.getcomposer.org/
BuildRequires: php-devel
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.673
%if %{with tests}
BuildRequires: composer >= 1.0.0-17.beta1
BuildRequires: composer >= 1.0.1-2
BuildRequires: git-core
BuildRequires: phpab
BuildRequires: phpunit
Expand All @@ -50,6 +51,7 @@ Requires: php-composer-spdx-licenses >= 1.0.0
Requires: php-justinrainbow-json-schema >= 1.6
Requires: php-seld-cli-prompt >= 1.0.0
Requires: php-seld-jsonlint >= 1.4
Requires: ca-certificates >= 20141019-3
Requires: php-seld-phar-utils >= 1.0.0
Requires: php-symfony2-ClassLoader >= 2.7.7
Requires: php-symfony2-Console >= 2.7.7
Expand Down Expand Up @@ -82,11 +84,11 @@ Bash completion for Composer package and dependency manager.
Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera.

%prep
%setup -qc -n %{name}-%{version}-%{release}
mv composer-*/* .
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

mv composer.lock{,.disabled}
# NOTE: do not use %{__php} macro here, need unversioned php binary
Expand All @@ -97,6 +99,9 @@ cp -p %{SOURCE3} src/Composer/autoload.php
# AutoloadGenerator needs this runtime
mv LICENSE res

# use system bundle
rm res/cacert.pem

# move to Composer dir, this will simplify testing
mv res src/Composer
ln -s src/Composer/res
Expand Down

0 comments on commit 1004f8b

Please sign in to comment.