summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/2013-January/021293.html
blob: 80025df5ef0a0beb1abebaf49d5543505df8c677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Mageia-dev] Help with package
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20Help%20with%20package&In-Reply-To=%3C50EBEBB7.4010401%40colin.guthr.ie%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="021275.html">
   <LINK REL="Next"  HREF="021134.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Mageia-dev] Help with package</H1>
    <B>Colin Guthrie</B> 
    <A HREF="mailto:mageia-dev%40mageia.org?Subject=Re%3A%20%5BMageia-dev%5D%20Help%20with%20package&In-Reply-To=%3C50EBEBB7.4010401%40colin.guthr.ie%3E"
       TITLE="[Mageia-dev] Help with package">mageia at colin.guthr.ie
       </A><BR>
    <I>Tue Jan  8 10:49:43 CET 2013</I>
    <P><UL>
        <LI>Previous message: <A HREF="021275.html">[Mageia-dev] Help with package
</A></li>
        <LI>Next message: <A HREF="021134.html">[Mageia-dev] [338616] Use official tarball
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#21293">[ date ]</a>
              <a href="thread.html#21293">[ thread ]</a>
              <a href="subject.html#21293">[ subject ]</a>
              <a href="author.html#21293">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>[Friendly request: Can you try and post in plain text only, not HTML too
please]

'Twas brillig, and Juan Luis Baptiste at 07/01/13 19:32 did gyre and gimble:
&gt;<i> Hi Colin,
</I>&gt;<i> 
</I>&gt;<i> On Mon, Jan 7, 2013 at 5:53 AM, Colin Guthrie &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">mageia at colin.guthr.ie</A>
</I>&gt;<i> &lt;mailto:<A HREF="https://www.mageia.org/mailman/listinfo/mageia-dev">mageia at colin.guthr.ie</A>&gt;&gt; wrote:
</I>&gt;<i> 
</I>&gt;<i>     &gt; Well, it worked on x86_64, but  on i586 the symlinks are created under
</I>&gt;<i>     &gt; /usr/lib64/games/warsow/basewsw instead of
</I>&gt;<i>     /usr/lib/games/warsow/basewsw
</I>&gt;<i>     &gt; but I don't understand why, it seems that for some reason, the
</I>&gt;<i>     &gt; %{_libdir} macro is expanding to /usr/lib64 on the BS. This is the
</I>&gt;<i>     spec
</I>&gt;<i>     &gt; if someone wants to take a look:
</I>&gt;<i>     &gt;
</I>&gt;<i>     &gt;
</I>&gt;<i>     <A HREF="http://svnweb.mageia.org/packages/cauldron/warsow-data/current/SPECS/warsow-data.spec?revision=338836&amp;view=markup">http://svnweb.mageia.org/packages/cauldron/warsow-data/current/SPECS/warsow-data.spec?revision=338836&amp;view=markup</A>
</I>&gt;<i> 
</I>&gt;<i>     %_libdir expands to the given architecture's libdir. On i586 it's
</I>&gt;<i>     /usr/lib, on x86_64 it's /usr/lib64.
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> I know, that's why it's strange to me why when the package is built on
</I>&gt;<i> the BS the links end up on /usr/lib64 on the i586 package.
</I>
There is no &quot;i586&quot; package here, as the spec is noarch. There is only
one build and it's arch independent. I'll explain more below.

&gt;<i>     Looking at the spec, I think you're doing it a bit wrong.
</I>&gt;<i> 
</I>&gt;<i>     It's in the %post for a start which is wrong. It should be done as part
</I>&gt;<i>     of package build, not install. Doing it during install will mean the
</I>&gt;<i>     files are not &quot;owned&quot; by the package so users cannot tell where they
</I>&gt;<i>     come from.
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> Well, that was just a suggestion from someone on this thread and it
</I>&gt;<i> looked to me like the right place too. On this particular case what I'm
</I>&gt;<i> doing here is not installing some files but creating some symlinks that
</I>&gt;<i> the other warsow package needs. 
</I>
Hmm, I didn't see any other replies on the thread - must be broken
threading on my mail client :s

So are the symlinks intended to link files from other packages here too?
This seems wrong if so.


&gt;<i>     Also as you use %_libdir, your package cannot be noarch.
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> The &quot;warsow-data&quot; package contains the data files of the game which are
</I>&gt;<i> arch independent. The &quot;warsow&quot; package contains all the binaries and
</I>&gt;<i> libs, but to be able to run the game, the binary expects to find the
</I>&gt;<i> data files on the same directory where the libs are, if not then the
</I>&gt;<i> angelscript module will fail loading. So, what I'm trying to accomplish
</I>&gt;<i> is that when warsow-data is installed, symlinks of the files in the data
</I>&gt;<i> directory (/usr/share/warsow/basewsw/*) are created on
</I>&gt;<i> /usr/lib{64}/games/warsow/basewsw/. It works on x86_64 but on i586 is
</I>&gt;<i> creating the links on lib64 instead of lib and I don't get why, you saw
</I>&gt;<i> the code in the spec, I'm not hardcoding any path on it:
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> %define gamelibdir%{_libdir}/games/warsow
</I>
                    ^^^^^^^^^^

You hard code it right there. You cannot use _libdir in a noarch
package. _libdir depends on the arch used when building. It's
fundamentally incompatible with a noarch package.

Remember macros are expanded at build time. So if your &quot;noarch&quot; package
is build on a 64bit build node, _libdir will be /usr/lib64, but if it
happens to be built by an i586 build node, then it'll be /usr/lib. You
simply cannot use the _libdir macro in a noarch package.

Either you have to use some other form of detection of /usr/lib vs.
/usr/lib64 that will work at %post time (e.g. running uname -m) and then
use the right path (hard coded for each arch) accordingly. That way you
can keep your package noarch.

That said, even the above suggestion will not actually work as you use
your gamelibdir definition in actual files included in the package
itself (in the %files section). Of course this looks like an empty
directory only included so you can add symlinks to it later so it should
be able to be refactored.

&gt;<i> %post
</I>&gt;<i> #Add symbolic links of the contents of basewsw to the directory were the
</I>&gt;<i> #package warsow install the libs, if not then angelscript fails to load.
</I>&gt;<i> for i in %{_datadir}/warsow/basewsw/*;
</I>&gt;<i> do
</I>&gt;<i>   file=`basename $i`
</I>&gt;<i>   ln -sf $i  %{gamelibdir}/basewsw/$file
</I>&gt;<i> done
</I>&gt;<i> 
</I>&gt;<i> %postun
</I>&gt;<i> rm -rf %{gamelibdir}/basewsw
</I>&gt;<i>  
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i>     If you want to use /usr/lib all the time then do so (if that's what the
</I>&gt;<i>     game binary expects) via %{_prefix}/lib not via %_libdir.
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> 
</I>&gt;<i> That's not the case, as explained before, the symlinks have to be
</I>&gt;<i> created at /usr/lib for i586 and at /usr/lib64 for x86_64, but on i586
</I>&gt;<i> for some reason isn't doing it.
</I>
OK, so the fundamental issue you're encountering is trying to do this
from a noarch package! You cannot know about different architectures
automatically in a noarch package.

I understand the principle of keeping arch-independent data in a noarch
package, but you cannot mix arch-specific and arch-independent here!



So here is my recommendation:

Either:

a. Make it arch-specific and do the symlinking in %install.

or

b. Kill off gamelibdir in the warsow-data spec. Don't include the folder
or the symlinks there. Also do not ship the folder %gamelibdir/basewsw
in the main warsow package (it's just empty folder as far as I can
tell). Instead just ship a symlink to %{_datadir}/warsow/basewsw as
%gamelibdir/basesw in the warsow package. In order to not have a broken
symlink I'd also suggest you ship the empty folder
%{_datadir}/warsow/basewsw in the main warsow package too. Then when you
ship your data files in the warsow-data files, the main package will
fine them via the single directory symlink. Nothing more needs done, no
complex individual symlinks.



I'd vote for option b. It should work fine from what I can tell,
although I've not looked super thoroughly so there may be some caveat as
to why this will not work.

Col



-- 

Colin Guthrie
colin(at)mageia.org
<A HREF="http://colin.guthr.ie/">http://colin.guthr.ie/</A>

Day Job:
  Tribalogic Limited <A HREF="http://www.tribalogic.net/">http://www.tribalogic.net/</A>
Open Source:
  Mageia Contributor <A HREF="http://www.mageia.org/">http://www.mageia.org/</A>
  PulseAudio Hacker <A HREF="http://www.pulseaudio.org/">http://www.pulseaudio.org/</A>
  Trac Hacker <A HREF="http://trac.edgewall.org/">http://trac.edgewall.org/</A>
</PRE>











<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="021275.html">[Mageia-dev] Help with package
</A></li>
	<LI>Next message: <A HREF="021134.html">[Mageia-dev] [338616] Use official tarball
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#21293">[ date ]</a>
              <a href="thread.html#21293">[ thread ]</a>
              <a href="subject.html#21293">[ subject ]</a>
              <a href="author.html#21293">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-dev">More information about the Mageia-dev
mailing list</a><br>
</body></html>