Changeset 12485 for packaging/centuryegg

Show
Ignore:
Timestamp:
11/12/10 01:08:49 (18 months ago)
Author:
build
Message:

Build libffi and autoconf if necessary

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • packaging/centuryegg/build-python-rpm

    r12479 r12485  
    1111fi 
    1212mkdir -p logs rpms srpms 
     13rpm_arch=`rpmbuild -E %{_arch} 2>/dev/null` 
    1314if [ $(ls rpms/python$PYTHON_SUFFIX-$PYTHON_VERSION*.rpm | wc -l) -gt 0 ] 
    1415then 
     
    3031    then 
    3132        cd rpms 
    32         wget -c ftp://mirror.switch.ch/pool/1/mirror/epel/5/i386/fakeroot-libs-1.12.2-21.el5.i386.rpm 
    33         wget -c ftp://mirror.switch.ch/pool/1/mirror/epel/5/i386/fakeroot-1.12.2-21.el5.i386.rpm 
    34         wget -c ftp://mirror.switch.ch/pool/1/mirror/epel/5/i386/rpmdevtools-6.8-1.el5.noarch.rpm 
     33        wget -c ftp://mirror.switch.ch/pool/1/mirror/epel/5/${rpm_arch}/fakeroot-libs-1.12.2-21.el5.2.${rpm_arch}.rpm 
     34        wget -c ftp://mirror.switch.ch/pool/1/mirror/epel/5/${rpm_arch}/fakeroot-1.12.2-21.el5.2.${rpm_arch}.rpm 
     35        wget -c ftp://mirror.switch.ch/pool/1/mirror/epel/5/${rpm_arch}/rpmdevtools-6.8-1.el5.noarch.rpm 
    3536        if [ "x`rpm -qa redhat-rpm-config`" == "x" ] 
    3637        then 
     
    4344        if [ "x`rpm -qa rpmdevtools`" == "x" ] 
    4445        then 
    45             sudo rpm -Uvh fakeroot-{,libs-}1.12.2-21.el5.i386.rpm rpmdevtools-6.8-1.el5.noarch.rpm || exit 1 
     46            sudo rpm -Uvh fakeroot-{,libs-}1.12.2-21.el5.${rpm_arch}.rpm rpmdevtools-6.8-1.el5.noarch.rpm || exit 1 
    4647        fi 
    4748        cd .. 
     
    7273    ) 
    7374fi 
     75LIBFFI_VERSION=`yum info libffi | grep Version | head -n 1 | sed -e "s/[ \t]\+/ /g" | cut -d ":" -f 2 | cut -d " " -f 2 | sort | tail -n 1` 
     76if [ "x$LIBFFI_VERSION" == "x" ] 
     77then 
     78    ( 
     79    echo Building LibFFI... 
     80    ./build-libffi-rpm 
     81    ./install-libffi-rpm 
     82    ) 
     83elif [ "x`rpm -q libffi-devel`" == "x" ] 
     84then 
     85    sudo yum install libffi-devel 
     86fi 
     87AUTOCONF_VERSION=`yum info autoconf | grep Version | head -n 1 | sed -e "s/[ \t]\+/ /g" | cut -d ":" -f 2 | cut -d " " -f 2 | sort | tail -n 1` 
     88if [ "`echo $AUTOCONF_VERSION | cut -d "." -f 1`" == "2" ] && [ `echo $AUTOCONF_VERSION | cut -d "." -f 2` -lt "31" ] 
     89then 
     90    ( 
     91    echo Building Autoconf 2.31... 
     92    ./build-autoconf-rpm 
     93    ./install-autoconf-rpm 
     94    ) 
     95fi 
    7496( 
    7597cd srpms 
    7698wget -c $PYTHON_SRPM_URL 
    77 rpm -ivh python-$PYTHON_VERSION*.src.rpm 
     99rpm -ivh --nomd5 python-$PYTHON_VERSION*.src.rpm 
    78100) 
    79101DB_VERSION=`yum info db4-devel | grep Version | head -n 1 | sed -e "s/[ \t]\+/ /g" | cut -d ":" -f 2 | cut -d " " -f 2 | sed -e "s/\([0-9]\+\.[0-9]\+\)\..*/\1/"` 
     
    89111    fi 
    90112fi 
     113# We've made sure libffi-devel  is installed, and yum-builddep doesn't detect it 
     114sed -ie "/libffi-devel/ s/^/#/" $HOME/rpmbuild/SPECS/python.spec 
    91115# add to changelog 
    92116src_rpm=`rpmbuild -bs --nodeps $HOME/rpmbuild/SPECS/python.spec | sed 's/^Wrote: //'` 
    93 rpm_arch=`rpmbuild -E %{_arch} 2>/dev/null` 
    94117sudo cp -pv /etc/yum.conf{,.builddep.orig} 
    95118sudo python -c "import ConfigParser ; cp = ConfigParser.RawConfigParser() ; cp.read('/etc/yum.conf') ; cp.set('main', 'assumeyes', '1') ; cp.write(open('/etc/yum.conf', 'w'))" 
     
    97120sudo cp -pv /etc/yum.conf{.builddep.orig,} 
    98121rm $src_rpm 
    99 [[ "$finished" == 1 ]] && exit 
     122[[ "$finished" == 1 ]] && exit 1 
    100123# for fedora 6 
    101124# QA_RPATHS to prevent /usr/lib64... sqlite error