Rpmbuild not finding manpages when building RPM


I am trying to build a RPM from source code after making some modifications to add a new command-line flag and associated functionality. I plan to make a pull request at some point, but for now I am trying to build my own RPM so that we can use it in the meantime. I used the link provided to the suricata-rpms GitHub repo that was posted in this topic and have been able to make it to the very end of the rpmbuild process before it errors out due to the manpages directory.

This is the error message I receive:

File not found: /root/rpmbuild/BUILDROOT/suricata-7.0.5_dyn-2.el8.x86_64/usr/share/man/man1/*

That error message is triggered by the following line in the suricata.spec file in the %files section:

%attr(644,root,root) %{_mandir}/man1/*

I have been using the suricata.spec file in the 7.0/ folder in the suricata-rpms repo and I didn’t see anything that was copying or moving the manpages files to that directory. I am using sphinx-build to create the manpages files in the doc/userguide/manpages/ directory in the source code folder, but I’m unsure if I need to place them in a specific directory or something for them to be copied to the %{_mandir}/man1/ directory in the suricata.spec file once I run rpmbuild. Does anyone know if this is something I need to add to the suricata.spec file myself or if there is something I’m overlooking?

The RPMs use our distribution source tarballs as their input, and the man pages exist in those. So when you make the input dist for your RPM, you’ll need to make sure the man pages are generated there as part of make dist, which they should be provided Sphinx is installed at that stage (prior to any RPM building).

Thanks for the reply Jason. I have been using the code from the main-7.0.x branch on the GitHub and I didn’t realize that it was a little bit different compared to the tarballs available on the website. Once you mentioned that the man pages already existed in the tarballs it steered me in the right direction. I downloaded the 7.0.5 tarball from the website and compared it to the stuff from GitHub and I was placing the files in the wrong directory.

Sphinx-build was telling me that the source and destination directories couldn’t be the same when I ran it in the doc/userguide/ directory so I just assumed I should leave the generated man pages in the doc/userguide/manpages/ directory. After comparing with the tarball from the website I found that they were stored in the doc/userguide/ directory after all. Once I moved them there rpmbuild found them and was able to finish compiling the RPM.

1 Like