Bug 75265 - Add --topdir to redifine the rpm %_topdir macro
Summary: Add --topdir to redifine the rpm %_topdir macro
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build   
(Show other bugs)
Version: 7.3
Hardware: All Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2002-10-06 13:58 UTC by Eugene Gluzberg
Modified: 2008-05-01 15:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-10-06 18:09:26 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Eugene Gluzberg 2002-10-06 13:58:30 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020910

Description of problem:
I find that rpm -bb is difficult to run when you are not root. /usr/src/redhat
is usually not accessable by the user. Without root access the only way for me
to build rpms is to redifine the %_topdir macro in the spec file:

%define _topdir /var/tmp/rpm

Then you have to create the whole rpm directory structure under there. The
enchancement I am asking for is 2 fold:

1. Add a --topdir option to the build command to specify where the directories
are (rather then having the user change the spec file) 
2. Try to create these directories if they don't exist. 

If you are on a system hosted by someone else, root access is not nesseserally
available to change the permissions of /usr/src/redhat dirs.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
run rpm -bb blah.spec as anything except root on a default installed RH system.

Actual Results:  permission denied errors.

Expected Results:  I would not get those since i would use the --topdir option
to point to a writable directory.

Additional info:

Comment 1 Miloslav Trmac 2002-10-06 18:09:20 UTC
echo '%_topdir /home/mitr/data/redhat' >> ~/.rpmmacros
is better than that, it is permanent and you don't need
to add the --target to every rpmbuild invocation.

Comment 2 Jeff Johnson 2002-10-08 13:07:59 UTC
You can add a --topdir option to rpmbuild by
putting in /etc/popt or ~/.popt

    rpmbuild alias --topdir --define '_topdir !#:+'

rpm has way too many options for this to be added
as part of default configuration

Note You need to log in before you can comment on or make changes to this bug.