%define realver 2.2 %define docver 2.2 %define dirver 2.2 %define lib_name_orig libpython %define lib_major %{dirver} %define lib_name %{lib_name_orig}%{lib_major} Summary: An interpreted, interactive object-oriented programming language Name: python Version: 2.2 Release: 9mdk License: Modified CNRI Open Source License Group: Development/Python Source: Python-%{realver}.tar.bz2 Source1: html-%{docver}.tar.bz2 Source2: python-2.2-base.list.bz2 Source3: exclude.py # patch shlib creation and paths Patch1: Python-2.2-shlib.patch.bz2 URL: http://www.python.org/ Icon: python-logo.xpm Buildroot: %_tmppath/%name-%version-%release-root Conflicts: tkinter < %{version} Requires: %{lib_name} = %{version}-%{release} Requires: %{name}-base = %{version}-%{release} BuildRequires: gmp-devel tix tk tcl gdbm-devel gpm-devel ncurses-devel blt BuildRequires: readline-devel zlib-devel XFree86-devel openssl-devel emacs BuildRequires: expat-devel libtermcap-devel perl-base BuildRequires: autoconf %description Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme or Java. Python includes modules, classes, exceptions, very high level dynamic data types and dynamic typing. Python supports interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac and MFC). Programmers can write new built-in modules for Python in C or C++. Python can be used as an extension language for applications that need a programmable interface. This package contains most of the standard Python modules, as well as modules for interfacing to the Tix widget set for Tk and RPM. Note that documentation for Python is provided in the python-docs package. %package -n %{lib_name} Summary: Shared libraries for Python %{version} Group: System/Libraries PreReq: /sbin/ldconfig %description -n %{lib_name} This packages contains Python shared object library. Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme or Java. %package -n %{lib_name}-devel Summary: The libraries and header files needed for Python development Group: Development/Python Icon: python-devel-logo.xpm Requires: %{name} = %version-%release Requires: %{lib_name} = %{version}-%{release} Obsoletes: %{name}-devel Provides: %{name}-devel = %{version}-%{release} Provides: %{lib_name_orig}-devel = %{version}-%{release} %description -n %{lib_name}-devel The Python programming language's interpreter can be extended with dynamically loaded extensions and can be embedded in other programs. This package contains the header files and libraries needed to do these types of tasks. Install %{lib_name}-devel if you want to develop Python extensions. The python package will also need to be installed. You'll probably also want to install the python-docs package, which contains Python documentation. %package docs Summary: Documentation for the Python programming language Icon: python-docs-logo.xpm Requires: python = %version-%release Group: Development/Python %description docs The python-docs package contains documentation on the Python programming language and interpreter. The documentation is provided in ASCII text files and in LaTeX source files. Install the python-docs package if you'd like to use the documentation for the Python language. %package -n tkinter Summary: A graphical user interface for the Python scripting language Group: Development/Python Icon: python-tkinter-logo.xpm Requires: python = %version-%release %description -n tkinter The Tkinter (Tk interface) program is an graphical user interface for the Python scripting language. You should install the tkinter package if you'd like to use a graphical user interface for Python programming. %package base Summary: Python base files Group: Development/Python Requires: %{lib_name} = %{version}-%{release} %description base This packages contains the Python part that is used by the base packages of a Mandrake Linux distribution. %prep %setup -q -n Python-%{version} %patch1 -p1 -b .shlib autoconf mkdir html bzcat %{SOURCE1} | tar xv -C html find . -type f |xargs perl -p -i -e 's@/usr/local/bin/python@/usr/bin/python@' %build rm -f Modules/Setup.local cat > Modules/Setup.local << EOF linuxaudiodev linuxaudiodev.c EOF OPT="$RPM_OPT_FLAGS" export OPT # FL [Fri Apr 27 07:54:31 2001] # --with-pymalloc makes problem with threaded program like Zope (dixit Guido) # --with-wctype-functions makes tests fail for unicode and re MACHDEP=linux-$RPM_ARCH ./configure --prefix=/usr --with-threads --with-cycle-gc --with-cxx=g++ --without-libdb %make %{?rpmcheck:make test} %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_prefix} # set the install path echo '[install_scripts]' >setup.cfg echo 'install_dir='"${RPM_BUILD_ROOT}/usr/bin" >>setup.cfg # python is not GNU and does not know fsstd mkdir -p $RPM_BUILD_ROOT%{_mandir} %makeinstall MANDIR=$RPM_BUILD_ROOT%{_mandir} DESTDIR=%{_libdir}/python%{dirver} # Provide a libpython%{dirver}.so symlink in /usr/lib/puthon*/config, so that # the shared library could be found when -L/usr/lib/python*/config is specified (cd $RPM_BUILD_ROOT%{_libdir}/python%{dirver}/config; ln -sf ../../%{lib_name}.so .) # emacs, I use it, I want it mkdir -p $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp install -m 644 Misc/python-mode.el $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp emacs -batch -f batch-byte-compile $RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp/python-mode.el install -d $RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/emacs/site-start.d/%{name}.el (setq auto-mode-alist (cons '("\\\\.py$" . python-mode) auto-mode-alist)) (autoload 'python-mode "python-mode" "Mode for python files." t) EOF # idle mkdir -p $RPM_BUILD_ROOT%{_libdir}/python%{dirver}/site-packages cat << EOF > $RPM_BUILD_ROOT%{_bindir}/idle #!/bin/bash exec /usr/lib/python%{dirver}/site-packages/idle/idle.py EOF cp -r Tools/idle $RPM_BUILD_ROOT%{_libdir}/python%{dirver}/site-packages/ # modulator cat << EOF > $RPM_BUILD_ROOT%{_bindir}/modulator #!/bin/bash exec /usr/lib/python%{dirver}/site-packages/modulator/modulator.py EOF cp -r Tools/modulator $RPM_BUILD_ROOT%{_libdir}/python%{dirver}/site-packages/ # pynche cat << EOF > $RPM_BUILD_ROOT%{_bindir}/pynche #!/bin/bash exec /usr/lib/python%{dirver}/site-packages/pynche/pynche EOF rm -f Tools/pynche/*.pyw cp -r Tools/pynche $RPM_BUILD_ROOT%{_libdir}/python%{dirver}/site-packages/ chmod 755 $RPM_BUILD_ROOT%{_bindir}/{idle,modulator,pynche} ln -f Tools/modulator/README Tools/modulator/README.modulator ln -f Tools/pynche/README Tools/pynche/README.pynche rm -f modules-list.full for n in $RPM_BUILD_ROOT/usr/lib/python%{dirver}/*; do [ -d $n ] || echo $n done >> modules-list.full for mod in $RPM_BUILD_ROOT/usr/lib/python%{dirver}/lib-dynload/* ; do [ `basename $mod` = _tkinter.so ] || echo $mod done >> modules-list.full sed -e "s|$RPM_BUILD_ROOT||g" < modules-list.full > modules-list # menu support mkdir -p $RPM_BUILD_ROOT%{_libdir}/menu cat > $RPM_BUILD_ROOT/%{_menudir}/tkinter << EOF ?package(tkinter): needs="gnome" \ section="Applications/Development/Development environments" \ title="IDLE" \ longtitle="IDE for Python" \ command="NO_XALF %{_bindir}/idle" \ icon="development_section.png" ?package(tkinter): needs=x11 \ section="Applications/Development/Development environments" \ title="IDLE" \ longtitle="IDE for Python" \ command="%{_bindir}/idle" \ icon="development_section.png" EOF rm -f include.list main.list bzcat %{SOURCE2} > include.list cat >> modules-list << EOF %{_bindir}/python %{_mandir}/man1/python* %{_libdir}/python*/curses/* %{_libdir}/python*/distutils/* %{_libdir}/python*/encodings/* %{_libdir}/python*/lib-old/* %{_libdir}/python*/xml/* %{_libdir}/python*/compiler/* %{_libdir}/python*/email/* %{_libdir}/python*/hotshot/* %{_libdir}/python*/site-packages/README %{_libdir}/python*/plat-linux-*/* %{_datadir}/emacs/site-lisp/python-mode.el* EOF LD_LIBRARY_PATH=$RPM_BUILD_ROOT/usr/lib $RPM_BUILD_ROOT/usr/bin/python %{SOURCE3} $RPM_BUILD_ROOT include.list modules-list > main.list %clean rm -rf $RPM_BUILD_ROOT rm -f modules-list main.list %files -f main.list %defattr(-, root, root, 755) %dir %{_libdir}/python* %dir %{_libdir}/python*/lib-dynload %dir %{_libdir}/python*/site-packages %config(noreplace) %{_sysconfdir}/emacs/site-start.d/%{name}.el %files -n %{lib_name} %defattr(-,root,root) %{_libdir}/libpython*.so.0* %files -n %{lib_name}-devel %defattr(-, root, root, 755) %{_libdir}/libpython*.so %dir %{_includedir}/python* %{_includedir}/python*/* %{_libdir}/python*/config/* %{_libdir}/python*/test/* %files docs %defattr(-,root,root,755) %doc html/* %files -n tkinter %defattr(-, root, root, 755) %dir %{_libdir}/python*/lib-tk %{_libdir}/python*/lib-tk/*.py* %{_libdir}/python*/lib-dynload/_tkinter.so %{_libdir}/python*/site-packages/idle %{_libdir}/python*/site-packages/modulator %{_libdir}/python*/site-packages/pynche %{_libdir}/menu/tkinter %{_bindir}/idle %{_bindir}/pynche %{_bindir}/modulator %files base -f include.list %defattr(-, root, root, 755) %post -n %{lib_name} -p /sbin/ldconfig %postun -n %{lib_name} -p /sbin/ldconfig %post -n tkinter %update_menus %postun -n tkinter %clean_menus %changelog * Sun Feb 24 2002 Stew Benedict <sbenedict@mandrakesoft.com> 2.2-9mdk - rebuild PPC against libdb3.3 - thx Jeff * Tue Feb 12 2002 Frederic Lepied <flepied@mandrakesoft.com> 2.2-8mdk - requires explictly the lib+version+release for python-base. * Mon Feb 11 2002 Frederic Lepied <flepied@mandrakesoft.com> 2.2-7mdk - don't use %exclude - patch for path (Ralf Ahlbrin) * Thu Jan 17 2002 Frederic Lepied <flepied@mandrakesoft.com> 2.2-6mdk - split python in python and python-base to lower the size of the base packages . * Wed Jan 9 2002 Frederic Lepied <flepied@mandrakesoft.com> 2.2-5mdk - added missing subdirs. * Wed Jan 09 2002 David BAUDENS <baudens@mandrakesoft.com> 2.2-4mdk - Fix menu entry (png icon) * Thu Jan 3 2002 Frederic Lepied <flepied@mandrakesoft.com> 2.2-3mdk - bytecompile with a -d option to avoid putting the RPM_BUILD_ROOT in the byte compiled file. * Wed Jan 2 2002 Frederic Lepied <flepied@mandrakesoft.com> 2.2-2mdk - rebuild to have the right dependencies * Sun Dec 23 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.2-1mdk - 2.2 * Wed Oct 24 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.1.1-5mdk - Libification - Enhanced Patch2 thanks to a Debian patch so that a shared library is built as well. Fix linuxconf, koffice builds on IA-64. * Tue Oct 9 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.1.1-4mdk - Remove BuildRequires: libxode1-devel - Remove Requires: libtcl8.3.so libtk8.3.so for tkinter * Thu Aug 30 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.1.1-3mdk - Patch2: DSO must have PIC code. Actually, kludge the configure script if MACHDEP is set - Add BuildRequires: autoconf * Mon Aug 20 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.1.1-2mdk - updated doc (#4263). * Fri Jul 20 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.1.1-1mdk - 2.1.1 * Tue Jul 3 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.1-2mdk - rebuild for db3.2 * Fri Apr 27 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.1-1mdk - 2.1 * Wed Apr 11 2001 Frederic Crozat <fcrozat@mandrakesoft.com> 2.0-9mdk - Correct GNOME menu entry * Sun Apr 8 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.0-8mdk - added missing xml directory - added an optional make test at the end of the %build section * Fri Mar 30 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.0-6mdk - correct launching of scripts (#2802) * Tue Mar 27 2001 Frederic Lepied <flepied@mandrakesoft.com> 2.0-5mdk - added libtermcap-devel to BuildRequires. * Sat Mar 24 2001 David BAUDENS <baudens@mandrakesoft.com> 2.0-4mdk - BuildRequires: libxode1-devel - Requires: %%version-%%release and not only %%version * Mon Mar 19 2001 Pixel <pixel@mandrakesoft.com> 2.0-3mdk - fix the python.el (\\. -> \\\\.) * Fri Dec 8 2000 Frederic Lepied <flepied@mandrakesoft.com> 2.0-2mdk - added blt and expat-devel BuildRequires: * Fri Nov 17 2000 Frederic Lepied <flepied@mandrakesoft.com> 2.0-1mdk - 2.0 (95 tests OK. 12 tests skipped: test_al test_cd test_cl test_dl test_gl test_imgfile test_largefile test_linuxaudiodev test_nis test_sunaudiodev test_winreg test_winsound) - added emacs mode - html doc. * Wed Sep 27 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-12mdk - removed dependency on tkinter for python to avoid loop. * Mon Sep 11 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-11mdk - fixed some hardcoded paths (Geoffrey Lee). - removed menu entry for interpreter. * Thu Aug 10 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 1.5.2-10mdk - fixed typo %updates_menus -> %update_menus * Mon Aug 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-9mdk - automatically added BuildRequires * Thu Aug 3 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.5.2-8mdk - Merge rh patch. - Macros. - compile with new tcl. * Tue May 9 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-7mdk - added locale module. * Thu Mar 30 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-6mdk - menu * Tue Mar 7 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-5mdk - idle 0.5. - compiled with optimization. * Fri Jan 14 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.5.2-4mdk - added a BuildRequires. * Sat Dec 4 1999 Florent Villard <warly@mandrakesoft.com> - add idle, pynche and modulator in the package * Tue Oct 19 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Merge with redhat changes. - added modulator, and pynche to the python-tools package(r) - using a files list in the %files section for python-tools(r) - added conflicts/requires between subpackages so that you cannot have an older tkinter installed with a new python.(r) - added more tools(r) - rebuild to fix broken tkinter.(r) - fixed bogus /usr/local/bin/python requirements.(r) - added patch to import global symbols until we get libtool patched(r) * Fri Aug 20 1999 Pablo Saratxaga <pablo@mandrakesoft.com> - updated to 1.5.2 - updated patches - use macro %%{_arch} instead of %%{_target_cpu} for file paths * Tue Apr 13 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Remove the dbm support (doen't work with GLBC2.1) * Sat Apr 10 1999 Bernhard Rosenkraenzer <bero@linux-mandrake.com> - Mandrake adaptions - add de locale - fix handling of RPM_OPT_FLAGS * Thu Feb 11 1999 Michael Johnson <johnsonm@redhat.com> - added mpzmodule at user request (uses gmp) - added bsddbmodule at user request (uses db 1.85 interface) * Mon Feb 08 1999 Michael Johnson <johnsonm@redhat.com> - add --with-threads at user request - clean up spec file * Fri Jan 08 1999 Michael K. Johnson <johnsonm@redhat.com> - New libc changes ndbm.h to db1/ndbm.h and -ldb to -ldb1 * Thu Sep 3 1998 Jeff Johnson <jbj@redhat.com> - recompile for RH 5.2. * Wed May 06 1998 Cristian Gafton <gafton@redhat.com> - python-docs used to require /usr/bin/sed. Changed to /bin/sed instead * Wed Apr 29 1998 Cristian Gafton <gafton@redhat.com> - fixed the spec file for version 1.5.1 - buildroot (!) * Mon Apr 20 1998 Michael K. Johnson <johnsonm@redhat.com> - updated to python 1.5.1 - created our own Python-Doc tar file from 1.5 to substitute for the not-yet-released Doc package. - build _tkinter properly - use readline again - build crypt module again - install rand replacement module - added a few modules * Thu Apr 09 1998 Erik Troan <ewt@redhat.com> - updated to python 1.5 - made /usr/lib/python1.5 file list automatically generated * Tue Nov 04 1997 Michael K. Johnson <johnsonm@redhat.com> - Fixed dependencies for python and tkinter * Mon Nov 03 1997 Michael K. Johnson <johnsonm@redhat.com> - pulled out tk-related stuff into tkinter package * Fri Oct 10 1997 Erik Troan <ewt@redhat.com> - bunches of scripts used /usr/local/bin/python instead of /usr/bin/python * Tue Sep 30 1997 Erik Troan <ewt@redhat.com> - updated for tcl/tk 8.0 * Thu Jul 10 1997 Erik Troan <ewt@redhat.com> - built against glibc