[opensuse-packaging] Help needed to get baselibs.conf right
Hi, I've struggled with two baselibs.conf issues yesterday, and I'd need help to solve them. First, one question: my understanding is that we can't assume that the packages that will be created will be for 32-bit only, they could well be 64-bit too. Is that right? (We only do 32-bit ones in openSUSE, afaik, though) My two issues can be seen with this example from gtk2 (submitted to G:F): post "%if %_lib == lib64" post "%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules" post "%else" post "%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules" post "%endif" Usage of quotes in scriptlets ============================= I initially wanted to write something like: %if "%_lib" == "lib64" So I tried the following: post "%if \"%_lib\" == \"lib64\"" post "%if \\"%_lib\\" == \\"lib64\\"" post "%if \\\"%_lib\\\" == \\\"lib64\\\"" post '%if "%_lib" == "lib64"' They all caused failures. I worked around the issue by just removing the quotes: post "%if %_lib == lib64" But is there anyway to use quotes there? Paths for x86 packages ====================== The files in x86 packages are all put in a /emul/ia32-linux prefix. So I get /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 and /emul/ia32-linux/etc/gtk-2.0/gtk.immodules. However, the post scriplet above will expand to: /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules So it will just not do what is intended. What's the right way to do things here? Is it a bug in the spec file generated from baselibs.conf for x86? Thanks, Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Tue, 12 Oct 2010, Vincent Untz wrote:
Hi,
I've struggled with two baselibs.conf issues yesterday, and I'd need help to solve them.
First, one question: my understanding is that we can't assume that the packages that will be created will be for 32-bit only, they could well be 64-bit too. Is that right? (We only do 32-bit ones in openSUSE, afaik, though)
Huh? x86-64 is 64bit and last I checked openSUSE supports that :)
My two issues can be seen with this example from gtk2 (submitted to G:F):
post "%if %_lib == lib64" post "%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules" post "%else" post "%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules" post "%endif"
Is the '>' supposed to be '->' ? In any case I didn't even know that 'post ""' exists. You might want to look at gcc45 and glibc baselibs.conf. In particular, for testing the target-system you can use targettype <type> <some baselibs directive> or (target)?arch <arch> <some baselibs directive> Where <arch> can be the usual archs, <type> can be 'x86' (that's the repackaged i?86 libs for ia64 (!)), 'ia32' (that matches all i?86) and some others. Note also the special variables like <prefix>.
Paths for x86 packages ======================
The files in x86 packages are all put in a /emul/ia32-linux prefix. So I get /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 and /emul/ia32-linux/etc/gtk-2.0/gtk.immodules.
However, the post scriplet above will expand to: /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
I think you want to prepend <prefix> to both. Ciao, Michael. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le mardi 12 octobre 2010, à 11:26 +0200, Michael Matz a écrit :
Hi,
On Tue, 12 Oct 2010, Vincent Untz wrote:
Hi,
I've struggled with two baselibs.conf issues yesterday, and I'd need help to solve them.
First, one question: my understanding is that we can't assume that the packages that will be created will be for 32-bit only, they could well be 64-bit too. Is that right? (We only do 32-bit ones in openSUSE, afaik, though)
Huh? x86-64 is 64bit and last I checked openSUSE supports that :)
Sorry, I wasn't clear. We don't generate 64bit packages out of baselibs.conf. At least, AFAIK.
My two issues can be seen with this example from gtk2 (submitted to G:F):
post "%if %_lib == lib64" post "%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules" post "%else" post "%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules" post "%endif"
Is the '>' supposed to be '->' ?
Hrm, no? Should it be? :-)
In any case I didn't even know that 'post ""' exists. You might want to look at gcc45 and glibc baselibs.conf.
I did look at packages using post in baselibs.conf. It turns out nearly no package does this, so I didn't find any great example.
In particular, for testing the target-system you can use
targettype <type> <some baselibs directive> or (target)?arch <arch> <some baselibs directive>
Where <arch> can be the usual archs, <type> can be 'x86' (that's the repackaged i?86 libs for ia64 (!)), 'ia32' (that matches all i?86) and some others. Note also the special variables like <prefix>.
Yeah, that was my first approach. But that assumes I write post scriptlets for all the targettypes we support. And when we'll support a new one, I'll have to fix many baselibs.conf again. So I thought using "%if %_lib == lib64" is a bit more generic and chose this approach. So, no idea about how to use quotes in there, I assume? :-)
Paths for x86 packages ======================
The files in x86 packages are all put in a /emul/ia32-linux prefix. So I get /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 and /emul/ia32-linux/etc/gtk-2.0/gtk.immodules.
However, the post scriplet above will expand to: /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
I think you want to prepend <prefix> to both.
Ah, that sounds good. Thanks! Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Tue, 12 Oct 2010, Vincent Untz wrote:
Huh? x86-64 is 64bit and last I checked openSUSE supports that :)
Sorry, I wasn't clear. We don't generate 64bit packages out of baselibs.conf. At least, AFAIK.
We once did. Namely from the ppc64 packages into the ppc tree.
My two issues can be seen with this example from gtk2 (submitted to G:F):
post "%if %_lib == lib64" post "%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules" post "%else" post "%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules" post "%endif"
Is the '>' supposed to be '->' ?
Hrm, no? Should it be? :-)
It it's supposed to be a normal baselibs conf directive, yes. I don't know about 'post'. Assuming it is what I think it is (simply putting something into the %post section of the generated temporary .spec file) I'd assume those strings have to be RPM directives mixed with shell code. "X > Y" looks like a shell redirection calling program X directing the output to file Y. I don't think this is what you want.
In any case I didn't even know that 'post ""' exists. You might want to look at gcc45 and glibc baselibs.conf.
I did look at packages using post in baselibs.conf. It turns out nearly no package does this, so I didn't find any great example.
Yeah, well, should be an indication that you don't need %post often. From what I assume from your snippets (lacking any explanation what you actually want to achieve) it seems that you want to create softlinks with a standard name pointing to a varying name. baselibs.conf has native support for that without post. Again, see the gcc45 and glibc baselibs.conf for some more complex examples.
In particular, for testing the target-system you can use
targettype <type> <some baselibs directive> or (target)?arch <arch> <some baselibs directive>
Where <arch> can be the usual archs, <type> can be 'x86' (that's the repackaged i?86 libs for ia64 (!)), 'ia32' (that matches all i?86) and some others. Note also the special variables like <prefix>.
Yeah, that was my first approach. But that assumes I write post scriptlets for all the targettypes we support.
Don't write post scriptlets at all I'd say, if you merely want to create some links. Ciao, Michael. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le mardi 12 octobre 2010, à 11:39 +0200, Michael Matz a écrit :
On Tue, 12 Oct 2010, Vincent Untz wrote:
post "%if %_lib == lib64" post "%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules" post "%else" post "%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules" post "%endif"
Is the '>' supposed to be '->' ?
Hrm, no? Should it be? :-)
It it's supposed to be a normal baselibs conf directive, yes. I don't know about 'post'. Assuming it is what I think it is (simply putting something into the %post section of the generated temporary .spec file) I'd assume those strings have to be RPM directives mixed with shell code. "X > Y" looks like a shell redirection calling program X directing the output to file Y. I don't think this is what you want.
This is what we want. In this case (and I have several similar examples), Y contains some kind of cache for the library that is arch-specific (like a list of plugins, with some of their properties). Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Tue, Oct 12, 2010 at 11:02:05AM +0200, Vincent Untz wrote:
Usage of quotes in scriptlets =============================
I initially wanted to write something like: %if "%_lib" == "lib64" So I tried the following: post "%if \"%_lib\" == \"lib64\"" post "%if \\"%_lib\\" == \\"lib64\\"" post "%if \\\"%_lib\\\" == \\\"lib64\\\"" post '%if "%_lib" == "lib64"' They all caused failures. I worked around the issue by just removing the quotes: post "%if %_lib == lib64"
But is there anyway to use quotes there?
I think post "%if "%_lib" == "lib64"" should work.
Paths for x86 packages ======================
The files in x86 packages are all put in a /emul/ia32-linux prefix. So I get /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 and /emul/ia32-linux/etc/gtk-2.0/gtk.immodules.
However, the post scriplet above will expand to: /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
So it will just not do what is intended.
So what's intended? Would the x86 packages look at a /emul/ia32-linux/etc/gtk-2.0/gtk.immodules file? Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le mardi 12 octobre 2010, à 11:36 +0200, Michael Schroeder a écrit :
On Tue, Oct 12, 2010 at 11:02:05AM +0200, Vincent Untz wrote:
Usage of quotes in scriptlets =============================
I initially wanted to write something like: %if "%_lib" == "lib64" So I tried the following: post "%if \"%_lib\" == \"lib64\"" post "%if \\"%_lib\\" == \\"lib64\\"" post "%if \\\"%_lib\\\" == \\\"lib64\\\"" post '%if "%_lib" == "lib64"' They all caused failures. I worked around the issue by just removing the quotes: post "%if %_lib == lib64"
But is there anyway to use quotes there?
I think post "%if "%_lib" == "lib64""
should work.
Weird, I was sure I had tried this and it works now. Oh well. Thanks!
Paths for x86 packages ======================
The files in x86 packages are all put in a /emul/ia32-linux prefix. So I get /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 and /emul/ia32-linux/etc/gtk-2.0/gtk.immodules.
However, the post scriplet above will expand to: /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
So it will just not do what is intended.
So what's intended? Would the x86 packages look at a /emul/ia32-linux/etc/gtk-2.0/gtk.immodules file?
Hrm, right. We probably want: /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Tue, 12 Oct 2010, Vincent Untz wrote:
Paths for x86 packages ======================
The files in x86 packages are all put in a /emul/ia32-linux prefix. So I get /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 and /emul/ia32-linux/etc/gtk-2.0/gtk.immodules.
However, the post scriplet above will expand to: /usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
So it will just not do what is intended.
So what's intended? Would the x86 packages look at a /emul/ia32-linux/etc/gtk-2.0/gtk.immodules file?
Hrm, right. We probably want: /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
[I think I now understand what you want to achieve in the %post, you really want to call that program redirecting the output] The above will overwrite /etc/gtk-2.0/gtk.immodules from the normal installed libgtk2 package. I think you'd rather want to write to /emul/ia32-linux/etc/gtk-2.0/gtk.immodules. FYI: the i?86 emulation on ia64 is somewhat special: the kernel implicitely prepends the /emul/ia32-linux to all file opens with absolute path (and if not found retries without that prefix), i.e. /emul/ia32-linux acts like an implicit chroot for x86 programs on ia64. Hence x86 gtk2 programs from /emul/ia32-linux, when trying to open /etc/gtk-2.0/gtk.immodules will first search for /emul/ia32-linux/etc/gtk-2.0/gtk.immodules. Ciao, Michael. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le mardi 12 octobre 2010, à 12:06 +0200, Michael Matz a écrit :
On Tue, 12 Oct 2010, Vincent Untz wrote:
Hrm, right. We probably want: /emul/ia32-linux/usr/bin/gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
[I think I now understand what you want to achieve in the %post, you really want to call that program redirecting the output]
The above will overwrite /etc/gtk-2.0/gtk.immodules from the normal installed libgtk2 package. I think you'd rather want to write to /emul/ia32-linux/etc/gtk-2.0/gtk.immodules. FYI: the i?86 emulation on ia64 is somewhat special: the kernel implicitely prepends the /emul/ia32-linux to all file opens with absolute path (and if not found retries without that prefix), i.e. /emul/ia32-linux acts like an implicit chroot for x86 programs on ia64.
Hence x86 gtk2 programs from /emul/ia32-linux, when trying to open /etc/gtk-2.0/gtk.immodules will first search for /emul/ia32-linux/etc/gtk-2.0/gtk.immodules.
I didn't know that. Thanks, that makes things much easier. Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (3)
-
Michael Matz
-
Michael Schroeder
-
Vincent Untz