I've done some debugging this afternoon and found that the problem is
due to my spec having a %clean section.
%install contains:
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
%clean contains:
rm -rf %{buildroot}
When "Executing(%install)" happens the temporary script in /var/tmp contains:
definition of env variables, e.g. RPM_SOURCE_DIR
commands from %install
exit
command from %clean
/usr/lib/rpm/check-buildroot, /usr/lib/rpm/redhat/brp-compress, etc.
The 'exit' means that the script exits early, and the man page
compression (amongst other things) doesn't happen.
If I remove the %clean section, the temporary script contains:
definition of env variables, e.g. RPM_SOURCE_DIR
commands from %install
/usr/lib/rpm/check-buildroot, /usr/lib/rpm/redhat/brp-compress, etc.
i.e. no "exit" and no "rm -rf" from %clean.
I've read this:
https://fedoraproject.org/wiki/EPEL:Packaging#Previously_required_boilerp...
so I understand %clean is redundant, and I will remove it - it solves
my problem. I also see the warning about not putting %clean
immediately after %description because its contents might get appended
to %description. Is that what's happening here? Is %clean being
incorrectly appended to %install?
I also had a look at the macros:
https://pkgs.fedoraproject.org/cgit/rpms/epel-rpm-macros.git/tree/macros....
and noticed on line 200:
rpm.define("clean exit")
...which might explain why "%clean" gets turned into "exit" in the
temporary script.
So I think I've solved my problem, but I wonder if there's a bug in
the macros, or if the documentation needs to be improved slightly? For
me it seems that having a %clean section caused problems, even though
it wasn't "the first section after %description" as warned about on
the wiki.
Regards,
Richard
On 3 September 2016 at 14:58, Richard Fearn <richardfearn(a)gmail.com> wrote:
Hi,
Has something changed with the way that EPEL5 packages are built that
means man pages are no longer automatically compressed?
I've just tried to build a new ncdu package (version 1.12) for EPEL5,
but it failed:
http://koji.fedoraproject.org/koji/taskinfo?taskID=15482900
The man page is installed uncompressed:
> /usr/bin/install -c -m 644 ncdu.1
'/var/tmp/ncdu-1.12-1.el5-root-mockbuild/usr/share/man/man1'
The build failed because ncdu.1.gz (which is meant to go into the
RPMs) couldn't be found, and ncdu.1 (which shouldn't exist when the
RPMs are created) was unpackaged.
This wasn't an issue with the last build (1.11) I did in April 2015:
http://koji.fedoraproject.org/koji/buildinfo?buildID=626540
Again the man page was installed uncompressed, but had been
(automatically) compressed by the time the RPM was created.
Comparing the build logs, these lines from the 1.11 build aren't
present for the 1.12 build:
> + /usr/lib/rpm/find-debuginfo.sh /builddir/build/BUILD/ncdu-1.11
> extracting debug info from /var/tmp/ncdu-1.11-1.el5-root-mockbuild/usr/bin/ncdu
> 278 blocks
> + /usr/lib/rpm/check-buildroot
> + /usr/lib/rpm/redhat/brp-compress
> + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
> + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
> + /usr/lib/rpm/brp-python-bytecompile
> + /usr/lib/rpm/redhat/brp-java-repack-jars
Thanks for any help!
Rich
--
Richard Fearn
richardfearn(a)gmail.com
--
Richard Fearn
richardfearn(a)gmail.com