我正在尝试从 FC 12 上的 *.src.rpm 文件构建,以使文件像使用普通二进制构建一样分布在我的系统中(在这种情况下,*.h 文件最终位于/usr/包括)。当我运行 rpmbuild 时,标题不存在。这是我的 rpmbuild 命令:
[root@localhost sphirewalld]# rpm -ivv /home/dan/Downloads/gtest-1.3.0-2.20090601svn257.fc12.src.rpm
============== /home/dan/Downloads/gtest-1.3.0-2.20090601svn257.fc12.src.rpm
Expected size: 489395 = lead(96)+sigs(180)+pad(4)+data(489115)
Actual size: 489395
loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
couldn't find any keys in /var/lib/rpm/pubkeys/*.key
loading keyring from rpmdb
opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv
opening db index /var/lib/rpm/Packages rdonly mode=0x0
locked db index /var/lib/rpm/Packages
opening db index /var/lib/rpm/Name rdonly mode=0x0
read h# 931 Header sanity check: OK
added key gpg-pubkey-57bbccba-4a6f97af to keyring
read h# 1327 Header sanity check: OK
added key gpg-pubkey-7fac5991-4615767f to keyring
read h# 1420 Header sanity check: OK
added key gpg-pubkey-16ca1a56-4a100959 to keyring
read h# 1896 Header sanity check: OK
added key gpg-pubkey-a3a882c1-4a1009ef to keyring
Using legacy gpg-pubkey(s) from rpmdb
/home/dan/Downloads/gtest-1.3.0-2.20090601svn257.fc12.src.rpm: Header SHA1 digest: OK (3e98ed9b1631395d417e00f35c83ebe588ea9d3b)
added source package [0]
found 1 source and 0 binary packages
Expected size: 489395 = lead(96)+sigs(180)+pad(4)+data(489115)
Actual size: 489395
InstallSourcePackage at: psm.c:232: Header SHA1 digest: OK (3e98ed9b1631395d417e00f35c83ebe588ea9d3b)
gtest-1.3.0-2.20090601svn257.fc12
========== Directories not explicitly included in package:
0 /root/rpmbuild/SOURCES/
1 /root/rpmbuild/SPECS/
==========
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
fini 100664 1 ( 0, 0) 478034 /root/rpmbuild/SOURCES/gtest-1.3.0.tar.bz2;4ba93ce1 unknown
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
fini 100644 1 ( 0, 0) 30505 /root/rpmbuild/SOURCES/gtest-svnr257.patch;4ba93ce1 unknown
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
fini 100644 1 ( 0, 0) 2732 /root/rpmbuild/SPECS/gtest.spec;4ba93ce1 unknown
GZDIO: 63 reads, 511788 total bytes in 0.005930 secs
closed db index /var/lib/rpm/Name
closed db index /var/lib/rpm/Packages
closed db environment /var/lib/rpm/Packages
谢谢你的帮助。
很抱歉我不使用 Fedora,所以我不能确定,但我看到这已经有一段时间没有得到答复了。我确实构建了大量的 RPM,但用于不同的发行版 (PLD)。
您的输出并没有说明 DID 生成了什么。您确定没有与主二进制 rpm 一起生成 -devel 子包吗?您是否查看了 src.rpm 包中的文件并确保您要查找的文件在其中?您的 rpmbuild 脚本是否有任何标志说“包含开发文件”或类似的东西?
我的回答很可能不再相关,但
rpm -i(vv)
不能用于从源 RPM 包构建二进制 RPM 包。这需要使用rpmbuild
,例如rpmbuild --rebuild /<…>/gtest-1.3.0-2.20090601svn257.fc12.src.rpm
。对于源 RPM 包,实际发生的所有事情rpm -i(vv)
是源 RPM 包的内容被提取到 rpmbuild 目录结构中,特别/root/rpmbuild/{SOURCES,SPECS}/
是在这种情况下。要构建这个填充的 rpmbuild 目录结构,cd /root/rpmbuild/SPECS/
然后rpmbuild -ba gtest.spec
可以使用(我不推荐,因为 RPM 包不应该作为特权用户构建,因为软件和/或规范文件中的错误或错误可能会损坏您的操作意外引用构建环境之外的路径时的系统)。