rpmlib(FileDigests) dependency error on RPM built with rpm-maven-plugin

家住魔仙堡 提交于 2019-12-10 11:19:19

问题


Just like with this question, I try to an install an RPM and get the following errors:

# rpm -iv myapp-0.0.14-SNAPSHOT.rpm 
error: Failed dependencies:
        rpmlib(FileDigests) <= 4.6.0-1 is needed by myapp-0.0.14-SNAPSHOT20151117233758.noarch
        rpmlib(PayloadIsXz) <= 5.2-1 is needed by myapp-0.0.14-SNAPSHOT20151117233758.noarch

But my app was built with the rpm-maven-plugin.

There are differences in redhat version between the build machine and the server on which I want to do the install.

$ uname -a
Linux buildmach 2.6.32-573.el6.x86_64 #1 SMP Wed Jul 1 18:23:37 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

# uname -a
Linux myserver 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

How do I resolve this, If I am using this plugin to build the rpm?


回答1:


Actually, it's not that hard, at least not for my use case where I'm basically just using rpm to deploy war files.

You merely need to define a couple of macros differently than what the stock redhat installer gives you:

%_binary_payload    w9.gzdio
%_binary_filedigest_algorithm   1

Interestingly, redhat's macros file for rhel6 indicates that these are the default but they're not, in fact, the defaults:

#   Compression type and level for source/binary package payloads.
#       "w9.gzdio"  gzip level 9 (default).
#       "w9.bzdio"  bzip2 level 9.
#       "w7.xzdio"  xz level 7, xz's default.
#       "w7.lzdio"  lzma-alone level 7, lzma's default
#
#%_source_payload   w9.gzdio
#%_binary_payload   w9.gzdio

#   Algorithm to use for generating file checksum digests on build.
#   If not specified or 0, MD5 is used.
#   WARNING: non-MD5 is backwards incompatible, don't enable lightly!
#   The supported algorithms may depend on NSS version, as of NSS
#   3.11.99.5 the following are supported:
#   1   MD5 (default)
#   2   SHA1
#   8   SHA256
#   9   SHA384
#   10  SHA512
#
#%_source_filedigest_algorithm  1
#%_binary_filedigest_algorithm  1

If the defaults were as indicated by the comments in the redhat macros file, it should not be necessary to uncomment these lines.

In any case, since I'm using the rpm-maven-plugin, I can configure this using plugin parameters in pom.xml without changing the macros file.

<defineStatements>
    <defineStatement>_binary_payload w9.gzdio</defineStatement>
    <defineStatement>_binary_filedigest_algorithm 1</defineStatement>
</defineStatements>



回答2:


Yes, those "differences in redhat version" that you so casually sweep aside are huge and, exactly the problem. CentOS 5 and CentOS 6 have wildly different versions of rpm (and rpmlib) and the CentOS 6 version has support for newer payload compression and a newer FileDigests version than the version of rpm (and rpmlib) on CentOS 5 can support.

This is exactly what I said in the answer to the question you linked. You cannot build a package on CentOS 6 for use on CentOS 5 without using a chroot of some sort.

Well, I believe you might be able to override the default selection of compression and digest algorithms via rpmbuild macro configuration and selecting values that are supported in the version of rpm that is available on CentOS 5 might remove those requirements from your build RPM (or lower the version so that it works) but I don't know how to do that offhand.



来源:https://stackoverflow.com/questions/33768793/rpmlibfiledigests-dependency-error-on-rpm-built-with-rpm-maven-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!