[opensuse-packaging] how to check if a rpm macro exists
What is the best way to check if a rpm macro is defined? Many packages rely on macros which are provided by additional development packages. Thats fine during package build, but bad for bugfixing because one should not have each and every random devel package installed. Its usually enough to have a minimal installation with osc/quilt/vim to adjust packages, 'osc build' will install the required packages in the chroot. The way quilt setup *.spec works is that it expands all macros, and fails if they are not found. But processing just the %prep section usually requires no macros. Simple macros like kde4_runtime_requires can be written like %{?kde4_runtime_requires} to avoid the error. But this seems to fail for complex macros like suse_kernel_module_package. I tried a few combinations like %{?suse_kernel_module_package} or %if '%{?suse_kernel_module_package}' != '', but each one fails. How can I do quilt setup a KMP package if kernel-devel is not installed? Olaf
On Dienstag, 7. Februar 2017, 09:02:36 CET wrote Olaf Hering:
What is the best way to check if a rpm macro is defined?
Many packages rely on macros which are provided by additional development packages. Thats fine during package build, but bad for bugfixing because one should not have each and every random devel package installed. Its usually enough to have a minimal installation with osc/quilt/vim to adjust packages, 'osc build' will install the required packages in the chroot.
The way quilt setup *.spec works is that it expands all macros, and fails if they are not found. But processing just the %prep section usually requires no macros.
Simple macros like kde4_runtime_requires can be written like %{?kde4_runtime_requires} to avoid the error. But this seems to fail for complex macros like suse_kernel_module_package. I tried a few combinations like %{?suse_kernel_module_package} or %if '%{?suse_kernel_module_package}' != '', but each one fails.
How can I do quilt setup a KMP package if kernel-devel is not installed?
Try %if 0%{?macro:1} > 0 -- Adrian Schroeter email: adrian@suse.de SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (2)
-
Adrian Schröter
-
Olaf Hering