Bug 694579 - rpmdev-newspec should generate specs with %defattr for older RPMs
Summary: rpmdev-newspec should generate specs with %defattr for older RPMs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmdevtools
Version: 15
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-07 17:11 UTC by Michel Alexandre Salim
Modified: 2011-04-07 18:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-07 18:01:43 UTC
Type: ---


Attachments (Terms of Use)

Description Michel Alexandre Salim 2011-04-07 17:11:14 UTC
Description of problem:
For the latest version of RPM (F-15+), %defattr no longer needs to be defined. However, if such a spec is used to generate an SRPM on F-14 or below, rpmlint reports that file attributes are not set, e.g.:

https://bugzilla.redhat.com/show_bug.cgi?id=694568

python-testtools.src:35: E: files-attr-not-set
python-testtools.src:36: E: files-attr-not-set

Generating the spec with -r set to 4.4 should produce the %defattr line, but does not.

Version-Release number of selected component (if applicable):
rpmdevtools-8.0-3.fc15.noarch

How reproducible:
Always

Steps to Reproduce:
1. rpmdev-newspec -r 4.4 python-foo on F-14
2. rpmbuild -bs on F-14
3. rpmlint the produced srpm
  
Actual results:
spec does not contain %defattr definition; rpmlint generates errors

Expected results:
spec should contain %defattr for all but rpm 4.9


Additional info:

Comment 1 Ville Skyttä 2011-04-07 18:01:43 UTC
(In reply to comment #0)
> Generating the spec with -r set to 4.4 should produce the %defattr line, but
> does not.

As far as I know, rpmbuild >= 4.4 does not need the %defattr.  If that's incorrect, feel free to reopen this bug along with pointers to more information.  From /usr/share/doc/rpm-*/ChangeLog.bz2:

| Date:   Wed Oct 13 21:03:29 2004 +0000
|    - silently add default %defattr(-,root,root) for all packages.

If you want the %defattr, use -r 4.3, or to make it the default set RPMVER=4.3 in /etc/rpmdevtools/newspec.conf or ~/.config/rpmdevtools/newspec.conf.  I'll add and improve documentation about this in the next rpmdevtools release.

@spot: it might be a good idea to filter the files-attr-not-set message in all Fedora's rpmlint configs except the EL4 one.

Comment 3 Toshio Ernie Kuratomi 2011-04-07 18:35:16 UTC
Spot: There's also a warning on the binary rpms:

python-testtools.noarch: W: non-standard-group Unspecified

and we'd want to update the packaging guidelines as well.


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