[cmake-developers] [PATCH] CPackRPM: Fix cross-building rpms

Domen Vrankar domen.vrankar at gmail.com
Sun Feb 15 15:38:27 EST 2015


> I've finally had some time to read over the Tests section, and it is a
> bit overwhelming.
> I'm going to describe the use cases for my patch and perhaps you can
> give me some guidance on adding an actual test.
>
> There are three, maybe four use cases:
> 1) native rpm (e.g. x86_64)
> 2) noarch rpm (a noarch package should contain scripts, artwork, etc,
> but no compiled code)
> 3) a non-native, but compatible rpm (e.g. building x86 on a multilib
> x86_64 system)
> 4) incompatible cross-compiled package (e.g. building for arm or ppc)
>
> in each case the way you know it worked is
> a) "make package" successfully produces an rpm file
> b) running "rpm -qip my_rpm_file.my_arch.rpm returns a description of the rpm,
>  including the line "Architecture: my_arch"

Sorry for the late reply.

I've finally had some time to go through the patch:
1) If I understand you correctly BuildArch should never be set except
in noarch case. This would mean that CPACK_RPM_PACKAGE_ARCHITECTURE
value should set --target and if set to noarch should also (if
necessary) set BuildArch as before. Your patch currently silently
ignores all user settings of CPACK_RPM_PACKAGE_ARCHITECTURE except
noarch,
2) Since you are already writing a patch for
CPACK_RPM_PACKAGE_ARCHITECTURE you should also add
CPACK_RPM_<component>_PACKAGE_ARCHITECTURE so that you can set the
architecture per component.

Regarding the tests:
1) You should add the test setup for noarch and auto defined and auto
detected architecture in
Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in -
just define architecture for headers component (implement 2. from
above for this) and leave the rest of components to auto detection
provided by your patch,
2) Write result verification in
Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake - just extend
the tests at the bottom of this file since pqy query is already used
there.

I am not certain regarding where to put cross-compiled package test...
If rpmbuild is not testing the binaries that will get packed you can
simply set a nonexisting XYZ architecture to only one component - like
with noarch.

Regards,
Domen


More information about the cmake-developers mailing list