root/packaging/centuryegg/build-imake-rpm

Revision 12636, 2.0 KB (checked in by build, 13 months ago)

New installs needed on Centos 4 for 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
2IMAKE_VERSION=1.0.2-3
3IMAKE_MAJOR_VERSION=$(echo $IMAKE_VERSION | cut -d "-" -f 1)
4mkdir -p logs rpms srpms
5rpm_arch=`rpmbuild -E %{_arch} 2>/dev/null`
6if [ -f rpms/imake-$IMAKE_VERSION.${rpm_arch}.rpm ]
7then
8    echo "Not building imake as rpms/imake-$IMAKE_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
22if [ "x$(yum info xorg-x11-util-macros | grep Version)" == "x" ]
23then
24    ./build-xorg-x11-util-macros-rpm
25    ./install-xorg-x11-util-macros-rpm
26fi
27(
28cd srpms
29wget -c http://mirror.centos.org/centos/5/os/SRPMS/imake-$IMAKE_VERSION.src.rpm
30rpm -ivh --nomd5 imake-$IMAKE_MAJOR_VERSION*.src.rpm
31)
32sed -ie "/xorg-x11-util-macros/d" ~/rpmbuild/SPECS/imake.spec
33sed -ie "s/xorg-x11-proto-devel/xorg-x11-devel/" ~/rpmbuild/SPECS/imake.spec
34export XPROTO_CFLAGS=-I/usr/include
35export XPROTO_LIBS=" "
36export X_CFLAGS=-I/usr/X11R6/include
37export X_LIBS="-L/usr/X11R6/lib -lX11"
38# add to changelog
39src_rpm=`rpmbuild -bs --nodeps $HOME/rpmbuild/SPECS/imake.spec | sed 's/^Wrote: //'`
40# We manually install this, but if we leave this line in, yum0builddep fails
41sudo cp -pv /etc/yum.conf{,.builddep.orig}
42sudo python -c "import ConfigParser ; cp = ConfigParser.RawConfigParser() ; cp.read('/etc/yum.conf') ; cp.set('main', 'assumeyes', '1') ; cp.write(open('/etc/yum.conf', 'w'))"
43sudo yum-builddep $src_rpm || finished=1
44sudo cp -pv /etc/yum.conf{.builddep.orig,}
45rm $src_rpm
46[[ "$finished" == 1 ]] && exit
47QA_RPATHS=0x0001 rpmbuild  -ba ~/rpmbuild/SPECS/imake.spec >logs/build-imake.log 2>&1
48result=$?
49tail logs/build-imake.log
50cp -pv ~/rpmbuild/RPMS/${rpm_arch}/imake-*$IMAKE_MAJOR_VERSION*.rpm rpms/
51cp -pv ~/rpmbuild/SRPMS/imake-$IMAKE_MAJOR_VERSION*.rpm rpms/
Note: See TracBrowser for help on using the browser.