Discussion:
Getting rid of implicit Requires:
Tarjei Knapstad
2007-09-18 10:29:12 UTC
Permalink
Hi all,

I'm packaging some python scripts into an RPM. The first line of each
script has:

#!/usr/bin/env python

It seems like rpmbuild is adding this as an implicit requirement. My
problem is that if I build this on a box with python 2.3, the package
ends up requiring /usr/bin/python2.3. How can I get rid of this
implicitly added package requirement?

Regards,
--
Tarjei Knapstad
Jeff Johnson
2007-09-18 13:33:42 UTC
Permalink
rpm has always had problems with variant #! syntax.
In this case, the interpreter dependency is written as
Requires: /usr/bin/env
rather than as a run-time probe
Requires: executable(python)
which will be satisfied if "python" is an executable
found on PATH, just like /usr/bin/env behavior.

(Note: executable(...) is added in rpm-4.4.3 or later).

Since run-time probes in rpm are controversial, it will likely be
a few more years before the functionality is reliably
deployed.

Your best bet in the interim is patching all the scripts to have
#!/usr/bin/python

Annoying, but patching will lead to more reliable packaging.

73 de Jeff
Post by Tarjei Knapstad
Hi all,
I'm packaging some python scripts into an RPM. The first line of each
#!/usr/bin/env python
It seems like rpmbuild is adding this as an implicit requirement. My
problem is that if I build this on a box with python 2.3, the package
ends up requiring /usr/bin/python2.3. How can I get rid of this
implicitly added package requirement?
Regards,
--
Tarjei Knapstad
_______________________________________________
Rpm-list mailing list
https://www.redhat.com/mailman/listinfo/rpm-list
Murali Krishnan
2007-09-19 02:54:52 UTC
Permalink
Use the following line in SPEC File.





AutoReqProv : no



--

With Kind Regards

S. Murali Krishnan

Senior Software Engineer

Sylantro Software.

Bangalore - India.

________________________________

From: rpm-list-***@redhat.com [mailto:rpm-list-***@redhat.com]
On Behalf Of Jeff Johnson
Sent: Tuesday, September 18, 2007 7:04 PM
To: RPM Package Manager
Subject: Re: Getting rid of implicit Requires:



rpm has always had problems with variant #! syntax.



In this case, the interpreter dependency is written as

Requires: /usr/bin/env

rather than as a run-time probe

Requires: executable(python)

which will be satisfied if "python" is an executable

found on PATH, just like /usr/bin/env behavior.



(Note: executable(...) is added in rpm-4.4.3 or later).



Since run-time probes in rpm are controversial, it will likely be

a few more years before the functionality is reliably

deployed.



Your best bet in the interim is patching all the scripts to have

#!/usr/bin/python



Annoying, but patching will lead to more reliable packaging.



73 de Jeff



On 9/18/07, Tarjei Knapstad <***@gmail.com> wrote:

Hi all,

I'm packaging some python scripts into an RPM. The first line of each
script has:

#!/usr/bin/env python

It seems like rpmbuild is adding this as an implicit requirement. My
problem is that if I build this on a box with python 2.3, the package
ends up requiring /usr/bin/python2.3. How can I get rid of this
implicitly added package requirement?

Regards,
--
Tarjei Knapstad

Loading...