* ============ Python 2.3.x build ** -------- Python build, from source (CentOS 3.x attempt, 13 Apr 2004) *** ---- set paths, unpack and patch ## NOTE: I use 'sudo' to run commands as 'root' ## (instead of using a root login-shell) ## ## SEE http://www.courtesan.com/sudo/sudo.html ## http://www.onlamp.com/lpt/a/2680 "Eliminating root w/sudo" ## NOTE: these build pre-requisites! # BuildPrereq: bzip2-devel # BuildPrereq: db4-devel # BuildPrereq: expat-devel # BuildPrereq: gdbm-devel # BuildPrereq: openssl-devel export PYSRC=/alpha/local/src/Python export PYDIR=$PYSRC/Python-2.3.4 ## where the source is export PFIX=/usr/local/python-2.3.4-1 ## where to install Py 2.3.3 export PYVERS=2.3.4 cd $PYSRC /bin/rm -f ${PYVERS}.log /bin/rm -rf $PYDIR tar -jxf $PYSRC/tarfiles/Python-2.3.4.tar.bz2 ( cd $PYDIR ## patch -p1 -b < ../Python-2.3-lib64.patch ## patch -p1 -b < ../Python-2.2.2-biarch-headers.patch ## patch -p1 -b < ../Python-2.3-64bit-fixes.patch ## OPTIONAL (not req'd) patches, from Mandrake Linux 2.3.3 rpm ## patch -p1 -z .dist < ../python-2.2.2-urllib2-nonanonftp.patch ## patch -p1 -z .dist < ../python-2.2.2-ftpuri.patch ) >> ${PYVERS}.log 2>&1 *** ---- now, add missing Modules via "Setup.local" cp -p shmmodule.c $PYDIR/Modules ## from Redhat RPM; optional (cd $PYDIR/Modules cat >> Setup.local << EOF # bzip2 module bz2 bz2module.c -lbz2 # crypt module crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems _curses _cursesmodule.c -lcurses -ltermcap # Wrapper for the panel library that's part of ncurses and SYSV curses. _curses_panel _curses_panel.c -lpanel -lncurses # Edit the variables DB and DBLIBVERto point to the db top directory # and the subdirectory of PORT where you built it. # DB=/usr/include/db4 DBLIBVER=4.1 DBINC=/usr/include/db4 DBLIB=/usr/lib _bsddb _bsddb.c -I\$(DBINC) -L\$(DBLIB) -ldb-\$(DBLIBVER) # install GDBM module gdbm gdbmmodule.c -I/usr/include/gdbm -lgdbm # The mpz module interfaces to the GNU Multiple Precision library. # You need to ftp the GNU MP library. mpz mpzmodule.c -lgmp # GNU readline. readline readline.c -lreadline -ltermcap # Socket module helper for SSL support _ssl _ssl.c -DUSE_SSL -I/usr/include/openssl -I/usr/kerberos/include -lssl -lcrypto # Andrew Kuchling's zlib module zlib zlibmodule.c -lz # Shared memory module - !OPTIONAL! shm shmmodule.c EOF ) >> ${PYVERS}.log 2>&1 ## run Configure ( cd $PYDIR env OPT='-O3 -march=i686 -DTHREAD_STACK_SIZE=0x20000' \ ./configure --enable-unicode=ucs4 \ --with-pymalloc \ --prefix=$PFIX ) >> ${PYVERS}.log 2>&1 *** ---- run 'make test' -- builds everything ## NOTE: curses test will fail, if not run from console! ( cd $PYDIR make test TESTOPTS="-l -unetwork -ubsddb -ucurses" || /bin/true ) >> ${PYVERS}.log 2>&1 & sudo /bin/rm -rf $PFIX ## remove old version ( cd $PYDIR sudo make install ## go ahead, install Python! :^) ) >> $PYSRC/${PYVERS}.log 2>&1 & sudo ln -s $PFIX /usr/local/Python-2.3 ## optional * -------------------------------- Mon May 24 23:22:43 2004 (revision Wed Jun 9 14:03:08 2004) (SuSE 9.0, Mon Aug 30 11:10:25 2004) # # CentOS3.1 build, Python extensions for libxml2 & libxslt (versions) # # ftp://mirror.physics.ncsu.edu/pub/caoslinux/ # ... centos-3/3.1/SRPMS/ libxml2-2.5.10-6.src.rpm # libxslt-1.0.33-1.src.rpm # # TO UNPACK (get the tar.gz files): # mkdir tmp; cd tmp; rpm2cpio ../some.rpm | cpio -idmv cd /alpha/local/src/Zope/ZUNO ## your src-dir xml2=libxml2-2.5.10 xslt=libxslt-1.0.33 ## xslt=libxslt-1.0.32 ## SuSE 9.0 PYDIR=/usr/local/Python-2.3 PY=$PYDIR/bin/python ## must be Python 2.3.3+ !! /bin/rm -rf $xslt $xml2 tar zxf tarfiles/$xml2.tar.gz tar zxf tarfiles/$xslt.tar.gz ## tar jxf tarfiles/$xslt.tar.bz2 LOG=$xml2.log mv -f $LOG $LOG.prev sudo ls ( cd $xml2/python $PY setup.py build sudo $PY setup.py install ) >> $LOG 2>&1 & LOG=$xslt.log mv -f $LOG $LOG.prev ( cd $xslt ./configure --with-python=$PYDIR make ) >> $LOG 2>&1 & sudo ls ( echo "---------------- libxslt Python ----------------" cd $xslt/python sudo make install ) >> $LOG 2>&1 & gui:190 $ /usr/local/Python-2.3/bin/python ## testing imports! Python 2.3.4 (#1, Jul 26 2004, 12:01:54) [GCC 3.3.1 (SuSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import libxml2 >>> import libxslt >>>