如何使cpack不会将所需的库添加到RPM? [英] How do you make it so that cpack doesn't add required libraries to an RPM?

查看:148
本文介绍了如何使cpack不会将所需的库添加到RPM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将正在使用的构建系统转换为cmake,并通过cpack生成的RPM遇到了一个有趣的问题:它会自动将其认为您的RPM具有的所有依赖项添加到所需的库列表。

I'm trying to convert our build system at work over to cmake and have run into an interesting problem with the RPMs that it generates (via cpack): It automatically adds all of the dependencies that it thinks your RPM has to its list of required libraries.

通常,这很好,但就我而言,这是灾难性的。不幸的是,我们构建的开发包最终只能使用我们自己开发的工具安装,该工具使用rpm将其安装在与系统不同的RPM数据库中。这很愚蠢,但我无法更改。这意味着任何普通库都将依赖的所有系统库(例如libc或libpthread)都不在我们的开发包所使用的RPM数据库中。因此,如果我们开发包之一的RPM列出了所需的系统库,那么我们将无法安装它,因为rpm会认为未安装它们(因为它们被列在普通数据库而不是一个数据库中)在安装我们的软件包时被告知要使用)。我们目前的构建工作可以很好地解决这一问题,因为它没有在RPM中将任何系统库作为依赖项列出,而是cpack自动填充RPM的所需库列表,并将系统库放在其中。我需要一种阻止它的方法。

In general, that's great, but in my case, it's catastrophic. Unfortunately, the development packages that we build end up getting installed with one our home-grown tool that uses rpm to install them in a separate RPM database from the system one. It's stupid, but I can't change it. What this means is that all of the system libraries that any normal library will rely on (like libc or libpthread) aren't in the RPM database that is being used with our development packages. So, if an RPM for one of our development packages lists system libraries as being required, then we can't install it, as rpm will think that they're not installed (since they're listed in the normal database rather than the one that it's being told to use when installing our packages). Our current build stuff handles this just fine, because it doesn't list any system libraries as dependencies in the RPMs, but cpack automatically populates the RPM's list of required libraries and puts the system libraries in there. I need a way to stop it from doing so.

我尝试将 CPACK_RPM_PACKAGE_REQUIRES 设置为 ,但这无效。 RPM cpack生成最终仍会列出所需的系统库。目前,我能想到的就是复制RPM cpack生成器并将其修改为我想要的内容,并使用它代替标准的生成器,但是我希望避免这样做。有谁知道如何让cpack停止使用所需的库填充RPM?

I tried setting CPACK_RPM_PACKAGE_REQUIRES to "", but that has no effect. The RPM cpack generates still ends up with the system libraries listed as being required. All I can think of doing at this point is to copy the RPM cpack generator and hack it up to do what I want and use that instead of the standard one, but I'd prefer to avoid that. Does anyone have any idea how I could get cpack to stop populating the RPM with required libraries?

推荐答案

请参阅底部

http ://www.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html

autoreqprov标记-禁用自动依赖处理

The autoreqprov Tag — Disable Automatic Dependency Processing

有时可能不需要RPM的自动依赖项处理。在这些情况下,可以使用autoreqprov标记将其禁用。此标记采用是/否或0/1值。例如,要禁用自动依赖项处理,可以使用以下行:

There may be times when RPM's automatic dependency processing is not desired. In these cases, the autoreqprov tag may be used to disable it. This tag takes a yes/no or 0/1 value. For example, to disable automatic dependency processing, the following line may be used:

AutoReqProv:否

AutoReqProv: no

编辑:

要在cmake中进行设置,您需要执行 set(CPACK_RPM_PACKAGE_AUTOREQPROV no)。似乎需要在前面(或后面)的多余空间才能使它起作用。似乎cpack的RPM模块有一个错误,该错误使其无法让您将其变量设置为少于3个字符的长度。

In order to set this in cmake, you need to do set(CPACK_RPM_PACKAGE_AUTOREQPROV " no"). The extra space seems to be required in front of (or behind) the no in order for it to work. It seems that the RPM module for cpack has a bug which makes it so that it won't let you set some its variables to anything shorter than 3 characters long.

这篇关于如何使cpack不会将所需的库添加到RPM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆