Bug 143746

Summary: Create buildmeister user for mortal RPM packaging
Product: [Fedora] Fedora Reporter: Kenneth Porter <shiva>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: mattdm, nobody+pnasrat
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-29 06:04:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kenneth Porter 2004-12-26 18:36:29 UTC
We recommend that RPM's be packaged as a mortal, but the default
rpm-build setup encourages users to package as root. I recommend that
the rpm-build package create the user buildmeister in its %pre script
and the directory tree /usr/src/redhat should be owned by this user.
Would-be packagers should be encouraged to su to this user to package.

This is particularly useful for non-programmers who just want to
install a 3rd party package "from source" using its SRPM.

Comment 1 Matthew Miller 2004-12-26 19:30:19 UTC
"buildmeister"? :)

I don't think a special account should be used (or needed). What if
multiple people are building RPMs at the same time on the same system?

Instead, I think it'd be nicer to have this in the default macros:

%_topdir        %(echo $HOME)/rpmbuild
%_sourcedir     %{_topdir}/%{name}-%{version}
%_specdir       %{_sourcedir}
%_rpmdir        %{_topdir}/RPMS
%_srcrpmdir     %{_topdir}/SRPMS
%_builddir      %{_topdir}/BUILD
%_rpmfilename   %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%_tmppath       %(echo $HOME)/tmp



Comment 2 Kenneth Porter 2004-12-26 19:57:16 UTC
I used "buildmeister" only because this seems to be what Red Hat is
using internally, as evidenced by the ownership in some tarballs. This
solution should be adequate for single-user workstations. For
multi-user servers, presumably the admin is knowledgable enough to
change the default to something more appropriate. Or a commented-out
entry can be include for him, along with a script to create the
canonical directory structure for each user. (I believe the old
cpanflute was able to create the directory tree and initial .rpmmacros
file.)

The only required change in your list appears to be _topdir. The
others should already be present in some reasonable form in
/usr/lib/rpm/macros.

Comment 3 Matthew Miller 2004-12-26 20:02:56 UTC
Although it's no longer really a requirement, I grate at seeing
default accounts with usernames over 8 characters.....

Comment 4 Jeff Johnson 2004-12-29 06:04:57 UTC
rpm-build cannot establish a "buildmeister" conevntion
by itself. There is also no reason to dictatate how
packages are built, either by root, "buildmeister" or any other
account that anyone finds conevenient.

Comment 5 Matthew Miller 2004-12-29 06:10:22 UTC
I agree. However, the current rpm-build package _does_ have a default
convention -- building packages as root in /usr/src/redhat. I
understand not doing anything new and fancy, but is there a reason to
continue doing that?

Comment 6 Kenneth Porter 2004-12-29 07:05:08 UTC
Agreed. The fact that /usr/lib/rpm/macros points at /usr/src/redhat
and that directory is owned by root establishes a defacto policy of
encouraging users to package as root.