[Fedora-packaging] Few questions regarding spec file standard

Greg Swift gregswift at gmail.com
Tue Feb 24 06:19:43 UTC 2015


On Mon, Feb 23, 2015 at 11:42 PM, Eric Griffith <egriffith92 at gmail.com>
wrote:

> Hey everyone, first message to the mailing list and a new packager in
> general. I've gone over the wiki and the docs but a few things are
> still unclear to me.
>
> 1) rpmlint complains about source0 not being a valid URL, but it
> rpmbuild can't find the source if I have it correct... Currently it
> says:
>
> Source0:
> https://github.com/01org/thermal_daemon/archive/v%{version}.tar.gz
>
> But when I do "rpmbuild -ba thermal_daemon.spec" (following Fedora
> Documentation
> http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/index.html
> ) then rpmbuild complains about:
>
> error: File /home/egriffith/rpmbuild/SOURCES/v1.30.tar.gz: No such
> file or directory
>
> presumably because its just looking at "v%{version}.tar.gz". What is
> the appropriate fix here? The upstream source is in fact:
>
> https://github.com/01org/thermal_daemon/archive/v%{version}.tar.gz (in
> this case v1.30.tar.gz)
>
> but the download link gives you "thermal_daemon-1.3.tar.gz" which is
> in my SOURCES directory. So do I rename thermal_daemon-1.3.tar.gz to
> be "v1.30.tar.gz" or do I modify "Source0" to not be 100% faithful to
> the actual URL? Or is there an override I can use to specify that the
> downloaded files have a different name than the upstream source URL
>

This part can be  meh.  So, generally you want the url path to be where
someone could download the file directly, such as by using spectool (
http://linuxmanpages.net/manpages/fedora21/man1/spectool.1.html).

There are some recommendations about making a source url with github.

See this bug: https://fedorahosted.org/fpc/ticket/233 and the page it links
to. I think the bug gives great background.

Also: https://fedoraproject.org/wiki/User:Spot/GitHub_Guidelines

I'm not a huge fan of the commit id portion, but whatever works i guess.


> 2) %build section. The original spec file had 'autoreconf' the
> compilation instructions had ./autogen.sh. Which is the correct one to
> use? Current spec uses autogen.sh
>
Use whatever your software needs/suggests.  If you aren't compiling
anything you can even leave %build blank.


> 3) Is a "BuildRequires: systemd" necessary or is it just redundant?
>

I believe its necessary. Even if it currently isn't, there is a lot of
discussion right now that maybe people should be explicit even if something
was assumed previously.  I require it here:

https://github.com/rackerlabs/plight/blob/master/plight.spec#L31-L34


> 4) Can someone link or explain the Requires(post)/(preun)/(postun),
> same with %post, %preun, %postun
>
Basically its defining a requirement for that package/software to be
available during those steps, even if its not necessarily required once the
RPM is installed.  This page has some good explanations about each stage.
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets


> 5) %files does every single file need to be listed here or just
> 'important ones? I left out /usr/share/src, /usr/lib and a couple
> others.
>
All files that are included need to be listed. That being said globbing can
be effective. I'd read through

http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
http://fedoraproject.org/wiki/How_to_create_an_RPM_package/zh-tw#.25files_section

6) Upstream name is "thermal_daemon" but I see it packaged elsewhere
> as "thermald" and the binary / .service is thermald. Preference goes
> to...?
>

The packager... ? i think i'd be more inclined to follow other packagers in
a situation liek this where it seemed reasonable, otherwise i'd default to
pure upstream.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/packaging/attachments/20150224/99cd26cf/attachment.html>


More information about the packaging mailing list