Openssl 如何让rpm知道它内部提供了哪些库?

Openssl 如何让rpm知道它内部提供了哪些库?,openssl,rpm,rpmbuild,specifications,Openssl,Rpm,Rpmbuild,Specifications,亲爱的stackoverflow用户: 我试图在CentOS 6.5中安装更新的openssl,如下所示: # curl -O https://www.openssl.org/source/openssl-1.0.1i.tar.gz # tar xzf openssl-1.0.1i.tar.gz # sed -i "s@/usr/lib@/usr/lib64@g" openssl-1.0.1i/openssl.spec # tar czf openssl-1.0.1i.tar.gz openss

亲爱的stackoverflow用户:

我试图在CentOS 6.5中安装更新的openssl,如下所示:

# curl -O https://www.openssl.org/source/openssl-1.0.1i.tar.gz
# tar xzf openssl-1.0.1i.tar.gz
# sed -i "s@/usr/lib@/usr/lib64@g" openssl-1.0.1i/openssl.spec
# tar czf openssl-1.0.1i.tar.gz openssl-1.0.1i
# rpmbuild -tb openssl-1.0.1i.tar.gz
# diff -u .openssl/openssl.spec openssl-1.0.1i/openssl.spec 
--- .openssl/openssl.spec   2014-09-03 06:49:33.621688061 +0000
+++ openssl-1.0.1i/openssl.spec 2014-09-03 06:59:10.949636692 +0000
@@ -103,6 +103,9 @@

 %install
 rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/lib64
+ln -sf /usr/lib64/libssl.so.1.0.0 $RPM_BUILD_ROOT/usr/lib64/libssl.so.10
+ln -sf /usr/lib64/libcrypto.so.1.0.0 $RPM_BUILD_ROOT/usr/lib64/libcrypto.so.10
 make MANDIR=/usr/man MANSUFFIX=ssl INSTALL_PREFIX="$RPM_BUILD_ROOT" install

 # Make backwards-compatibility symlink to ssleay
但是,安装生成的rpm会返回以下错误:

bash-4.1# rpm -Uvh /rpmbuild/RPMS/x86_64/openssl-1.0.1i-1.x86_64.rpm

error: Failed dependencies:
    libcrypto.so.10()(64bit) is needed by (installed) python-libs-2.6.6-52.el6.x86_64
    libcrypto.so.10()(64bit) is needed by (installed) libssh2-1.4.2-1.el6.x86_64
    libcrypto.so.10()(64bit) is needed by (installed) fipscheck-1.2.0-7.el6.x86_64
    libcrypto.so.10()(64bit) is needed by (installed) openssh-5.3p1-94.el6.x86_64
    libcrypto.so.10()(64bit) is needed by (installed) openssh-clients-5.3p1-94.el6.x86_64
    libcrypto.so.10()(64bit) is needed by (installed) git-1.7.1-3.el6_4.1.x86_64
    libcrypto.so.10(OPENSSL_1.0.1)(64bit) is needed by (installed) openssh-5.3p1-94.el6.x86_64
    libcrypto.so.10(OPENSSL_1.0.1)(64bit) is needed by (installed) openssh-clients-5.3p1-94.el6.x86_64
    libcrypto.so.10(libcrypto.so.10)(64bit) is needed by (installed) python-libs-2.6.6-52.el6.x86_64
    libcrypto.so.10(libcrypto.so.10)(64bit) is needed by (installed) openssh-5.3p1-94.el6.x86_64
    libcrypto.so.10(libcrypto.so.10)(64bit) is needed by (installed) openssh-clients-5.3p1-94.el6.x86_64
    libssl.so.10()(64bit) is needed by (installed) python-libs-2.6.6-52.el6.x86_64
    libssl.so.10()(64bit) is needed by (installed) libssh2-1.4.2-1.el6.x86_64
    libssl.so.10()(64bit) is needed by (installed) git-1.7.1-3.el6_4.1.x86_64
    libssl.so.10(libssl.so.10)(64bit) is needed by (installed) python-libs-2.6.6-52.el6.x86_64
因此,我对openssl.spec进行了如下修改:

# curl -O https://www.openssl.org/source/openssl-1.0.1i.tar.gz
# tar xzf openssl-1.0.1i.tar.gz
# sed -i "s@/usr/lib@/usr/lib64@g" openssl-1.0.1i/openssl.spec
# tar czf openssl-1.0.1i.tar.gz openssl-1.0.1i
# rpmbuild -tb openssl-1.0.1i.tar.gz
# diff -u .openssl/openssl.spec openssl-1.0.1i/openssl.spec 
--- .openssl/openssl.spec   2014-09-03 06:49:33.621688061 +0000
+++ openssl-1.0.1i/openssl.spec 2014-09-03 06:59:10.949636692 +0000
@@ -103,6 +103,9 @@

 %install
 rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/lib64
+ln -sf /usr/lib64/libssl.so.1.0.0 $RPM_BUILD_ROOT/usr/lib64/libssl.so.10
+ln -sf /usr/lib64/libcrypto.so.1.0.0 $RPM_BUILD_ROOT/usr/lib64/libcrypto.so.10
 make MANDIR=/usr/man MANSUFFIX=ssl INSTALL_PREFIX="$RPM_BUILD_ROOT" install

 # Make backwards-compatibility symlink to ssleay
在创建的包libssl.so.10和libcrypto.so.10中确实存在:

# rpm -iqlp /rpmbuild/RPMS/x86_64/openssl-1.0.1i-1.x86_64.rpm | grep \.10
/usr/lib64/libcrypto.so.10
/usr/lib64/libssl.so.10
但它不被认为是要提供的图书馆:

# rpm -qip --provides /rpmbuild/RPMS/x86_64/openssl-1.0.1i-1.x86_64.rpm        
Name        : openssl                      Relocations: (not relocatable)
Version     : 1.0.1i                            Vendor: (none)
Release     : 1                             Build Date: Wed Sep  3 07:06:45 2014
Install Date: (not installed)               Build Host: 4cc54f371b7a
Group       : System Environment/Libraries   Source RPM: openssl-1.0.1i-1.src.rpm
Size        : 3705468                          License: OpenSSL
Signature   : (none)
Packager    : Damien Miller <djm@mindrot.org>
URL         : http://www.openssl.org/
Summary     : Secure Sockets Layer and cryptography libraries and tools
Description :
The OpenSSL Project is a collaborative effort to develop a robust,
commercial-grade, fully featured, and Open Source toolkit implementing the
Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
protocols as well as a full-strength general purpose cryptography library.
The project is managed by a worldwide community of volunteers that use the
Internet to communicate, plan, and develop the OpenSSL tookit and its related
documentation.

OpenSSL is based on the excellent SSLeay library developed from Eric A.
Young and Tim J. Hudson.  The OpenSSL toolkit is licensed under an
Apache-style licence, which basically means that you are free to get and
use it for commercial and non-commercial purposes.

This package contains the base OpenSSL cryptography and SSL/TLS
libraries and tools.
SSL  
config(openssl) = 1.0.1i-1
libcrypto.so.1.0.0()(64bit)  
libssl.so.1.0.0()(64bit)  
openssl = 1.0.1i-1
openssl(x86-64) = 1.0.1i-1
#rpm-qip--提供/rpmbuild/RPMS/x86_64/openssl-1.0.1i-1.x86_64.rpm
名称:openssl重新定位:(不可重新定位)
版本:1.0.1i供应商:(无)
发布:1构建日期:2014年9月3日星期三07:06:45
安装日期:(未安装)生成主机:4cc54f371b7a
组:系统环境/库源RPM:openssl-1.0.1i-1.src.RPM
大小:3705468许可证:OpenSSL
签字:(无)
包装商:达米恩·米勒
网址:http://www.openssl.org/
概述:安全套接字层和加密库及工具
说明:
OpenSSL项目是一项合作努力,旨在开发一个强大的,
实现
安全套接字层(SSL v2/v3)和传输层安全性(TLS v1)
协议以及全强度通用加密库。
该项目由世界各地的志愿者社区管理,他们使用
Internet来交流、规划和开发OpenSSL tookit及其相关工具
文档
OpenSSL基于Eric A开发的优秀SSLeay库。
杨和蒂姆·J·哈德森。OpenSSL工具包是根据
Apache风格的许可证,这基本上意味着您可以自由获取和
将其用于商业和非商业目的。
此包包含基本的OpenSSL加密和SSL/TLS
图书馆和工具。
SSL
配置(openssl)=1.0.1i-1
libcrypto.so.1.0.0()(64位)
libssl.so.1.0.0()(64位)
openssl=1.0.1i-1
openssl(x86-64)=1.0.1i-1
在Makefile*中将LIBCOMPATVERSIONS=修改为LIBCOMPATVERSIONS=10并不能解决此问题。 所以问题是,“我如何让rpm知道它有libssl.So.10和libcrypto.So.10?”

如有任何意见,将不胜感激,谢谢

--mmtsk

您可以使用“提供:”“”标记:


感谢您的评论,我认为我们不应该将每个共享对象文件都放在“提供”字段中。