<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_1424705327364_5080" dir="ltr"><span>I ended up disabling dependencies auto discovery or find-requires and included dependencies manually.</span></div><div id="yui_3_16_0_1_1424705327364_5080" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1424705327364_5080" dir="ltr"><span id="yui_3_16_0_1_1424705327364_5780">It seems --short-circuit is only for rpm -bi or rpm -bc and not applied to rpm -bb or rpm -ba.</span></div><div id="yui_3_16_0_1_1424705327364_5080" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1424705327364_5080" dir="ltr"><span id="yui_3_16_0_1_1424705327364_5779">I should check why the find-requires is adding /usr/local/bin/python to dependencies.</span></div><div id="yui_3_16_0_1_1424705327364_5080" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1424705327364_5080" dir="ltr"><span>Thanks</span></div><br>  <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12px;" id="yui_3_16_0_1_1424705327364_5083"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1424705327364_5082"> <div dir="ltr" id="yui_3_16_0_1_1424705327364_5081"> <hr size="1">  <font size="2" face="Arial" id="yui_3_16_0_1_1424705327364_5084"> <b><span style="font-weight:bold;">From:</span></b> Blaxton <blaxxton@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> Tim Mooney <Tim.Mooney@ndsu.edu>; General discussion about the RPM package manager <rpm-list@lists.rpm.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, February 22, 2015 9:24 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: Building my first RPM<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1424705327364_5136"><br><div id="yiv5853850135"><div id="yui_3_16_0_1_1424705327364_5138"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px;" id="yui_3_16_0_1_1424705327364_5137"><div id="yiv5853850135yui_3_16_0_1_1424608636414_38699">Hi Tim,</div><div id="yiv5853850135yui_3_16_0_1_1424608636414_38356"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_38357">Thank you very much for extensive explanation.</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_38358"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_38359">I did run rpm -bi myspec.spec and at the end of the installation noticed find-requires script <br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_44350">requires /usr/local/bin/python. <br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_40381"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_40587">Finding  Provides: (using /opt/freeware/lib/rpm/find-provides)...<br clear="none" class="yiv5853850135" style="">Finding  Requires: (using /opt/freeware/lib/rpm/find-requires)...<br clear="none" class="yiv5853850135" style="">Provides:  ******<br clear="none" class="yiv5853850135" style="">Requires: /bin/sh /usr/bin/env <font id="yiv5853850135yui_3_16_0_1_1424608636414_41663" color="#cd232c">/usr/local/bin/python</font> /usr/local/bin/python3.4 ******<br clear="none" class="yiv5853850135" style=""></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_40590"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_41120"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_41121">Then ran the find command you provided through root directory and found cgi.py file contain that line</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_42066">and still not sure why this module which is for version 2.6 is being built.</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_41123"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_41124">#! /usr/local/bin/python<br clear="none" class="yiv5853850135" style=""><br clear="none" class="yiv5853850135" style=""># NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is<br clear="none" class="yiv5853850135" style=""># intentionally NOT "/usr/bin/env python".  On many systems<br clear="none" class="yiv5853850135" style=""># (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI<br clear="none" class="yiv5853850135" style=""># scripts, and /usr/local/bin is the default directory where Python is<br clear="none" class="yiv5853850135" style=""># installed, so /usr/bin/env would be unable to find python.  Granted,<br clear="none" class="yiv5853850135" style=""># binary installations by Linux vendors often install Python in<br clear="none" class="yiv5853850135" style=""># /usr/bin.  So let those vendors patch cgi.py to match their choice<br clear="none" class="yiv5853850135" style=""># of installation.<br clear="none" class="yiv5853850135" style=""></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_41125"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_41126">editted cgi.py and then tried building the RPM, but the cgi.py file is being recreated even</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_42067">by using rpm --short-circuit -bb myspec.spec.</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_42340"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_43124">I have checked the myspec.spec file and I am not deleting the root directory on spec file</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_42341">so the only explanation that I can find is rpm --short-circuit -bb myspec.spec is still running the install</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_45955">section even though I specified the --short-circut.</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_45282"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_45956"> how can I prevent the installation when I am building the package ?</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_45957">I thought --short-circuit should do that.<br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_44946"><br clear="none"></div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_43126">Thanks for all your help.</div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_42682"><br clear="none"></div><div dir="ltr">while I was reading  find-requires file, noticed the find-requires originally is written by you. </div><div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_38360"><br clear="none"></div><div id="yiv5853850135yui_3_16_0_1_1424608636414_38361"><span id="yiv5853850135yui_3_16_0_1_1424608636414_43194"># Original Author: Ralph Goers(rgoer@Candle.Com)<br clear="none" class="yiv5853850135" style=""># Borrowed heavily from Tim Mooney's HP version.<br clear="none" class="yiv5853850135" style=""># This file is distributed under the terms of the GNU General Public License</span></div><div id="yiv5853850135yui_3_16_0_1_1424608636414_43403"><span id="yiv5853850135yui_3_16_0_1_1424608636414_43194"></span></div><br clear="none">  <div class="qtdSeparateBR"><br><br></div><div class="yiv5853850135yqt7533932206" id="yiv5853850135yqt88223"><div id="yiv5853850135yui_3_16_0_1_1424608636414_38365" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px;"> <div id="yiv5853850135yui_3_16_0_1_1424608636414_38364" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr" id="yiv5853850135yui_3_16_0_1_1424608636414_38363"> <hr id="yiv5853850135yui_3_16_0_1_1424608636414_41127" size="1">  <font id="yiv5853850135yui_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 clear="none"> <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 clear="none"> <b><span style="font-weight:bold;">Sent:</span></b> Friday, February 20, 2015 10:39 AM<br clear="none"> <b><span style="font-weight:bold;">Subject:</span></b> Re: Building my first RPM<br clear="none"> </font> </div> <div class="yiv5853850135y_msg_container" id="yiv5853850135yui_3_16_0_1_1424608636414_38366"><br clear="none">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="yiv5853850135qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv5853850135yqt1340125883" id="yiv5853850135yqtfd72363"><br clear="none"><br clear="none">>     From: Florian Festi <<a rel="nofollow" shape="rect" ymailto="mailto:ffesti@redhat.com" target="_blank" href="mailto:ffesti@redhat.com">ffesti@redhat.com</a>><br clear="none">> To: <a rel="nofollow" shape="rect" ymailto="mailto:rpm-list@lists.rpm.org" target="_blank" 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 rel="nofollow" shape="rect" id="yiv5853850135yui_3_16_0_1_1424608636414_43744" ymailto="mailto:Rpm-list@lists.rpm.org" target="_blank" href="mailto:Rpm-list@lists.rpm.org">Rpm-list@lists.rpm.org</a><br clear="none">>> <a rel="nofollow" shape="rect" id="yiv5853850135yui_3_16_0_1_1424608636414_43745" target="_blank" href="http://lists.rpm.org/mailman/listinfo/rpm-list">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 rel="nofollow" shape="rect" ymailto="mailto:Tim.Mooney@ndsu.edu" target="_blank" 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 clear="none"><br clear="none"></div> </div> </div></div>  </div></div></div><br><br></div> </div> </div>  </div>