且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用rpm-maven-plugin构建的RPM上的rpmlib(FileDigests)依赖性错误

更新时间:2023-12-04 23:26:04

其实这并不困难,至少不是我的使用我基本上只是使用rpm部署war文件的情况。

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

您只需要定义一些宏与原始红帽安装程序不同的宏: p>

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

有趣的是,rhel6的redhat的宏文件表示这些是默认的,但实际上并不是默认值:

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

如果默认值与redhat宏文件中的注释一样,则不需要取消注释这些行。

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

在任何情况下,由于我使用的是rpm-maven-plugin,所以我可以使用pom.xml中的插件参数来配置它,而不用更改宏文件。

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>