#115 Improve initial specfile in GNU Hello tutorial
Merged by oturpe. Opened by oturpe.
fedora-docs/ oturpe/package-maintainer-docs improve-tutorial  into  main

Download 115.patch

The packaging tutorial used to create the initial specfile with
rpmdev-newspec, only to proceed to present a different initial specfile
to be used. Still, some paragraphs later on referred to contents of
rpmdev-newspec-generated specfile.

Also, the tutorial starts with downloading upstream sources with wget
even before creating the initial specfile. This leaves the
relationship between downloaded sources and the specfile's Source tag
unclear.

These issues have confused people attempting to follow the tutorial,
see [1,2].

Improve the tutorial by:

  • Just mentioning rpmdev-newspec, but instructing to simply paste the
    initial specfile from the tutorial.
  • Downloading upstream source only after the initial specfile has been
    created, with 'spectool -g' like local downloads are normally done.

Signed-off-by: Otto Liljalaakso otto.liljalaakso@iki.fi

My confusion:

  1. The relationship between the URL:, Source: and the tarball retrieved by wget.

If I understand it, fedpkg looks at the Source:, strips the pathto derive the file name, then looks for that file name locally. If that's it, it would be useful to document.

URL: is perhaps just a comment? fedpkg seems to succeed without it.

  1. The tutorial approach is to present a .spec file with errors, then explain how to debug. It's reasonable but unusual. Often, the hello world is a working example.

I think a statement at the beginning, right after "Inside a Spec File" explaining this would be useful. The "slight editing" statement is a bit misleading.

rebased onto c514a6fb86a07d1be59a56a6726866f8829fb8bf

My confusion:

  1. The relationship between the URL:, Source: and the tarball retrieved by wget.

If I understand it, fedpkg looks at the Source:, strips the pathto derive the file name, then looks for that file name locally. If that's it, it would be useful to document.

Your interpretation is correct.
I think the new version explains this better than the previous one.
Please also note that a tutorial cannot be a complete RPM reference manual, so we necessarily have to just skip explaining some details.

URL: is perhaps just a comment? fedpkg seems to succeed without it.

Almost. It is package metadata.
You can query it with e.g. dnf -C info hello.
I added a line describing what should be put into it.

  1. The tutorial approach is to present a .spec file with errors, then explain how to debug. It's reasonable but unusual. Often, the hello world is a working example.

I think a statement at the beginning, right after "Inside a Spec File" explaining this would be useful. The "slight editing" statement is a bit misleading.

This was already there:

The tutorial proceeds in step by step manner, with most steps editing the package’s specfile.

And this pull request adds also the following:

It [the initial specfile] does not work yet, but we will try to build it and fix errors as we encounter them.

1 new commit added

  • Describe specfile tags and sections in the tutorial

A lot of time has passed with no further comments.
I merge this change now.

rebased onto c47ef0933630c7c0c6f1fafa2ea4e59cd4e5725b

Pull-Request has been merged by oturpe

Metadata