<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div><span>i found out the directory name "pcore" but outside of&nbsp; rpm/spec</span></div><div><span>I wish there was a way inside the rpm , that i could find out the name of the directory that got created as a result of make</span></div><div><span>in any case. <br></span></div><div><br><span></span></div><div><span>now i AM able to od a make, but when trying to copy the binaries ( lets say one of the binaries "ggsnc" in /usr/bin) i get error message on permission</span></div><div><br><span></span></div><div><span>ibcm_td.a ./libmt_td.a&nbsp;&nbsp; -lpthread -lnsl -lrt -o ./hnbgw<br>make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'<br>+ exit 0<br>Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400<br>+ umask 022<br>+ cd /home/kahmed/rpmbuild/BUILD<br>+ cd pcore<br>+ LANG=C<br>+ export LANG<br>+ unset
 DISPLAY<br>+ cp obj/ggsnc/ggsnc /usr/bin<br>cp: cannot create regular file `/usr/bin/ggsnc': Permission denied<br>error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)<br><br><br>RPM build errors:<br>&nbsp;&nbsp;&nbsp; Bad exit status from /var/tmp/rpm-tmp.32400 (%install)<br></span></div><div><span>1. Am i doing the right thing which is to copy the binaries ( since we do NOT have a make install ) to /usr/bin</span></div><div><span>or this should be done in chroot <br></span></div><div><span>2. i am copying binaries in %install section, is this ok ?</span></div><div><br><span></span></div><div><span>%install<br>cp obj/ggsnc/ggsnc %{_bindir}<br></span></div><div><br><span></span></div><div><span>Thanks,</span></div><div><span>-Kamal.<br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: verdana, helvetica, sans-serif; font-size:
 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> zxq9 &lt;zxq9@zxq9.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> packaging@lists.fedoraproject.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, April 12, 2012 11:00 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Fedora-packaging] Cannot cd to %{name}-%{version}<br> </font> </div> <br>
&gt;2012/4/12 Kamal Ahmed &lt;<a ymailto="mailto:kamal2222ahmed@yahoo.com" href="mailto:kamal2222ahmed@yahoo.com">kamal2222ahmed@yahoo.com</a>&gt;:<br>&gt;&gt;<br>&gt;&gt; %prep<br>&gt;&gt; mkdir %{name}-%{version}<br>&gt;<br>&gt;Find out what the directory is really called after extraction, i.e.<br>&gt;foo-somethingelse and change<br>&gt;<br>&gt;&gt; %setup -q<br>&gt;<br>&gt;to<br>&gt;<br>&gt;%setup -qn foo-somethingelse<br><br>Whatever the extraction directory is gets removed prior to the build to keep<br>the space clean. So what he's saying is that your problem (isolated below)<br>will stop happening if you name the build one something else.<br><br>&gt;&gt; rpmbuild -bb pcore.spec<br><br>Everything is fine here...<br><br>&gt;&gt; Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.66518<br>&gt;&gt; + umask 022<br>&gt;&gt; + cd /home/kahmed/rpmbuild/BUILD<br>&gt;&gt; + LANG=C<br>&gt;&gt; + export LANG<br>&gt;&gt; + unset DISPLAY<br>&gt;&gt; + mkdir
 pcore-0.1<br><br>And here the working directory is made based on the default extraction<br>directory (that is, {% name %}-{% version %}).<br><br>&gt;&gt; + cd /home/kahmed/rpmbuild/BUILD<br>&gt;&gt; + rm -rf pcore-0.1<br><br>And here it gets removed! So you need to name the one you really want to use<br>something different, which is what Jon is saying about "setup -qn something-else".<br><br>&gt;&gt; + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz<br>&gt;&gt; + tar -xf -<br>&gt;&gt; + STATUS=0<br>&gt;&gt; + '[' 0 -ne 0 ']'<br>&gt;&gt; + cd pcore-0.1<br><br>And of course this step doesn't work because pcore-0.1 has already been<br>"rm -rf"d<br><br>&gt;&gt; /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or directory<br><br>Hope this makes more sense now. Packaging is a little mysterious until you<br>play with it a bit on your own. And once you do, you'll find that Fedora<br>has the best all-around guidelines for it, all told.
 They are strict and a<br>little difficult to understand "why" at first, but there is a *lot* of<br>experience expressed in the packaging guidelines, tutorials, rpm itself and<br>this list (most of the time...).<br>--<br>packaging mailing list<br><a ymailto="mailto:packaging@lists.fedoraproject.org" href="mailto:packaging@lists.fedoraproject.org">packaging@lists.fedoraproject.org</a><br><a href="https://admin.fedoraproject.org/mailman/listinfo/packaging" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/packaging</a><br><br> </div> </div> </blockquote></div>   </div></body></html>