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

2015-02-15 Thread Domen Vrankar
 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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-02-10 Thread Joshua Clayton
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

On Tue, Feb 3, 2015 at 11:50 PM, Domen Vrankar domen.vran...@gmail.com wrote:
 Add the --target argument to rpmbuild
 Do not add a BuildArch variable to the spec file for arch specific packages
 BuildArch causes rpm building to fail except for noarch packages

 I'm not too familiar with cross compilation problems so could you
 please also provide a simple test case to help with patch review?

 Thanks,
 Domen
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-02-03 Thread Rolf Eike Beer
  # CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
 -if(CPACK_RPM_PACKAGE_ARCHITECTURE)
 +if(NOT CPACK_RPM_PACKAGE_ARCHITECTURE)
 +  execute_process(COMMAND uname -m
 +  WORKING_DIRECTORY ${WDIR}
 +  OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE)
 +endif()

You don't need to specify a working directory for uname. Also I assume that 
you want to use OUTPUT_STRIP_TRAILING_WHITESPACE to not have the trailing 
newline in the variable.

Greetings,

Eike

signature.asc
Description: This is a digitally signed message part.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

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

2015-02-03 Thread Domen Vrankar
 Add the --target argument to rpmbuild
 Do not add a BuildArch variable to the spec file for arch specific packages
 BuildArch causes rpm building to fail except for noarch packages

I'm not too familiar with cross compilation problems so could you
please also provide a simple test case to help with patch review?

Thanks,
Domen
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers