Bug 116448

Summary: RFE: enable use of subdirectories in the %file directive
Product: [Fedora] Fedora Reporter: Robert Lehr <bozzio>
Component: rpmAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: lkardos, mattdm
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: 2016-03-10 15:11:08 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:
Attachments:
Description Flags
%files subdir patch for rpm v4.2 none

Description Robert Lehr 2004-02-21 06:02:28 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030725

Description of problem:
I am submitting a patch that implements use of a subdirectory with the
%files directive.  It is only useful when using a single spec file to
build several packages.  By specifying a subdirectory of the
RPM_BUILD_ROOT, we force RPM to strip that additional component from
the pathname of the files loading the files into the RPM.

A patch for v4.2 and v4.0.4 is attached to this feature-request.

It is used in this manner.

    %install

    # do a bunch of installation stuff

    %{__mkdir_p} $RPM_BUILD_ROOT/{mainpkg,subpkg1,subpkg2}

    for i in mainpkg subpkg1 subpkg2
    do
      generate_filelist $RPM_BUILD_ROOT/$i > filelist-$i
    done

    %files -f filelist-mainpkg -r mainpkg
    %defattr(-,root,root)

    %files subpkg1 -f filelist-subpkg1 -r subpkg1
    %defattr(-,root,root)

    %files subpkg2 -f filelist-subpkg2 -r subpkg2
    %defattr(-,root,root)

We use it for two purposes.

First, we build packages that contain files with the same name but
different contents.  This cannot be accomplished without the feature
that we have added.  But it is a critical feature for us to the
software on our ~400 servers located around the globe.

Second, we use it as an easier means of generating file-lists for the
sub-packages being created by a single spec file.


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


How reproducible:
Always

Steps to Reproduce:
1.this is not a bug.
2. it is a feature request.
3. we can duplicate it by applying the patch and rebuilding the rpm RPM.
    

Additional info:

Comment 1 Robert Lehr 2004-02-21 07:01:39 UTC
Created attachment 97900 [details]
%files subdir patch for rpm v4.2

Comment 2 Arkadiusz Miskiewicz 2004-02-24 13:35:36 UTC
afaik this was discussed some time ago and there was better option - 
make BuildRoot working per subpackage.

For example:
BuildRoot: /tmp/xyz

%package xyz
BuildRoot: /tmp/xyz/abc


Comment 3 Matthew Miller 2005-04-12 18:05:14 UTC
Robert -- the "Version" in the bug is meant to be the Red Hat Linux version you
are reporting against, not the actual package version. There hasn't been any
activity here for over a year; this should probably either be closed or moved to
a newer (Fedora Core or RHEL) disto version.

Comment 4 Paul Nasrat 2005-04-12 19:02:10 UTC
Modified component

Comment 5 Red Hat Bugzilla 2007-08-21 05:18:00 UTC
User pnasrat's account has been closed

Comment 6 Panu Matilainen 2007-08-22 06:30:36 UTC
Reassigning to owner after bugzilla made a mess, sorry about the noise...

Comment 7 John Poelstra 2008-07-04 04:15:10 UTC
triaged

Comment 8 Fedora Admin XMLRPC Client 2012-04-13 23:11:33 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Fedora Admin XMLRPC Client 2012-04-13 23:13:44 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Ľuboš Kardoš 2016-03-10 15:11:08 UTC
This is quiet old request and it seems that what you want is a achievable in current rpm version (rpm-4.13) which is available in fedora since f23. The name of feature is RemovePathPostfixes and it was added upstream in this commit:

https://github.com/rpm-software-management/rpm/commit/415aa42566052db9b7677163cea0366e55f72dcf

So I am closing this bug as current release.