python dependency for packages

Warren Togami wtogami at redhat.com
Fri May 21 02:19:50 UTC 2004


The below is an example of an explicit python dependency to 
automatically Require a compatible version of python at build time, from 
fedora.us python-bsddb for FC1.  Any opinions if this is a good solution 
in general for packages that require python?

<warren> %define pyver %(python -c 'import sys ; print sys.version[:3]')
<warren> %define pynext %(python -c 'print %{pyver} + 0.1')
<warren> Requires:       python >= 0:%{pyver}, python < 0:%{pynext}
<warren> any idea why the < part?
<mschwendt> because it is expected to conflict with next version of python
<mschwendt> ehm, be incompatible, not conflict
<warren> why not python = %{pyver} then?
<mschwendt> because of minor python versions between %pyver and %pynext
<warren> are we talking Version changes?
<warren> 2.3.1 to 2.3.2?
<mschwendt> yes
<warren> And there's no python command that can display the major.minor 
of the current python instead?
<warren> [warren at ibmlaptop warren]$ python -c 'import sys ; print 
sys.version[:3]'
<warren> 2.3
<mschwendt> compare that with rpm -q --provides python
<mschwendt> e.g. python = 2.2.3-7
<warren> mschwendt, your explicit dependency is missing the trailing 
-%{release}, then it compares only the %{version}
<mschwendt> the package requires python version X, with:  2.2 <= X < 2.3
<warren> argh... okay I understand now.

John Dennis wrote:
> Update of /cvs/pkgs/rpms/mailman
> 
> Modified Files:
> 	mailman.spec 
> Log Message:
> make python prereq be at least 2.3
> 
> 
> 
> Index: mailman.spec
> ===================================================================
> RCS file: /cvs/pkgs/rpms/mailman/mailman.spec,v
> retrieving revision 1.29
> retrieving revision 1.30
> diff -u -r1.29 -r1.30
> --- mailman.spec	19 May 2004 01:25:22 -0000	1.29
> +++ mailman.spec	20 May 2004 17:51:51 -0000	1.30
> @@ -40,7 +40,7 @@
>  Summary: Mailing list manager with built in Web access.
>  Name: mailman
>  Version: 2.1.5
> -Release: 2
> +Release: 3
>  Epoch: 3
>  Group: Applications/Internet
>  Source0: ftp://ftp.gnu.org/pub/gnu/mailman/mailman-%{version}.tgz
> @@ -57,8 +57,8 @@
>  URL: http://www.list.org/
>  BuildRoot: %{_tmppath}/%{name}-root
>  Prereq: shadow-utils, /usr/bin/newaliases, /usr/bin/crontab, /sbin/chkconfig, /sbin/service
> -Requires: webserver, python >= 2.2.1, mktemp
> -BuildPrereq: python-devel >= 2.2.1
> +Requires: webserver, python >= 2.3, mktemp
> +BuildPrereq: python-devel >= 2.3
>  
>  %description 
>  Mailman is software to help manage email discussion lists, much like
> @@ -304,6 +304,9 @@
>  %attr(0755 root root) /etc/rc.d/init.d/mailman
>  
>  %changelog
> +* Thu May 20 2004 John Dennis <jdennis at redhat.com> 3:2.1.5-3
> +- make python prereq be at least 2.3
> +
>  * Tue May 18 2004 Jeremy Katz <katzj at redhat.com> 3:2.1.5-2
>  - rebuild 
>  
> 





More information about the devel mailing list