Bug 980897

Summary: Unneeded parts in spec files when using rpmdev-newspec
Product: [Fedora] Fedora Reporter: Mario Blättermann <mario.blaettermann>
Component: rpmdevtoolsAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: a.badger, twoerner, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-04 20:38:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mario Blättermann 2013-07-03 13:18:47 UTC
Description of problem:
Artifacts from older Fedora releases are still in spec templates.

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

When I use rpmdev-newspec to create a spec file, I get some unneeded parts. In the review process I stumble upon this stuff very often. Depending on the software type, the following parts are obsolete:

All types:
rm -rf $RPM_BUILD_ROOT

"-t python"
python-devel is deprecated, python2-devel is mandatory
(BTW, actually we need a template which contains the if-then constructs for Python2/Python3 mixed mode specs)

"-t ocaml"
ocaml packages are arch-dependent, the isa tag is missing from runtime requirements:
Requires: %{name}%{?_isa} = %{version}-%{release}

Moreover, rpmdev-newspec creates an empty changelog. Would be nice if it would pick up at least date, packager name and mail address from the local rpm config.

Comment 1 Ville Skyttä 2013-07-07 09:08:12 UTC
(In reply to Mario Blättermann from comment #0)
> All types:
> rm -rf $RPM_BUILD_ROOT

Not obsolete when redhat-rpm-config is not installed, and specfiles from rpmdevtools don't mandate it.

> "-t python"
> python-devel is deprecated, python2-devel is mandatory

I suppose the easiest thing would be to just make this change and rename current python template to python2?

> (BTW, actually we need a template which contains the if-then constructs for
> Python2/Python3 mixed mode specs)

Patches welcome.

> "-t ocaml"
> ocaml packages are arch-dependent, the isa tag is missing from runtime
> requirements:
> Requires: %{name}%{?_isa} = %{version}-%{release}

That needs to be fixed in https://fedoraproject.org/wiki/Packaging:OCaml and the attached https://fedoraproject.org/w/uploads/5/5c/Packaging_OCaml_ocaml-foolib.spec first.

> Moreover, rpmdev-newspec creates an empty changelog. Would be nice if it
> would pick up at least date, packager name and mail address from the local
> rpm config.

Done upstream: https://git.fedorahosted.org/cgit/rpmdevtools.git/commit/?id=8f2052385afd8bff0f4edec886c82cd97a8533f3

Comment 2 Mario Blättermann 2013-07-07 12:00:18 UTC
(In reply to Ville Skyttä from comment #1)
> (In reply to Mario Blättermann from comment #0)
> > All types:
> > rm -rf $RPM_BUILD_ROOT
> 
> Not obsolete when redhat-rpm-config is not installed, and specfiles from
> rpmdevtools don't mandate it.
> 
See http://fedoraproject.org/wiki/Packaging:Guidelines#BuildRoot_tag. As far as I can see, since F10 the initial cleaning of buildroot is no longer needed. And there's nothing about the presence of redhat-rpm-config. I had a look at my last Koji builds, and this package was not installed.

> > "-t python"
> > python-devel is deprecated, python2-devel is mandatory
> 
> I suppose the easiest thing would be to just make this change and rename
> current python template to python2?
> 
> > (BTW, actually we need a template which contains the if-then constructs for
> > Python2/Python3 mixed mode specs)
> 
> Patches welcome.

OK, I will create two new templates, for mixed-mode Python2/3 and pure Python3. Will do this next days. Indeed, for pure Python2 it would be the easiest solution to rename the template.

> > Moreover, rpmdev-newspec creates an empty changelog. Would be nice if it
> > would pick up at least date, packager name and mail address from the local
> > rpm config.
> 
> Done upstream:
> https://git.fedorahosted.org/cgit/rpmdevtools.git/commit/
> ?id=8f2052385afd8bff0f4edec886c82cd97a8533f3
Thanks.

Comment 3 Ville Skyttä 2013-07-07 20:45:25 UTC
(In reply to Mario Blättermann from comment #2)

> As far as I can see, since F10 the initial cleaning of buildroot is no longer
> needed. And there's nothing about the presence of redhat-rpm-config.

Either trust me, or read the code :).  "Automatic" cleaning of buildroot at start of %install _is_ implemented in redhat-rpm-config, see %__spec_install_pre in /usr/lib/rpm/redhat/macros (this is at least on F-17, but I believe that's the way in newer distros as well).

> I had a look at my last Koji builds, and this package was not installed.

I've never seen a koji build where it wouldn't be. Are you sure you're looking at the correct log files? If so, please share a link to one...

Comment 4 Mario Blättermann 2013-07-10 15:20:35 UTC
I'm finished with the Python templates. Find the three versions for Python2, Python3 and Python2/3 here:
http://fedorapeople.org/~mariobl/spectemplates/

We don't have Python3 for EPEL (will come in RHEL7) so that I've removed some obsolete stuff from the appropriate templates.

Comment 5 Fedora End Of Life 2013-09-16 14:22:42 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 6 Mario Blättermann 2013-10-31 19:33:34 UTC
(In reply to Ville Skyttä from comment #3)
> Either trust me, or read the code :).  "Automatic" cleaning of buildroot at
> start of %install _is_ implemented in redhat-rpm-config, see
> %__spec_install_pre in /usr/lib/rpm/redhat/macros (this is at least on F-17,
> but I believe that's the way in newer distros as well).
> 
But redhat-rpm-config is part of the minimum build environment:
https://fedoraproject.org/wiki/HOWTOFindMissingBuildRequires#Exceptions
Why keeping the mentioned line anyway? We don't have to support non-chroot local build systems where it is possibly not present.

Comment 7 Ville Skyttä 2013-10-31 19:44:08 UTC
(In reply to Mario Blättermann from comment #6)
> Why keeping the mentioned line anyway?

See comment 1.

Comment 8 Mario Blättermann 2014-01-06 21:04:33 UTC
OK, there's obviously no way to get rid of the "rm -rf $RPM_BUILD_ROOT" line. But what about the new spec templates submitted by me?

Comment 9 Mario Blättermann 2014-08-04 20:38:07 UTC
(In reply to Mario Blättermann from comment #8)
> But what about the new spec templates submitted by me?

Seems that nobody needs them. Closing this bug now.