Proposal -- makefile patches and scripts to generate python RPMs
The main thing a specfile generator can accomplish is to automate the generation of the file list so that (for example) when we add a new library module the specfile doesn't have to be hand-edited.
That sounds similar to the rationale for having automatically generated dependency files for make, e.g. by gcc -MM. Many projects use this as a convenience, and it kind-of works. However, I still like it better to have dependencies explicitly recorded in the Makefiles. That requires more discipline, but is easier to understand, and the behaviour is more reproducable. So given the option of using an existing hand-written spec file, and having some magic generate one for me, I'd always use the hand-written one. The magic is only good if there is no hand-written one. Regards, Martin
Whatever the outcome of this discussion, this is too late for 2.0. But I tend to side with Jeremy and Martin -- "explicit is better". I do want Jeremy to check his RPM generation scripts in, so they can be improved in a truly open source project. (Maybe in Tools/rpm?) --Guido van Rossum (home page: http://www.python.org/~guido/)
"GvR" == Guido van Rossum <guido@python.org> writes:
GvR> Whatever the outcome of this discussion, this is too late for GvR> 2.0. But I tend to side with Jeremy and Martin -- "explicit is GvR> better". I do want Jeremy to check his RPM generation scripts GvR> in, so they can be improved in a truly open source project. GvR> (Maybe in Tools/rpm?) I don't actually use a script to generate the RPM. I wrote a .spec file by hand and use it to generate the RPMs using the rpm command. I could check in the spec file, which I would end up changing every time we do a release -- to update the version number, change the Setup.in patch, etc. I should probably also include the patch file along with the .spec file. I also wrote a smal distutils setup script for 2.0b2, which I should check in somewhere. Not sure where... BTW, I've attached the spec file below. You can get it from the .src.rpm on pythonlabs.com, but that's pretty inconvenient if you're merely curious. Jeremy %define name BeOpen-Python %define version 2.0b2 %define release 1 %define __prefix /usr/local Summary: An interpreted, interactive, object-oriented programming language. Name: %{name} Version: %{version} Release: %{release} Copyright: Modified CNRI Open Source License Group: Development/Languages Source: %{name}-%{version}.tar.bz2 Source1: html-%{version}.tar.bz2 Patch0: %{name}-%{version}-Setup.patch BuildRoot: /var/tmp/%{name}-%{version}-root Prefix: %{__prefix} URL: http://www.pythonlabs.com/ Vendor: BeOpen PythonLabs Packager: Jeremy Hylton <jeremy@beopen.com> %description Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the Mac. %changelog * Thu Oct 5 2000 Jeremy Hylton <jeremy@beopen.com> - added bin/python2.0 to files list (suggested by Martin v. Löwis) * Tue Sep 26 2000 Jeremy Hylton <jeremy@beopen.com> - updated for release 1 of 2.0b2 - use .bz2 version of Python source * Tue Sep 12 2000 Jeremy Hylton <jeremy@beopen.com> - Version 2 of 2.0b1 - Make the package relocatable. Thanks to Suchandra Thapa. - Exclude Tkinter from main RPM. If it is in a separate RPM, it is easier to track Tk releases. %prep %setup -n Python-%{version} %patch0 %setup -D -T -a 1 -n Python-%{version} # This command drops the HTML files in the top-level build directory. # That's not perfect, but it will do for now. %build ./configure make %install [ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{__prefix} make prefix=$RPM_BUILD_ROOT%{__prefix} install %clean rm -fr $RPM_BUILD_ROOT %files %defattr(-, root, root) %{__prefix}/bin/python %{__prefix}/bin/python2.0 %{__prefix}/man/man1/python.1 %doc Misc/README Misc/HYPE Misc/cheatsheet Misc/unicode.txt Misc/Porting %doc LICENSE Misc/ACKS Misc/BLURB.* Misc/HISTORY Misc/NEWS %doc index.html modindex.html api dist doc ext inst lib mac ref tut icons %dir %{__prefix}/include/python2.0 %{__prefix}/include/python2.0/*.h %dir %{__prefix}/lib/python2.0/ %{__prefix}/lib/python2.0/*.py* %{__prefix}/lib/python2.0/pdb.doc %{__prefix}/lib/python2.0/profile.doc %dir %{__prefix}/lib/python2.0/config %{__prefix}/lib/python2.0/config/Makefile %{__prefix}/lib/python2.0/config/Makefile.pre.in %{__prefix}/lib/python2.0/config/Setup %{__prefix}/lib/python2.0/config/Setup.config %{__prefix}/lib/python2.0/config/Setup.local %{__prefix}/lib/python2.0/config/config.c %{__prefix}/lib/python2.0/config/config.c.in %{__prefix}/lib/python2.0/config/install-sh %{__prefix}/lib/python2.0/config/libpython2.0.a %{__prefix}/lib/python2.0/config/makesetup %{__prefix}/lib/python2.0/config/python.o %dir %{__prefix}/lib/python2.0/curses %{__prefix}/lib/python2.0/curses/*.py* %dir %{__prefix}/lib/python2.0/distutils %{__prefix}/lib/python2.0/distutils/*.py* %{__prefix}/lib/python2.0/distutils/README %dir %{__prefix}/lib/python2.0/distutils/command %{__prefix}/lib/python2.0/distutils/command/*.py* %{__prefix}/lib/python2.0/distutils/command/command_template %dir %{__prefix}/lib/python2.0/encodings %{__prefix}/lib/python2.0/encodings/*.py* %dir %{__prefix}/lib/python2.0/lib-dynload %dir %{__prefix}/lib/python2.0/lib-tk %{__prefix}/lib/python2.0/lib-tk/*.py* %{__prefix}/lib/python2.0/lib-dynload/_codecsmodule.so %{__prefix}/lib/python2.0/lib-dynload/_cursesmodule.so %{__prefix}/lib/python2.0/lib-dynload/_localemodule.so %{__prefix}/lib/python2.0/lib-dynload/arraymodule.so %{__prefix}/lib/python2.0/lib-dynload/binascii.so %{__prefix}/lib/python2.0/lib-dynload/cPickle.so %{__prefix}/lib/python2.0/lib-dynload/cStringIO.so %{__prefix}/lib/python2.0/lib-dynload/cmathmodule.so %{__prefix}/lib/python2.0/lib-dynload/errnomodule.so %{__prefix}/lib/python2.0/lib-dynload/fcntlmodule.so %{__prefix}/lib/python2.0/lib-dynload/gdbmmodule.so %{__prefix}/lib/python2.0/lib-dynload/grpmodule.so %{__prefix}/lib/python2.0/lib-dynload/linuxaudiodev.so %{__prefix}/lib/python2.0/lib-dynload/mathmodule.so %{__prefix}/lib/python2.0/lib-dynload/md5module.so %{__prefix}/lib/python2.0/lib-dynload/mmapmodule.so %{__prefix}/lib/python2.0/lib-dynload/newmodule.so %{__prefix}/lib/python2.0/lib-dynload/operator.so %{__prefix}/lib/python2.0/lib-dynload/parsermodule.so %{__prefix}/lib/python2.0/lib-dynload/pwdmodule.so %{__prefix}/lib/python2.0/lib-dynload/pyexpat.so %{__prefix}/lib/python2.0/lib-dynload/readline.so %{__prefix}/lib/python2.0/lib-dynload/resource.so %{__prefix}/lib/python2.0/lib-dynload/rotormodule.so %{__prefix}/lib/python2.0/lib-dynload/selectmodule.so %{__prefix}/lib/python2.0/lib-dynload/shamodule.so %{__prefix}/lib/python2.0/lib-dynload/_socketmodule.so %{__prefix}/lib/python2.0/lib-dynload/stropmodule.so %{__prefix}/lib/python2.0/lib-dynload/structmodule.so %{__prefix}/lib/python2.0/lib-dynload/syslogmodule.so %{__prefix}/lib/python2.0/lib-dynload/termios.so %{__prefix}/lib/python2.0/lib-dynload/timemodule.so %{__prefix}/lib/python2.0/lib-dynload/ucnhash.so %{__prefix}/lib/python2.0/lib-dynload/unicodedata.so %{__prefix}/lib/python2.0/lib-dynload/zlibmodule.so %dir %{__prefix}/lib/python2.0/lib-old %{__prefix}/lib/python2.0/lib-old/*.py* %dir %{__prefix}/lib/python2.0/plat-linux2 %{__prefix}/lib/python2.0/plat-linux2/*.py* %{__prefix}/lib/python2.0/plat-linux2/regen %dir %{__prefix}/lib/python2.0/site-packages %{__prefix}/lib/python2.0/site-packages/README %dir %{__prefix}/lib/python2.0/test %{__prefix}/lib/python2.0/test/*.py* %{__prefix}/lib/python2.0/test/README %{__prefix}/lib/python2.0/test/audiotest.au %{__prefix}/lib/python2.0/test/greyrgb.uue %{__prefix}/lib/python2.0/test/test.xml %{__prefix}/lib/python2.0/test/testimg.uue %{__prefix}/lib/python2.0/test/testimgr.uue %{__prefix}/lib/python2.0/test/testrgb.uue %dir %{__prefix}/lib/python2.0/test/output %{__prefix}/lib/python2.0/test/output/test_* %dir %{__prefix}/lib/python2.0/xml %{__prefix}/lib/python2.0/xml/*.py* %dir %{__prefix}/lib/python2.0/xml/dom %{__prefix}/lib/python2.0/xml/dom/*.py* %dir %{__prefix}/lib/python2.0/xml/sax %{__prefix}/lib/python2.0/xml/sax/*.py*
I don't actually use a script to generate the RPM. I wrote a .spec file by hand and use it to generate the RPMs using the rpm command. I could check in the spec file, which I would end up changing every time we do a release -- to update the version number, change the Setup.in patch, etc. I should probably also include the patch file along with the .spec file.
I also wrote a smal distutils setup script for 2.0b2, which I should check in somewhere. Not sure where...
Could you post this script? Thomas
Here is the setup script I used to build the Tk RPMs. The name and version part is a mess and I would welcome suggestions on how to fix it. The problem is that Tkinter gets built against a particular version of Python and a particular version of Tcl/Tk. I want the name of the RPM to indiciate both versions, but didn't seem an obvious way to accomplish it. Thus, I put the Python version number in the name and the Tcl/Tk version number in the version. Otherwise, I think this is pretty straightforward distutils stuff (although the documentation was out of date last I checked). I've attached three files. I wrote setup.py and setup.cfg. Distutils created MANIFEST. Jeremy #! /usr/bin/env python """Tkinter is the Python interface to the Tk GUI toolkit. Tk offers native look and feel on most major platforms, including Unix, Windows, and Macintosh. The Tkinter-2.0 RPM contains the Python C extension module for Python 2.0. The Python source files are distributed with the main Python distribution.""" from distutils.core import setup, Extension setup(name="Tkinter-2.0", version="8.0", description="Python interface to Tk GUI toolkit", author="Python development team", author_email="pythoneers@beopen.com", url="http://www.pythonlabs.com/products/python2.0/", licence="Modified CNRI Open Source License", ext_modules=[Extension("_tkinter", ["src/_tkinter.c", "src/tkappinit.c"], define_macros=[('WITH_APPINIT', None)], library_dirs=["/usr/X11R6/lib"], libraries=["tk8.0", "tcl8.0", "X11"], )], long_description = __doc__ ) [bdist_rpm] packager = Jeremy Hylton <jeremy@beopen.com> vendor = BeOpen PythonLabs setup.py src/_tkinter.c src/tkappinit.c
participants (4)
-
Guido van Rossum -
Jeremy Hylton -
Martin v. Loewis -
Thomas Heller