I know that people have asked in the past about removing gcj from Fedora
in favor of OpenJDK, and I'm aware that this has not happened for
reasons including architecture support on some platforms. I don't know
when this was assessed last, but I'm leaving that question alone for now.
The Java packages I have examined in Fedora 14 are forcibly built using
gcj so that the AOT bits are included, which is fine. However, during
the final stages of packaging, rpmbuild searches and finds the AOT bits,
sees that they link against libgcj_bc.so.1, and automatically adds that
as a dependency to the package. The packages should not, however,
depend on libgcj -- they can be used as-is with OpenJDK or another JRE,
simply ignoring the AOT bits. This is analogous to not requiring
'man-db' to be installed if a package contains man files, or not
requiring 'gdb' to be installed if a package contains debug symbols.
You can take advantage of those if you would like, but they are not
required for use.
So can we fix the rpmbuild macros so that the AOT bits are ignored when
automatically adding dependencies?
Also on this topic, there is a macro in the SPEC file of a lot of the
Java-based packages that doesn't work quite right:
%define gcj_support
%{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
Somehow this always defines "gcj_support" as 1, even if I do "rpmbuild
--without gcj_support". If I slightly alter the way the macro is
written, then it seems to have the intended effect:
%define gcj_support
%{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support}%{!?_gcj_support:0}}}
Some packages additionally hard code this value, using one of these two
lines:
%define _with_gcj_support 1
%define gcj_support 1
Those lines needs to be removed wherever they appear. Fedora 14's
rpmbuild macros set "_gcj_support" to 1, so this is the default if no
options are given and the long macro above is included. A user ought to
still be able to do "rpmbuild --without gcj_support" if they want,
without having to edit the SPEC file.
Thanks,
David