Bug 116448 - RFE: enable use of subdirectories in the %file directive
RFE: enable use of subdirectories in the %file directive
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Fedora Packaging Toolset Team
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-21 01:02 EST by Robert Lehr
Modified: 2016-03-10 10:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-10 10:11:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
%files subdir patch for rpm v4.2 (2.91 KB, patch)
2004-02-21 02:01 EST, Robert Lehr
no flags Details | Diff

  None (edit)
Description Robert Lehr 2004-02-21 01:02:28 EST
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 02:01:39 EST
Created attachment 97900 [details]
%files subdir patch for rpm v4.2
Comment 2 Arkadiusz Miskiewicz 2004-02-24 08:35:36 EST
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 14:05:14 EDT
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 15:02:10 EDT
Modified component
Comment 5 Red Hat Bugzilla 2007-08-21 01:18:00 EDT
User pnasrat@redhat.com's account has been closed
Comment 6 Panu Matilainen 2007-08-22 02:30:36 EDT
Reassigning to owner after bugzilla made a mess, sorry about the noise...
Comment 7 John Poelstra 2008-07-04 00:15:10 EDT
triaged
Comment 8 Fedora Admin XMLRPC Client 2012-04-13 19:11:33 EDT
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 19:13:44 EDT
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 10:11:08 EST
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.

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