#747 Texinfo packaging guidelines need extending
Closed: nothingtodo 5 years ago Opened 6 years ago by nickc.

Guideline page needing clarification:

https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Texinfo

Explanation

The description of how to handle the installation of texinfo files is correct, but it misses
out one important fact. When /sbin/install-info is run it will create a file called "dir" in the
/usr/share/info directory. This will show up during a build as an untracked file, preventing
the build from working. The solution is to add:

%exclude %{_infodir}/dir

to the %files section.


I think there is some confusion here. The scriptlets you link to aren't run at package build time, they are run when the package is installed (or uninstalled). The error you are taking about happens at package build time.

This means that you could remove those scriptlets entirely and you will still get that "dir" file, because it's created as part of the build (or install) process of the software you are packaging. If we had other guidelines covering texinfo (and we wanted to be comprehensive) then they would mention getting rid of that extra "dir" file. But we don't to the best of my recollection have other guidelines covering texinfo, so....

(This does remind me that we really should be using file triggers on %_infodir so we can one day be rid of these crufty scriptlets.)

Ah yes one day ... :-)

I did notice that other rpms just delete the dir file during the %install phase, rather than excluding it from the %files list. I was not sure if that might cause problems if multiple rpms were being installed at the same time, so I did not suggest it.

I'm not sure how it could possibly cause problems to delete that file in %install; that is code which runs at package build time. so if you remove it there it is simply not in the package. That's not deleting it from the end user system or anything like that.

But certainly it works equally well to just %exclude it.

I don't want to lapse into a packaging tutorial, but it does seem that a bit of info would help, so... %prep, %build and %install, plus the gathering of files via %files and some behind-the-scenes stuff all happens when the package itself is built. The tarballs are unpacked, the software is compiled and then installed into a dummy tree (under %buildroot). Nothing you do there actually gets run on end user systems.

The scriptlets in %pre, %post, %postun, %posttrans, etc. are run when the package is installed or removed, not when the package is built. They are only run on the end user systems. Not coincidentally, they should be minimal and generally limited to updating caches and such. You don't want them creating or removing files, because those changes are not tracked via the RPM database. We're actually trying to get rid of them wherever possible.

@nickc would you like us to do something here, still?

Metadata Update from @ignatenkobrain:
- Issue assigned to ignatenkobrain

5 years ago

Nope - I am good, thanks.

Cheers
Nick

Metadata Update from @ignatenkobrain:
- Issue close_status updated to: nothingtodo
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata