构建 rpm,覆盖 _topdir,但获取 BuildRequires deps?

发布于 2024-11-15 18:12:22 字数 725 浏览 2 评论 0原文

我有一个可以创建的libfoo-devel rpm,使用技巧来覆盖_topdir。现在我想构建一个包“bar”,它有一个 BuildRequires 'libfoo-devel”。我似乎找不到访问内容的正确方法的 libfoo-devel ,而无需将其安装在构建主机上。

编辑:

的构建和目标发行版都是 SuSE。

我 模拟,因为我相信 SuSE 不会将其包含在其库存存储库中

编辑:

我相信我寻求的答案是在 build 包中。也许这是 SuSE 对 mock 的答案? oBS服务的分布式版本?

描述

build是构建SuSE Linux的工具 以安全、清洁的方式进行 RPM。建造 将安装最小的 SuSE Linux 作为 将系统构建到某个目录中并 将 chroot 到该系统进行编译 包裹。这样你就不会冒险 破坏你的工作系统(由于 例如损坏的规格文件),甚至 如果包不使用 BuildRoot。

build 在规范文件中搜索 构建要求:行;如果这样一条线是 发现,所有指定的转速都是 安装。否则选择 使用默认包。注意 构建不会自动解析 缺少依赖项,因此指定 rpm 必须足够 构建。

I have a libfoo-devel rpm that I can create, using the trick to override _topdir. Now I want to build a package "bar" which has a BuildRequires 'libfoo-devel". I can't seem to find the Right Way to get access to the contents of libfoo-devel without having to install it on the build host. How should I be doing it?

EDIT:

My build and target distros are both SuSE.

I prefer solutions that don't require mock, since I believe SuSE does not include it in its stock repo.

Subsequent EDIT:

I believe that the answer I seek is in the build package. Perhaps it's SuSE's answer to mock? Or it's the distributed version of the oBS service?

DESCRIPTION

build is a tool to build SuSE Linux
RPMs in a safe and clean way. build
will install a minimal SuSE Linux as
build system into some directory and
will chroot to this system to compile
the package. This way you don't risk
to corrupt your working system (due to
a broken spec file for example), even
if the package does not use BuildRoot.

build searches the spec file for a
BuildRequires: line; if such a line is
found, all the specified rpms are
installed. Otherwise a selection of
default packages are used. Note that
build doesn't automatically resolve
missing dependencies, so the specified
rpms have to be sufficient for the
build.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掩于岁月 2024-11-22 18:12:22

请注意,如果您确实不需要安装 libfoo-devel 来构建包 bar,最明智的选择是从中删除 libfoo-devel BuildRequires 指令(并且可能将需求放在它所属的位置)。

但是,如果由于某种原因您无法做到这一点,请创建一个“开发”rpm 数据库。基本上它涉及使用 rpm --initdb --root /path/to/fake/root。然后用标准发行版安装的所有“目标包”填充它。

有很多 rpm --install --root /path/to/fake/root --justdb package-name.rpm 命令,但也许你可以找到一种方法来复制你的 >/var/lib/rpm/* 数据库文件并使用它们作为起点。一旦你有了替代的 rpm 数据库,你就可以使用 --justdb 选项来伪造 libfoo-devel 包的安装。然后您就可以在家中自由地进行实际的 rpm 构建。

Note that if you really don't need libfoo-devel installed to build package bar the most sensible alternative would be to remove libfoo-devel from the BuildRequires directive (and maybe put the requirement where it belongs).

However, if you cannot do that for some reason, create a "development" rpm database. Basically it involves using rpm --initdb --root /path/to/fake/root. Then populate it with all of the "target packages" of your standard distro installation.

That's a lot of rpm --install --root /path/to/fake/root --justdb package-name.rpm commands, but maybe you can figure out a way to copy over your /var/lib/rpm/* database files and use those as a starting point. Once you have the alternative rpm database, you can fake the installation of the libfoo-devel package with a --justdb option. Then you'll be home free on the actual rpm build.

我是有多爱你 2024-11-22 18:12:22

如果模拟和 openSUSE 构建服务都不是可行的选择,那么您将不得不全力以赴并安装该软件包,直接或在 chroot 中;该包提供 SRPM 打包程序确定需要构建的文件,因此位于 BuildRequires 标记中。

If neither mock nor the openSUSE Build Service are a viable choice then you will have to buckle down and install the package, either directly or in a chroot; the package provides files that the SRPM packager has decided are required to build, and hence is in the BuildRequires tag.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文