Get libraries to link against from pkg-config

Upstream pull request:
https://github.com/radiator-software/p5-net-ssleay/pull/127
This commit is contained in:
Paul Howarth 2019-03-30 08:06:53 +00:00
parent 4e08982bea
commit f571bb6a69
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,24 @@
--- Makefile.PL
+++ Makefile.PL
@@ -201,11 +201,16 @@ EOM
@{ $opts->{lib_links} } = map { $_ =~ s/32\b//g } @{ $opts->{lib_links} } if $Config{use64bitall};
}
else {
- push @{ $opts->{lib_links} },
- ($rsaref
- ? qw( ssl crypto RSAglue rsaref z )
- : qw( ssl crypto z )
- );
+ if ( eval { require ExtUtils::PkgConfig } && ExtUtils::PkgConfig->exists('openssl') ) {
+ push @{ $opts->{lib_links} }, map { s/^-l//; $_ } split(' ', ExtUtils::PkgConfig->libs_only_l('openssl'));
+ }
+ else {
+ push @{ $opts->{lib_links} },
+ ($rsaref
+ ? qw( ssl crypto RSAglue rsaref z )
+ : qw( ssl crypto z )
+ );
+ }
if (($Config{cc} =~ /aCC/i) && $^O eq 'hpux') {
print "*** Enabling HPUX aCC options (+e)\n";

View File

@ -10,13 +10,14 @@
Name: perl-Net-SSLeay
Version: 1.86
Release: 0.1.09%{?dist}
Release: 0.2.09%{?dist}
Summary: Perl extension for using OpenSSL
License: Artistic 2.0
URL: https://metacpan.org/release/Net-SSLeay
Source0: https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-%{cpan_version}.tar.gz
# Adapt tests to system-wide crypto policy, bug #1614884
Patch0: Net-SSLeay-1.85-Adapt-CTX_get_min_proto_version-tests-to-system-wide.patch
Patch10: Net-SSLeay-1.86_09-pkgconfig.patch
# =========== Module Build ===========================
BuildRequires: coreutils
BuildRequires: findutils
@ -29,6 +30,7 @@ BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Cwd)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(ExtUtils::PkgConfig)
BuildRequires: perl(ExtUtils::MM)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Path)
@ -80,6 +82,10 @@ so you can write servers or clients for more complicated applications.
%setup -q -n Net-SSLeay-%{cpan_version}
%patch0 -p1
# Get libraries to link against from pkg-config
# https://github.com/radiator-software/p5-net-ssleay/pull/127
%patch10
# Fix permissions in examples to avoid bogus doc-file dependencies
chmod -c 644 examples/*
@ -125,6 +131,10 @@ make test
%{_mandir}/man3/Net::SSLeay::Handle.3*
%changelog
* Fri Mar 29 2019 Paul Howarth <paul@city-fan.org> - 1.86-0.2.09
- Get libraries to link against from pkg-config
https://github.com/radiator-software/p5-net-ssleay/pull/127
* Wed Mar 20 2019 Petr Pisar <ppisar@redhat.com> - 1.86-0.1.09
- Update to 1.86_09 (see Changes file for details)