RPM Community Forums

Mailing List Message of <rpm-users>

Re: Project "RPM Spec file creation guidelines"

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 25 Dec 2008 - 20:30:24 CET
Message-id: <ED42EFF6-2FB6-44EC-B0EC-02573E3C4A29@mac.com>

On Dec 24, 2008, at 7:24 PM, Eric MSP Veith wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> after the latest thread on rpm-users, I guess there is a lack of some
> guidelines on how to create good, nice-looking spec files. And so I  
> thought
> creating a brainstorming ML thread would be a good first step that  
> could
> ultimately lead to a complete document regarding this.
>

Creating "good, nice-looking spec files" is hardly related to
the primary goal for package management which is
	Delivering content to user file systems reliably.

> So I hereby start the brainstorm with the attached spec file  
> skeleton and
> hope to attract alot of commentors. I'd also like to start  
> collecting FAQ
> regarding spec file creation, like:
>
> Q: I've seens some spec files careing for mkdir/rm of %{buildroot},  
> and
> others don't. How comes this?

The packaging paradigm of
	BuildRoot: /path/to/buildroot
	...
	%install
	rm -rf %{buildroot}
	mkdir -p %{buildroot}
	...
	%clean
	rm -rf %{buildroot}

(and all the hysterical insanity trying to prevent
	rm -rf /
using rpmbuild) is an attempt to increase build reproducibility.

However, all of the above is largely unnecessary in spec
files for 2-3 years. Yes if you wish to pretend that spec files
are portable amongst multiple versions of rpm distributed
in the wild, you will of course need all the above goop forever
(or limit rpmbuild versions by, say, adding a version to spec files).


>
> A: Current versions of RPM come not only with the ability to
> pre-define %clean and %install, but also automatically take care of
> removing (or re-creating) the buildroot. Have a look at  
> %__spec_clean_body
> and %__spec_install_body
>

Accurate answer and very useful.

But I doubt that spec files can ever be meaningfully
changed, there's too many, and the *.spec files are
too poorly maintained, for any change to be meaningful imho.

But that's not a reason for not attempting to eliminate the goop.

73 de Jeff

  • application/pkcs7-signature attachment: smime.p7s
Received on Thu Dec 25 20:30:33 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.