[opensuse-packaging] How to use BuildArch ExclusiveArch ExcludeArch correctly?
Hello, I have a package that contains only bash scripts (plus documentation) and therefore it is currently BuildArch: noarch But depending on the run-time architecture it requires different packages and therefore it has in its spec file -------------------------------------------------------------- %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif -------------------------------------------------------------- But that cannot work because when it is built as "noarch" none of the %ifarch matches which means neither syslinux nor yaboot will be required by the resulting *.rpm package. I did not find openSUSE documentation how to solve this. The Fedora Packaging Guidelines https://fedoraproject.org/wiki/Packaging:Guidelines contain an "1.9 Architecture Support" section that contains (excerpt): -------------------------------------------------------------- Requires When your package needs the problematic dependency at runtime but not at build time then you only need to keep it from entering the package repositories for that architecture. There is a relatively simple workaround for this: BuildArch: noarch # List the arches that the dependent package builds on below ExclusiveArch: %{ix86} %{arm} x86_64 noarch -------------------------------------------------------------- I don't know if -------------------------------------------------------------- BuildArch: noarch ExclusiveArch: %ix86 x86_64 ppc ppc64 noarch %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif -------------------------------------------------------------- is allowed and/or works on openSUSE. I found a strange looking example at openSUSE: -------------------------------------------------------------- $ osc cat openSUSE:13.1 libreoffice-l10n libreoffice-l10n.spec ... BuildArch: noarch #!ExclusiveArch: %ix86 x86_64 ppc ExcludeArch: ia64 s390 s390x -------------------------------------------------------------- I do not understand that. In particular what "#!ExclusiveArch:" means? Why not plain "ExclusiveArch:"? Furthermore at run-time the bash scripts in that package actually work only on a few supported architectures namely %ix86 x86_64 ppc ppc64. Therefore I like to specify only those architectures where the package actually works. I like to avoid that those bash scripts can be "just installed" on architectures that are actually not supported (i.e. I like to avoid that the package can be built by accident on architectures where it actually cannot work). Would it work to simply have only -------------------------------------------------------------- ExclusiveArch: %ix86 x86_64 ppc ppc64 %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif -------------------------------------------------------------- Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wednesday 2015-07-29 15:13, Johannes Meixner wrote:
BuildArch: noarch
But depending on the run-time architecture it requires different packages and therefore it has in its spec file -------------------------------------------------------------- %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif -------------------------------------------------------------- But that cannot work because when it is built as "noarch" none of the %ifarch matches which means neither syslinux nor yaboot will be required by the resulting *.rpm package.
I did not find openSUSE documentation how to solve this.
This cannot be solved. noarch.rpm is supposed to be the same no matter where built, nor what for. Your package does not have that "is-same-everywhere" predicate, so you cannot have it noarch. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On Jul 29 15:38 Jan Engelhardt wrote:
On Wednesday 2015-07-29 15:13, Johannes Meixner wrote:
BuildArch: noarch
But depending on the run-time architecture it requires different packages and therefore it has in its spec file -------------------------------------------------------------- %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif -------------------------------------------------------------- But that cannot work because when it is built as "noarch" none of the %ifarch matches which means neither syslinux nor yaboot will be required by the resulting *.rpm package.
I did not find openSUSE documentation how to solve this.
This cannot be solved. noarch.rpm is supposed to be the same no matter where built, nor what for. Your package does not have that "is-same-everywhere" predicate, so you cannot have it noarch.
This part is already clear (therefore I wrote "that cannot work"). The remaining part of my initial mail is where I like to get advice how to do it correctly for openSUSE. Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wednesday 2015-07-29 15:46, Johannes Meixner wrote:
The remaining part of my initial mail is where I like to get advice how to do it correctly for openSUSE.
Just don't specify BuildArch:. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
В Wed, 29 Jul 2015 15:13:19 +0200 (CEST) Johannes Meixner <jsmeix@suse.de> пишет:
Hello,
I have a package that contains only bash scripts (plus documentation) and therefore it is currently
BuildArch: noarch
But depending on the run-time architecture it requires different packages and therefore it has in its spec file -------------------------------------------------------------- %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif --------------------------------------------------------------
I tentatively think this is what virtual provides are for. Make syslinux/yaboot Provides: bootloader and require it. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On Jul 29 20:23 Andrei Borzenkov wrote (excerpt):
? Wed, 29 Jul 2015 15:13:19 +0200 (CEST) Johannes Meixner <jsmeix@suse.de> ?????:
-------------------------------------------------------------- %ifarch %ix86 x86_64 Requires: syslinux %endif %ifarch ppc ppc64 Requires: yaboot %endif --------------------------------------------------------------
I tentatively think this is what virtual provides are for. Make syslinux/yaboot Provides: bootloader and require it.
This cannot work here because then also grub2 could provide a generic "bootloader" RPM capability but that package needs explicitly syslinux on %ix86 x86_64 and yaboot on ppc ppc64. RPM requirements for explicit packages could be meant as such. Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Andrei Borzenkov
-
Jan Engelhardt
-
Johannes Meixner