[Fedora-packaging] Few questions regarding spec file standard

Mihamina RAKOTOMANDIMBY mihamina.rakotomandimby at rktmb.org
Tue Feb 24 06:14:38 UTC 2015


On 02/24/2015 08:42 AM, Eric Griffith 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


If

https://github.com/01org/thermal_daemon/archive/v%{version}.tar.gz

Redirects to another ressource,

https://.../thermal_daemon-1.3.tar.gz then you should provide the URL of the actually downloaded ressource.

My answer for this is then: change "Source0:".


> 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

AFAIK, The build section can be whatever you need.
There are some helpers (macros) that have been provided for some widely 
used compilation method.
If you use the helpers, you have some conventions to follow.
But nothing is wrong with using "./autogen.sh"


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

Does your target system run with systemd?

> 4) Can someone link or explain the Requires(post)/(preun)/(postun),
> same with %post, %preun, %postun

No idea

> 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.

You can list directories
You just have to list what you will install



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

http://fedoraproject.org/wiki/Packaging:NamingGuidelines

To professional packagers, I tried to answer honestly, please forgive 
any unwanted mistakes, let's correct together if any. ;-)

-- 
https://www.google.com/search?q=mihamina+rakotomandimby



More information about the packaging mailing list