root/packaging/centuryegg/build-libffi-rpm

Revision 12484, 1.5 KB (checked in by build, 16 months ago)

Added libraries needed by Python 2.6

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:mime-type set to text/plain
Line 
1#!/bin/bash
2LIBFFI_VERSION=3.0.5-1
3LIBFFI_MAJOR_VERSION=$(echo $LIBFFI_VERSION | cut -d "-" -f 1)
4mkdir -p logs rpms srpms
5rpm_arch=`rpmbuild -E %{_arch} 2>/dev/null`
6if [ -f rpms/libffi-$LIBFFI_VERSION.${rpm_arch}.rpm ]
7then
8    echo "Not building libffi as rpms/libffi-$LIBFFI_VERSION.${rpm_arch}.rpm already exists"
9    exit
10fi
11if [ -f /etc/fedora-release ]
12then
13        sudo yum -y install rpmdevtools || exit
14        SETUPTREE=rpmdev-setuptree
15elif [ -f /etc/redhat-release ]
16then
17        sudo yum -y install fedora-rpmdevtools || exit
18        SETUPTREE=fedora-buildrpmtree
19        REDHAT_VERSION=`cat /etc/redhat-release | cut -d " " -f 3 | cut -d "." -f 1`
20fi
21$SETUPTREE || exit
22(
23cd srpms
24wget -c ftp://archive.kernel.org/fedora-archive/fedora/linux/updates/8/SRPMS.newkey/libffi-$LIBFFI_VERSION.fc8.src.rpm
25rpm -ivh --nomd5 libffi-$LIBFFI_MAJOR_VERSION*.src.rpm
26)
27# add to changelog
28src_rpm=`rpmbuild -bs --nodeps $HOME/rpmbuild/SPECS/libffi.spec | sed 's/^Wrote: //'`
29sudo cp -pv /etc/yum.conf{,.builddep.orig}
30sudo python -c "import ConfigParser ; cp = ConfigParser.RawConfigParser() ; cp.read('/etc/yum.conf') ; cp.set('main', 'assumeyes', '1') ; cp.write(open('/etc/yum.conf', 'w'))"
31sudo yum-builddep $src_rpm || finished=1
32sudo cp -pv /etc/yum.conf{.builddep.orig,}
33rm $src_rpm
34[[ "$finished" == 1 ]] && exit
35QA_RPATHS=0x0001 rpmbuild  -ba ~/rpmbuild/SPECS/libffi.spec >logs/build-libffi.log 2>&1
36result=$?
37tail logs/build-libffi.log
38cp -pv ~/rpmbuild/RPMS/$rpm_arch/libffi-{,debuginfo-,devel-}*$LIBFFI_MAJOR_VERSION*.rpm rpms/
39cp -pv ~/rpmbuild/SRPMS/libffi-$LIBFFI_MAJOR_VERSION*.rpm rpms/
Note: See TracBrowser for help on using the browser.