[CMake] cpack 32bit rpm on a 64bit system

Eric Noulard eric.noulard at gmail.com
Thu Feb 17 06:43:14 EST 2011


2011/2/17 Yngve Inntjore Levinsen <yngve.levinsen at gmail.com>:
> Dear Eric,
>
> So I answered my own question perhaps, the very issue was in fact that I set CPACK_RPM_PACKAGE_ARCHITECTURE to i686 when I tried to build. Commenting out that part and the packaging worked.

OK.

> Two questions:
>
> - Will this package now be installable on both 32 and 64bit systems? If not, can I get it to be installable on both architectures somehow?

It will work if the 64 bits distro is installed with 32 bits compat'
lib or if the content of your executable is fully static,
since most 64 bits linux systems are capable of runing 32 bits executable.

That said I would rather build two packages, one for 64 bits and
another one for 32 bits.
There is no such thing as MacOS "Universal Binaries" on Linux but there is
at least 1 project trying to do it: FatELF: http://icculus.org/fatelf/

> - Why shouldn't I set the variable?

I'll have to check but this probably due to the fact that the
"rpmbuild" command expected
CPACK_RPM_PACKAGE_ARCHITECTURE and host advertised arch to be consistent.

setting CPACK_RPM_PACKAGE_ARCHITECTURE to noarch always worked,
in fact it was introduced just for that purpose (when you know that
your package does not
contains arch specific files).

Concerning "cross-packaging" which is somehow what you are trying to
do it is mostly
untested and it will probably work in a very limited number of case
(including yours)

Cross packaging may be done by other tools like
PBuilder for Ubuntu (https://wiki.ubuntu.com/PbuilderHowto) or
Mock for Fedora/RHEL (http://fedoraproject.org/wiki/Projects/Mock)
or even OBS (https://build.opensuse.org/).
Clean cross-packaging  is usually far more complicated than
"package some cross-compiled file and pretends arch is YYY".

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list