<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px"><div id="yui_3_16_0_1_1424608636414_38699">Hi Tim,</div><div id="yui_3_16_0_1_1424608636414_38356"><br></div><div id="yui_3_16_0_1_1424608636414_38357" dir="ltr">Thank you very much for extensive explanation.</div><div id="yui_3_16_0_1_1424608636414_38358" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_38359" dir="ltr">I did run rpm -bi myspec.spec and at the end of the installation noticed find-requires script <br></div><div id="yui_3_16_0_1_1424608636414_44350" dir="ltr">requires /usr/local/bin/python. <br></div><div id="yui_3_16_0_1_1424608636414_40381" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_40587" dir="ltr">Finding  Provides: (using /opt/freeware/lib/rpm/find-provides)...<br style="" class="">Finding  Requires: (using /opt/freeware/lib/rpm/find-requires)...<br style="" class="">Provides:  ******<br style="" class="">Requires: /bin/sh /usr/bin/env <font id="yui_3_16_0_1_1424608636414_41663" color="#cd232c">/usr/local/bin/python</font> /usr/local/bin/python3.4 ******<br style="" class=""></div><div id="yui_3_16_0_1_1424608636414_40590" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_41120" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_41121" dir="ltr">Then ran the find command you provided through root directory and found cgi.py file contain that line</div><div id="yui_3_16_0_1_1424608636414_42066" dir="ltr">and still not sure why this module which is for version 2.6 is being built.</div><div id="yui_3_16_0_1_1424608636414_41123" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_41124" dir="ltr">#! /usr/local/bin/python<br style="" class=""><br style="" class=""># NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is<br style="" class=""># intentionally NOT "/usr/bin/env python".  On many systems<br style="" class=""># (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI<br style="" class=""># scripts, and /usr/local/bin is the default directory where Python is<br style="" class=""># installed, so /usr/bin/env would be unable to find python.  Granted,<br style="" class=""># binary installations by Linux vendors often install Python in<br style="" class=""># /usr/bin.  So let those vendors patch cgi.py to match their choice<br style="" class=""># of installation.<br style="" class=""></div><div id="yui_3_16_0_1_1424608636414_41125" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_41126" dir="ltr">editted cgi.py and then tried building the RPM, but the cgi.py file is being recreated even</div><div id="yui_3_16_0_1_1424608636414_42067" dir="ltr">by using rpm --short-circuit -bb myspec.spec.</div><div id="yui_3_16_0_1_1424608636414_42340" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_43124" dir="ltr">I have checked the myspec.spec file and I am not deleting the root directory on spec file</div><div id="yui_3_16_0_1_1424608636414_42341" dir="ltr">so the only explanation that I can find is rpm --short-circuit -bb myspec.spec is still running the install</div><div id="yui_3_16_0_1_1424608636414_45955" dir="ltr">section even though I specified the --short-circut.</div><div id="yui_3_16_0_1_1424608636414_45282" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_45956" dir="ltr"> how can I prevent the installation when I am building the package ?</div><div id="yui_3_16_0_1_1424608636414_45957" dir="ltr">I thought --short-circuit should do that.<br></div><div id="yui_3_16_0_1_1424608636414_44946" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_43126" dir="ltr">Thanks for all your help.</div><div id="yui_3_16_0_1_1424608636414_42682" dir="ltr"><br></div><div dir="ltr">while I was reading  find-requires file, noticed the find-requires originally is written by you. </div><div id="yui_3_16_0_1_1424608636414_38360" dir="ltr"><br></div><div id="yui_3_16_0_1_1424608636414_38361"><span id="yui_3_16_0_1_1424608636414_43194"># Original Author: Ralph Goers(rgoer@Candle.Com)<br style="" class=""># Borrowed heavily from Tim Mooney's HP version.<br style="" class=""># This file is distributed under the terms of the GNU General Public License</span></div><div id="yui_3_16_0_1_1424608636414_43403"><span id="yui_3_16_0_1_1424608636414_43194"></span></div><br>  <div id="yui_3_16_0_1_1424608636414_38365" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12px;"> <div id="yui_3_16_0_1_1424608636414_38364" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div id="yui_3_16_0_1_1424608636414_38363" dir="ltr"> <hr id="yui_3_16_0_1_1424608636414_41127" size="1">  <font id="yui_3_16_0_1_1424608636414_38362" size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Tim Mooney <Tim.Mooney@ndsu.edu><br> <b><span style="font-weight: bold;">To:</span></b> Blaxton <blaxxton@yahoo.com>; General discussion about the RPM package manager <rpm-list@lists.rpm.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, February 20, 2015 10:39 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: Building my first RPM<br> </font> </div> <div id="yui_3_16_0_1_1424608636414_38366" class="y_msg_container"><br>In regard to: Re: Building my first RPM, Blaxton said (at 12:53pm on Feb...:<br clear="none"><br clear="none">> How may find which script has this line #!/usr/local/bin/python ?<br clear="none"><br clear="none">It's one of the files that are getting copied into your build root, so<br clear="none">instead of doing a full package build (rpmbuild -ba yourspec.spec)<br clear="none">run the process through the install step (rpmbuild -bi yourspec.spec)<br clear="none">and then use UNIX tools to find which scripts reference the incorrect<br clear="none">path, e.g.<br clear="none"><br clear="none">     find /your/RPM/BUILD/ROOT -type f \<br clear="none">         -exec egrep '#!/usr/local/bin/python' {} /dev/null \;<br clear="none"><br clear="none">When you build a package, RPM searches the files in your build root, using<br clear="none">various methods depending on platform, to find what dependencies those<br clear="none">files have.  To control what gets recorded in the binary RPM, you need<br clear="none">to control what's discovered for dependencies during the build process.<br clear="none"><br clear="none">One trick that's often used: files that are really meant as documentation<br clear="none">or *examples* shouldn't have the execute bit set on them; if they're<br clear="none">not executable, the script that checks for the sh-bang (#!) header<br clear="none">in a script will ignore them.  So having your %install do something like<br clear="none"><br clear="none">     find $RPM_BUILD_ROOT/usr/local/share/python \<br clear="none">         -type f -name '*.py' -exec chmod a-x {} \;<br clear="none"><br clear="none">(or any other directory that has docs/examples that are being found and<br clear="none">included by the dependency generator) is common when packaging<br clear="none">interpreters.  Packaging interpreters (python, perl, ruby, etc.) often<br clear="none">has this type of issue.<br clear="none"><br clear="none">>Where or which script checks dependencies when we install RPM and how to<br clear="none">> retrieve it ?<br clear="none"><br clear="none">That depends on platform and version of RPM, as well as what RPM macros<br clear="none">are set in your build environment, but way back in previous century, I<br clear="none">had a hand in the find-provides and find-requires that were used on AIX. <br clear="none">Wherever RPM has its "lib" directory, there's probably a file named<br clear="none">"find-requires" or "find-requires.sh", and that's likely what's getting<br clear="none">called to search the buildroot for dependencies.<br clear="none"><br clear="none">Also, note that find-requires and find-provides are run when you *build*<br clear="none">the RPM.  Their output is then encoded in the binary package, and it's<br clear="none">RPM itself that checks as part of the install process to see that<br clear="none">everything that the package claims it needs is present.  And before you<br clear="none">ask: it doesn't check the filesystem -- it checks its database<br clear="none">(primarily), and it probably also checks files in its personal config<br clear="none">directory (/etc/rpm or its equivalent for your build).<br clear="none"><br clear="none">Tim<div class="qtdSeparateBR"><br><br></div><div class="yqt1340125883" id="yqtfd72363"><br clear="none"><br clear="none">>     From: Florian Festi <<a shape="rect" ymailto="mailto:ffesti@redhat.com" href="mailto:ffesti@redhat.com">ffesti@redhat.com</a>><br clear="none">> To: <a shape="rect" ymailto="mailto:rpm-list@lists.rpm.org" href="mailto:rpm-list@lists.rpm.org">rpm-list@lists.rpm.org</a><br clear="none">> Sent: Friday, February 20, 2015 2:04 AM<br clear="none">> Subject: Re: Building my first RPM<br clear="none">><br clear="none">> On 02/20/2015 05:49 AM, Blaxton wrote:<br clear="none">>> I am trying to build Python RPM and trying to keep .spec file as simple<br clear="none">>> as I can.<br clear="none">>><br clear="none">>> build, compile, install and package is completed and now I have the<br clear="none">>> binary RPM<br clear="none">>> to install, but getting below error at the time of installation:<br clear="none">>><br clear="none">>> error: failed dependencies:<br clear="none">>>         /usr/local/bin/python is needed by Python-3.4.2-1<br clear="none">>><br clear="none">>> any idea what I am doing wrong ?<br clear="none">><br clear="none">> There is probably a script somewhere having a #!/usr/local/bin/python<br clear="none">> line. Either include a symlink link /usr/local/bin/python -> python3<br clear="none">> (which may break other packages you might build later and expect Python<br clear="none">> 2) or change the #! line.<br clear="none">><br clear="none">> As you are kinda building your own distribution you kinda can decide on<br clear="none">> your own what /usr/local/bin/python should mean. But a lot of other<br clear="none">> distros are still on Python2 as default and the plain "python" binary is<br clear="none">> Python 2.<br clear="none">><br clear="none">><br clear="none">><br clear="none">>> Do I need to have python 2 ? to have python 3 installed ?<br clear="none">>> or I am missing some thing in .spec file ?<br clear="none">>><br clear="none">>> For now I am packaging what ever it is in buildroot directory.<br clear="none">>><br clear="none">>> make DESTDIR=${RPM_BUILD_ROOT} install<br clear="none">>><br clear="none">>><br clear="none">>> %files<br clear="none">>> %defattr(-,root,system,-)<br clear="none">>> /usr/local/bin/*<br clear="none">>> /usr/local/lib/*<br clear="none">>> /usr/local/share/*<br clear="none">>> /usr/local/include/*<br clear="none">>><br clear="none">>> thanks<br clear="none">>><br clear="none">>><br clear="none">>><br clear="none">>><br clear="none">>> _______________________________________________<br clear="none">>> Rpm-list mailing list<br clear="none">>> <a id="yui_3_16_0_1_1424608636414_43744" shape="rect" ymailto="mailto:Rpm-list@lists.rpm.org" href="mailto:Rpm-list@lists.rpm.org">Rpm-list@lists.rpm.org</a><br clear="none">>> <a id="yui_3_16_0_1_1424608636414_43745" shape="rect" href="http://lists.rpm.org/mailman/listinfo/rpm-list" target="_blank">http://lists.rpm.org/mailman/listinfo/rpm-list</a></div><br clear="none">>><br clear="none">><br clear="none">><br clear="none">><br clear="none"><br clear="none">-- <br clear="none">Tim Mooney                                             <a shape="rect" ymailto="mailto:Tim.Mooney@ndsu.edu" href="mailto:Tim.Mooney@ndsu.edu">Tim.Mooney@ndsu.edu</a><br clear="none">Enterprise Computing & Infrastructure                  701-231-1076 (Voice)<br clear="none">Room 242-J6, Quentin Burdick Building                  701-231-8541 (Fax)<br clear="none">North Dakota State University, Fargo, ND 58105-5164<br><br></div> </div> </div>  </div></body></html>