Hi all -- as promised, I have finally checked in some real Distutils code. There's just enough functionality for the Distutils to build and install itself. To try it out, you'll need to download the code from the anonymous CVS archive at cvs.python.org; see http://www.python.org/sigs/distutils-sig/cvs.html for instructions. If you just want to try it out, then from the top-level Distutils directory (the one that has setup.py), run: ./setup.py build install This will copy all the .py files to a mockup installation tree in 'build', compile them (to .pyc -- don't run setup.py with "python -O", as I don't handle that yet and it will get confused), and then copy the whole mockup tree to the 'site-packages' directory under your Python library directory. Figuring the installation directory relies on Fred Drake's 'sysconfig' module -- I don't recall what the status of sysconfig was on non-Unix systems; hope someone out there can try it and let us know! Come to think of it, I'd like to hear how it works on *any* system apart from my Red Hat Linux 5.2, stock Python 1.5.1, home PC. ;-) If you want to build in a different directory, use the '--basedir' option to the 'build' command; to install in a different place, you can use either the '--prefix' or '--install-lib' options to the 'install' command. Here are a couple of samples to demonstrate: ./setup.py build --basedir=/tmp/build install --prefix=/tmp/usr/local or ./setup.py build --basedir=/tmp/build ./setup.py install --build-base=/tmp/build --prefix=/tmp/usr/local Go crazy. No documentation yet -- please read the code! Start with distutils/core.py which, as its name implies, is the start of everything. I went nuts with docstrings in that module last night, so hopefully there's just enough there that you can figure things out in the absence of the "Distutils Implementation Notes" document that I'd like to write. Greg -- Greg Ward - software developer gward@cnri.reston.va.us Corporation for National Research Initiatives 1895 Preston White Drive voice: +1-703-620-8990 x287 Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
On Mon, Mar 22, 1999 at 10:10:22AM -0500, Greg Ward wrote:
Go crazy. No documentation yet -- please read the code! Start with distutils/core.py which, as its name implies, is the start of everything. I went nuts with docstrings in that module last night, so hopefully there's just enough there that you can figure things out in the absence of the "Distutils Implementation Notes" document that I'd like to write.
Just a quick question: Does the package support something like autoconf's DESTDIR ? I.e. installing the built package in a directory different from the actual target ? I'm not sure if that's in the scope of `build --dir' or `install --prefix'. DESTDIR is necessary for building Debian packages: Debian's packaging tools work on files in `pwd`/debian/tmp. Generally, something like "./configure --prefix /usr; make; make DESTDIR=`pwd`/debian/tmp install" is used. Note that this is different from setting prefix to `pwd`/debian/tmp! Gregor
Quoth Gregor Hoffleit, on 11 April 1999:
Just a quick question: Does the package support something like autoconf's DESTDIR ? I.e. installing the built package in a directory different from the actual target ? I'm not sure if that's in the scope of `build --dir' or `install --prefix'.
The installation directories are up to the 'install' command. The most convenient way to set them is by setting the prefix, but you can (or will be able to) set every target directory individually. RTFS for the options that control this -- I haven't documented anything yet because I'm not sure the option names are final.
DESTDIR is necessary for building Debian packages: Debian's packaging tools work on files in `pwd`/debian/tmp. Generally, something like "./configure --prefix /usr; make; make DESTDIR=`pwd`/debian/tmp install" is used. Note that this is different from setting prefix to `pwd`/debian/tmp!
In general, that's true -- but as the Distutils currently stand, the prefix is used *solely* to generate the installation directories. So it doesn't (yet) matter which one you set. I'm not sure if that will remain true forever, though. Greg -- Greg Ward - software developer gward@cnri.reston.va.us Corporation for National Research Initiatives 1895 Preston White Drive voice: +1-703-620-8990 Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
participants (2)
-
Greg Ward
-
Gregor Hoffleit