#1412 do not detect noarch in Makefile.common
Closed: Fixed None Opened 10 years ago by mjakubicek.

Makefile.common currently causes build failures when doing "make local" with a package containing a noarch subpackage.

The problem is on line 38:
LOCALARCH := $(if $(shell grep -i '^BuildArch:.*noarch' $(SPECFILE)), noarch, $(shell uname -m))

First, it cannot grep noarch in this way now, second, there should be $(shell rpm --eval %{_arch}) instead of $(shell uname -m).

As discussed on #fedora-devel with Toshio and Adam Jackson, this should be now probably changed to plain:
LOCALARCH := $(shell rpm --eval %{_arch})

For noarch only packages this means they'll be built in a $arch directory, but that's not an issue IMHO.

...it would be nice to fix this soon, I indeed spent some time looking around what happens to find out why my noarch subpackages fail locally and build fine in Koji -- would like to spare this time for others;)

Dennis, does this look good to you?

This causes obviously more problems than I thought, actually all Java packages that follow the GCJ guidelines contain:

%if %{with_gcj}
BuildRequires: java-gcj-compat-devel >= 1.0.31
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
BuildArch: noarch

Nowadays it greps noarch even if GCJ support is enabled => build fails again later when aot-compile-rpm will be called:

aot-compile-rpm: error: cannot be used on noarch packages

The way it is now is just plain wrong.

Login to comment on this ticket.