Bug 694579

Summary: rpmdev-newspec should generate specs with %defattr for older RPMs
Product: [Fedora] Fedora Reporter: Michel Alexandre Salim <michel>
Component: rpmdevtoolsAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: a.badger, tcallawa, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-07 18:01:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.