Bug 1116373 - having "%doc FILE" in %files surprisingly adds all of %{_pkgdocdir} to the package
Summary: having "%doc FILE" in %files surprisingly adds all of %{_pkgdocdir} to the pa...
Keywords:
Status: CLOSED DUPLICATE of bug 728959
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-04 11:06 UTC by Michal Schmidt
Modified: 2015-04-17 12:48 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-04-17 12:48:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michal Schmidt 2014-07-04 11:06:06 UTC
Description of problem:
When a spec file lists "%doc FILE" in its %files section, rpmbuild adds not just FILE to the package, but also the whole %_pkgdocdir directory with all its contents.

Example spec file:

Name:         testdoc
Version:      1
Release:      1%{?dist}
Summary:      test for spec file doc directive
License:      BSD

%description
Test for the behavior of the doc directive

%prep
echo "BSD" > COPYING
%build
%install
mkdir -p %{buildroot}/%{_datadir}/doc/testdoc
echo "Hello" > %{buildroot}/%{_datadir}/doc/testdoc/readme.txt

%files
%doc COPYING

%changelog
* Fri Jul 04 2014 Michal Schmidt <mschmidt> 1-1
- first version


Version-Release number of selected component (if applicable):
rpm-4.11.2-2.fc20.x86_64

How reproducible:
always

Steps to Reproduce:
1. rpmbuild -bb testdoc.spec
2. rpm -qlp testdoc-1-1.fc20.x86_64.rpm

Actual results:
It lists the following package contents:
/usr/share/doc/testdoc
/usr/share/doc/testdoc/COPYING
/usr/share/doc/testdoc/readme.txt

Expected results:
I did not expect readme.txt to be packaged.

Additional info:
I noticed this because of hitting a file conflict between dbus-1.6.12-9.fc20.x86_64 and dbus-doc-1.6.12-9.fc20.noarch, where all the documentation files are accidentally included in the main dbus package too even though the author clearly only wanted to have the COPYING file there.
This may be expected behavior, but it is not obvious.

Comment 1 Panu Matilainen 2014-07-07 07:05:30 UTC
Yup... see bug 728959, whose dupe this mostly/effectively is, and also bug 1113236 and bug 1113233 revolve around the same issue.

Comment 2 Ľuboš Kardoš 2015-04-17 12:48:19 UTC

*** This bug has been marked as a duplicate of bug 728959 ***


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