<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div><span>i did</span></div><div><span>%prep<br>%setup -qn pcore<br></span></div><div><br><span></span></div><div><span>that is how i got make to run.</span></div><div><span><br></span></div><div>but i get :</div><div> cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file <br></div><div><br></div><div>as a result of :</div><div>%install<br></div><div>cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/</div><div><br></div><div>What i want to know id that ( as far as i think )&nbsp;</div><div>that %install <br></div><div>happens in a chroot</div><div>and if i give the correct folder, the copy should happen ?</div><div>plus i WANT to copy the binary executable in /usr/bin</div><div>not sure HOW to do that</div><div><br></div><div>Thanks,</div><div>-Kamal.<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> Jon Ciesla &lt;limburgher@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Kamal Ahmed &lt;kamal2222ahmed@yahoo.com&gt;; Discussion of RPM packaging standards and practices for Fedora &lt;packaging@lists.fedoraproject.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, April 12, 2012 3:48 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Fedora-packaging] Cannot cd to %{name}-%{version}<br> </font> </div> <br>
2012/4/12 Kamal Ahmed &lt;<a ymailto="mailto:kamal2222ahmed@yahoo.com" href="mailto:kamal2222ahmed@yahoo.com">kamal2222ahmed@yahoo.com</a>&gt;:<br>&gt; Jon,<br>&gt;<br>&gt; with:<br>&gt; cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/<br>&gt;<br>&gt; i get:<br>&gt;<br>&gt; + cp obj/ggsnc/ggsnc /pcore-0.1/usr/bin/<br>&gt; cp: cannot create regular file `/pcore-0.1/usr/bin/': No such file or<br>&gt; directory<br>&gt; error: Bad exit status from /var/tmp/rpm-tmp.93551 (%install)<br>&gt;<br>&gt; The problem being that even though my Version is 0.1 , but when i untar ,<br>&gt; the directory gets created is pcore and not pcore-0.1.<br>&gt; Any solution for this ?<br><br>use: %setup -qn pcore<br><br>&gt; -Kamal.<br>&gt;<br>&gt; ________________________________<br>&gt; From: Jon Ciesla &lt;<a ymailto="mailto:limburgher@gmail.com" href="mailto:limburgher@gmail.com">limburgher@gmail.com</a>&gt;<br>&gt; To: Kamal Ahmed &lt;<a ymailto="mailto:kamal2222ahmed@yahoo.com"
 href="mailto:kamal2222ahmed@yahoo.com">kamal2222ahmed@yahoo.com</a>&gt;; Discussion of RPM packaging<br>&gt; standards and practices for Fedora &lt;<a ymailto="mailto:packaging@lists.fedoraproject.org" href="mailto:packaging@lists.fedoraproject.org">packaging@lists.fedoraproject.org</a>&gt;<br>&gt; Sent: Thursday, April 12, 2012 3:01 PM<br>&gt; Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}<br>&gt;<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; i found out the directory name "pcore" but outside of&nbsp; rpm/spec<br>&gt;&gt; I wish there was a way inside the rpm , that i could find out the name of<br>&gt;&gt; the directory that got created as a result of make<br>&gt;&gt; in any case.<br>&gt;&gt;<br>&gt;&gt; now i AM able to od a make, but when trying to copy the binaries ( lets<br>&gt;&gt; say<br>&gt;&gt; one of the
 binaries "ggsnc" in /usr/bin) i get error message on permission<br>&gt;&gt;<br>&gt;&gt; ibcm_td.a ./libmt_td.a&nbsp;&nbsp; -lpthread -lnsl -lrt -o ./hnbgw<br>&gt;&gt; make[1]: Leaving directory `/home/kahmed/rpmbuild/BUILD/pcore/obj/hnbgw'<br>&gt;&gt; + exit 0<br>&gt;&gt; Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.32400<br>&gt;&gt; + umask 022<br>&gt;&gt; + cd /home/kahmed/rpmbuild/BUILD<br>&gt;&gt; + cd pcore<br>&gt;&gt; + LANG=C<br>&gt;&gt; + export LANG<br>&gt;&gt; + unset DISPLAY<br>&gt;&gt; + cp obj/ggsnc/ggsnc /usr/bin<br>&gt;&gt; cp: cannot create regular file `/usr/bin/ggsnc': Permission denied<br>&gt;&gt; error: Bad exit status from /var/tmp/rpm-tmp.32400 (%install)<br>&gt;<br>&gt; You need to copy it to the buildroot, rather than the running system,<br>&gt; so it should be:<br>&gt;<br>&gt; cp obj/ggsnc/ggsnc $RPM_BUILD_ROOT%{_bindir}/<br>&gt;<br>&gt; Or the like.<br>&gt;<br>&gt; -J<br>&gt;<br>&gt;&gt;<br>&gt;&gt; RPM build
 errors:<br>&gt;&gt; &nbsp;&nbsp;&nbsp; Bad exit status from /var/tmp/rpm-tmp.32400 (%install)<br>&gt;&gt; 1. Am i doing the right thing which is to copy the binaries ( since we do<br>&gt;&gt; NOT have a make install ) to /usr/bin<br>&gt;&gt; or this should be done in chroot<br>&gt;&gt; 2. i am copying binaries in %install section, is this ok ?<br>&gt;&gt;<br>&gt;&gt; %install<br>&gt;&gt; cp obj/ggsnc/ggsnc %{_bindir}<br>&gt;&gt;<br>&gt;&gt; Thanks,<br>&gt;&gt; -Kamal.<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; From: zxq9 &lt;<a ymailto="mailto:zxq9@zxq9.com" href="mailto:zxq9@zxq9.com">zxq9@zxq9.com</a>&gt;<br>&gt;&gt; To: <a ymailto="mailto:packaging@lists.fedoraproject.org" href="mailto:packaging@lists.fedoraproject.org">packaging@lists.fedoraproject.org</a><br>&gt;&gt; Sent: Thursday, April 12, 2012 11:00 AM<br>&gt;&gt; Subject: Re: [Fedora-packaging] Cannot cd to %{name}-%{version}<br>&gt;&gt;<br>&gt;&gt;&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;&gt;&gt;<br>&gt;&gt;&gt;&gt; %prep<br>&gt;&gt;&gt;&gt; mkdir %{name}-%{version}<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;Find out what the directory is really called after extraction, i.e.<br>&gt;&gt;&gt;foo-somethingelse and change<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; %setup -q<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;to<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;%setup -qn foo-somethingelse<br>&gt;&gt;<br>&gt;&gt; Whatever the extraction directory is gets removed prior to the build to<br>&gt;&gt; keep<br>&gt;&gt; the space clean. So what he's saying is that your problem (isolated below)<br>&gt;&gt; will stop happening if you name the build one something else.<br>&gt;&gt;<br>&gt;&gt;&gt;&gt; rpmbuild -bb pcore.spec<br>&gt;&gt;<br>&gt;&gt; Everything is fine here...<br>&gt;&gt;<br>&gt;&gt;&gt;&gt; Executing(%prep): /bin/sh -e
 /var/tmp/rpm-tmp.66518<br>&gt;&gt;&gt;&gt; + umask 022<br>&gt;&gt;&gt;&gt; + cd /home/kahmed/rpmbuild/BUILD<br>&gt;&gt;&gt;&gt; + LANG=C<br>&gt;&gt;&gt;&gt; + export LANG<br>&gt;&gt;&gt;&gt; + unset DISPLAY<br>&gt;&gt;&gt;&gt; + mkdir pcore-0.1<br>&gt;&gt;<br>&gt;&gt; And here the working directory is made based on the default extraction<br>&gt;&gt; directory (that is, {% name %}-{% version %}).<br>&gt;&gt;<br>&gt;&gt;&gt;&gt; + cd /home/kahmed/rpmbuild/BUILD<br>&gt;&gt;&gt;&gt; + rm -rf pcore-0.1<br>&gt;&gt;<br>&gt;&gt; And here it gets removed! So you need to name the one you really want to<br>&gt;&gt; use<br>&gt;&gt; something different, which is what Jon is saying about "setup -qn<br>&gt;&gt; something-else".<br>&gt;&gt;<br>&gt;&gt;&gt;&gt; + /bin/gzip -dc /home/kahmed/rpmbuild/SOURCES/pcore-0.1.tar.gz<br>&gt;&gt;&gt;&gt; + tar -xf -<br>&gt;&gt;&gt;&gt; + STATUS=0<br>&gt;&gt;&gt;&gt; + '[' 0 -ne 0 ']'<br>&gt;&gt;&gt;&gt; + cd
 pcore-0.1<br>&gt;&gt;<br>&gt;&gt; And of course this step doesn't work because pcore-0.1 has already been<br>&gt;&gt; "rm -rf"d<br>&gt;&gt;<br>&gt;&gt;&gt;&gt; /var/tmp/rpm-tmp.66518: line 37: cd: pcore-0.1: No such file or<br>&gt;&gt;&gt;&gt; directory<br>&gt;&gt;<br>&gt;&gt; Hope this makes more sense now. Packaging is a little mysterious until you<br>&gt;&gt; play with it a bit on your own. And once you do, you'll find that Fedora<br>&gt;&gt; has the best all-around guidelines for it, all told. They are strict and a<br>&gt;&gt; little difficult to understand "why" at first, but there is a *lot* of<br>&gt;&gt; experience expressed in the packaging guidelines, tutorials, rpm itself<br>&gt;&gt; and<br>&gt;&gt; this list (most of the time...).<br>&gt;&gt; --<br>&gt;&gt; packaging mailing list<br>&gt;&gt; <a ymailto="mailto:packaging@lists.fedoraproject.org" href="mailto:packaging@lists.fedoraproject.org">packaging@lists.fedoraproject.org</a><br>&gt;&gt;
 <a href="https://admin.fedoraproject.org/mailman/listinfo/packaging" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/packaging</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt; packaging mailing list<br>&gt;&gt; <a ymailto="mailto:packaging@lists.fedoraproject.org" href="mailto:packaging@lists.fedoraproject.org">packaging@lists.fedoraproject.org</a><br>&gt;&gt; <a href="https://admin.fedoraproject.org/mailman/listinfo/packaging" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/packaging</a><br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; in your fear, seek only peace<br>&gt; in your fear, seek only love<br>&gt;<br>&gt; -d. bowie<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; packaging mailing list<br>&gt; <a ymailto="mailto:packaging@lists.fedoraproject.org" href="mailto:packaging@lists.fedoraproject.org">packaging@lists.fedoraproject.org</a><br>&gt; <a href="https://admin.fedoraproject.org/mailman/listinfo/packaging"
 target="_blank">https://admin.fedoraproject.org/mailman/listinfo/packaging</a><br><br><br><br>-- <br>in your fear, seek only peace<br>in your fear, seek only love<br><br>-d. bowie<br><br><br> </div> </div> </blockquote></div>   </div></body></html>