Hello, I'm starting to learn how packaging works and when I try to do the firsts steps of the tutorial right after requiring gcc and make, the build prompts an error that says that makeinfo command is not found and suggests to install texinfo. After adding the BuildRequires: texinfo, the build continues as described in the tutorial.
I'm using Fedora 36
Thank you for the report. Most probably your suggested solution is correct. I will take a look when possible.
I have problems reproducing this issue. Could you provide more details, such as the exact specfile, fedpkg invocation you used and its complete output?
fedpkg
I tried to do it again from zero, but it works as expected now. I will try to test a bit more, I didn't save the logs or the build tools' versions (my bad). But the error message was something like this:
WARNING: `makeinfo' is missing on your system. You should only need it if you modified a `.texi' or `.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy `make' (AIX, DU, IRIX). You might want to install the `Texinfo' package or the `GNU make' package. Grab either from any GNU archive site.
The specfile looked like this:
Name: hello Version: 2.10 Release: 1%{?dist} Summary: Produces a familiar, friendly greeting License: GPLv3+ URL: https://www.gnu.org/software/hello Source0: https://ftp.gnu.org/gnu/hello/hello-%{version}.tar.gz BuildRequires: gcc BuildRequires: make %description The GNU Hello program produces a familiar, friendly greeting. Yes, this is another implementation of the classic program that prints "Hello, world!" when you run it. %prep %autosetup %build %configure %make_build %install %make_install %files %changelog * Fri Oct 28 2022 Ramiro Antonio <rantonio@fedoraproject.org> - 2.10-1 - Initial version of the package
And the fedpkg invocation was fedpkg --release f36 mockbuild
fedpkg --release f36 mockbuild
Since the tutorial works for me and works for you in its current form, I close this issue now. Feel free to reopen this issue if you manage to reproduce the issue again, and you think that it is caused by something being wrong in the tutorial.
Metadata Update from @oturpe: - Issue status updated to: Closed (was: Open)
Similar problem has been reported again in Packaging mailing list: Problem with GNU Hello tutorial (makeinfo not found).
I tried to reproduce it like this, using a Rawhide toolbox as the packaging environment:
mkdir hello && cd hello # open the specfile in editor, paste contents nano hello.spec # create environment toolbox create gnu-hello-test toolbox enter gnu-hello-test dnf upgrade --assumeyes # follow https://docs.fedoraproject.org/en-US/package-maintainers/Installing_Packager_Tools/ sudo dnf install fedora-packager fedora-review --assumeyes sudo usermode -a -G mock <your_local_username> fkinit -u <your_fedora_accounts_username> # build fedpkg --release f37 mockbuild
Hi, I'm the person who reported the problem. Now is solved by adding BuildRequires: texinfo. I'm using the spec file provided on the tutorial.
Name: hello Version: 2.10 Release: %autorelease Summary: Produces a familiar, friendly greeting
License: GPL-3.0-or-later URL: http://ftp.gnu.org/gnu/%{name} Source: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
BuildRequires: gcc BuildRequires: gettext BuildRequires: make BuildRequires: texinfo
%description The GNU Hello program produces a familiar, friendly greeting. Yes, this is another implementation of the classic program that prints "Hello, world!" when you run it.
%prep %autosetup mv THANKS THANKS.old iconv --from-code=ISO-8859-1 --to-code=UTF-8 --output=THANKS THANKS.old
%build %configure %make_build
%install %make_install rm %{buildroot}/%{_infodir}/dir %find_lang %{name}
%check make check
%files -f %{name}.lang %{_mandir}/man1/hello.1. %{_infodir}/hello.info. %{_bindir}/hello %doc AUTHORS ChangeLog NEWS README THANKS TODO %license COPYING
%changelog %autochangelog
it can work on both f36 and f37, I'm using f37
The list of BuildRequires is still incomplete. It's missing coreutils for "mv" command, glibc-common for "iconv" command etc. I will review the spec file an amend it.
I opened https://pagure.io/fedora-docs/package-maintainer-docs/pull-request/125 pull request.
Thank you for the pull request @ppisar, great update. You do not include BuildRequires: texinfo that @acyanbird reports as required, though.
BuildRequires: texinfo
What I still would like to understand, why I can complete this tutorial without texinfo. Sure, it just happens to be pulled in for me, but since the tutorial uses fedpkg mockbuild, I have problems understanding why some people have it pulled in, and others do not.
texinfo
fedpkg mockbuild
hello-2.10 sources contain prebuilt doc/hello.info which is newer than other doc/*.texi files. If the reporter's system touches the time stamps, than it will indeed attempt to execute makeinfo. But the same could be said about ./configure versus configure.ac.
Another culprit could be a time stamp clamping introduced in Fedora 38 https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes. If user's local time is off, autochangelog entry could be older than than doc/* timesamps and that would mangle the timestamp of the files resulting to the execution of makefinfo.
I was unable to reproduce the failure with a stock mock environment neither for F39, nor for F36.
Ideal spec file would prune all the pregenerated (configure, doc/hello.info) and bundled (m4) files and build everything from sources. But I worry that it would be too difficult for a beginner's how-to. GNU Hello is not a trivial package.
I have to agree, GNU Hello has all kinds of quirks that have to be taken into account. Ideally, we would find a better example package for this first tutorial that would avoid such extra steps that are not generally needed. Perhaps using GNU Hello as the example made more sense back in the day when GNU and Autotools encompassed a larger share of the open source world. Nowadays, I see Autotools as just one of the buildsystems. Using CMake or Meson as the buildsystem in the tutorial would probably be simpler, I we can come up with a reasonable example package.
I reopen this issue to track the missing BuildRequires.
BuildRequires
Metadata Update from @oturpe: - Issue status updated to: Open (was: Closed)
I merged my https://pagure.io/fedora-docs/package-maintainer-docs/pull-request/125. I will try to enhance the how to with unbundling documentation and autotools. If that does not make the tutorial too long, it will solve the nondeterministic dependency on texinfo.
I am currently thinking of writing another. simpler tutorial that packages sl. Like GNU Hello, it is a toy program with no useful functionality, and also much simpler than GNU Hello, yet not entirely trivial in that it e.g. has a man page in two languages, and has a single library dependency. The main weakness is that the Makefile does not have install target at all, so specfile %install needs to work around that — but I guess that is OK, since the install script is not long.
I have submitted #150 as a simple fix for this issue. Reworking the build method so that the build is deterministic would be great, especially if we get a simpler tutorial for sl or some other simple case — this tutorial can then become a tutorial for more complex case, in which case additional complexity can be better tolerated, and can perhaps even be beneficial, depending on how complex the adjustment is.
sl