根据RPM文档/指南(http://ftp.rpm.org/max-rpm/ch-rpm-subpack.html),可以使用子程序包通过单个SPEC文件构建多个RPM程序包。在提到的链接中,构建并打包了软件包foo,foo-server,foo-client和bazlib。
在示例中,SPEC文件具有一个称为foo的基本/父程序包(服务器,客户端和bazlib是子程序包):
Name: foo
Version: 2.7
Release: 1
Source: foo-2.7.tgz
License: probably not
Summary: The foo app, and the baz library needed to build it
Group: bogus/junque
%description
This is the long description of the foo app, and the baz library needed to
build it...
%package server
Summary: The foo server
Group: bogus/junque
%description server
This is the long description for the foo server...
%package client
Summary: The foo client
Group: bogus/junque
%description client
This is the long description for the foo client...
%package -n bazlib
Version: 5.6
Summary: The baz library
Group: bogus/junque
%description -n bazlib
This is the long description for the bazlib...
...snipped
构建这些软件包将产生以下软件包:
# rpmbuild -ba foo-2.7.spec
* Package: foo
* Package: foo-server
* Package: foo-client
* Package: bazlib
...snipped
几个问题:
1.)基本/父程序包foo是否具有某些特殊用途,例如RPIO中的某些其他标志/属性?还是从RPM-“角度”来看,软件包foo是否等于其所有子软件包?如果是这样,为什么将这些包称为子包(子包一词意味着特殊的关系)?
2.)假设我通过子程序包打包了具有多个二进制文件(工具,工具包,工具c)的产品,有没有办法禁用基本/父程序包?在我的情况下,不需要特殊的基本/父程序包,因为所有工具程序包都得到同等对待(此问题与问题1有关)。
我猜有可能只构建工具(基础/父包)和toola,toolb,toolc,而不能将工具添加到存储库中。但这有点不对劲(也许可以将toola用作基本包,而将toolb和toolc用作子包?)。
就二进制RPM而言,主包及其子包是相等的。我可以想到以下两个原因,子程序包被称为:主程序包的“变体”,它们继承了主程序包的许多字段(尽管它们可以被覆盖),甚至默认使用其名称。从源码包的角度来看,它们是整个源码包的子包,其名称与主包相同。
如果不需要主软件包,请确保其%files
列表为空,并且不会生成。请参见“使用%files列表控制软件包”部分。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句