Red Hat Bugzilla – Bug 75602
rpmbuild improperly packages .src.rpm files built as a user
Last modified: 2008-05-01 11:38:04 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20021006
Description of problem:
building an rpm as a non-root user causes the files in the .src.rpm file to be
owned by that user in the cpio archive. This results in rpms which likely
cannot be rebuilt with --rebuild as the original building user may not exist on
the second build system. This is a fatal error when building an rpm apparently.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build an rpm as a non-root user
2. rpm2cpio foo.src.rpm |cpio --list --verbose
Actual Results: files in the .src.rpm are owned by the building user
Expected Results: files in the .src.rpm should be owned by root
(at the minimum) in your spec file manifests.
no no no.. not the binary rpm, the SOURCE rpm contains files which are
---- cut here ---- minimal specfile:
Summary: Test RPM
rm -rf $RPM_BUILD_ROOT && mkdir -p $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT
---- cut here ----
blue-smoke% rpmbuild -ba testme.spec
... rpm build ...
blue-smoke% rpm -qlvp /devel/rpm/SRPMS/testme-0-0.src.rpm
-rw-r--r-- 1 gbrittongbritton 359 Oct 10 13:23 testme.spec
blue-smoke% rpm -qlvp /devel/rpm/RPMS/i386/testme-0-0.i386.rpm
-rw-r--r-- 1 root root 0 Oct 10 13:23 /testme
files in the .src.rpm file are owned by the build user. If the file is
then transported to another machine without that user, rpmbuild --rebuild
will complain about the ownership of the files in the source rpm.
There's a warning, but the right thing happens,
at least when installing as non-root.
root may need to do
chown root.root /usr/src/redhat/SOURCES/*
There's no way to precompute the ownership of files
in src.rpm's for all possible cases.