root/packaging/centuryegg/build-autoconf-rpm

Revision 12639, 1.7 KB (checked in by build, 13 months ago)

conditionally build imake if it's not in this version's repos

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:mime-type set to text/plain
Line 
1#!/bin/bash
2AUTOCONF_VERSION=2.61-8
3AUTOCONF_MAJOR_VERSION=$(echo $AUTOCONF_VERSION | cut -d "-" -f 1)
4mkdir -p logs rpms srpms
5rpm_arch=`rpmbuild -E %{_arch} 2>/dev/null`
6if [ -f rpms/autoconf-$AUTOCONF_VERSION.${rpm_arch}.rpm ]
7then
8    echo "Not building autoconf as rpms/autoconf-$AUTOCONF_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 imake | grep Version)" == "x" ]
23then
24    ./build-imake-rpm
25    ./install-imake-rpm
26fi
27(
28cd srpms
29wget -c ftp://archive.kernel.org/fedora-archive/fedora/linux/releases/7/Everything/source/SRPMS/autoconf-$AUTOCONF_VERSION.fc7.src.rpm
30rpm -ivh --nomd5 autoconf-$AUTOCONF_MAJOR_VERSION*.src.rpm
31)
32# add to changelog
33src_rpm=`rpmbuild -bs --nodeps $HOME/rpmbuild/SPECS/autoconf.spec | sed 's/^Wrote: //'`
34sudo cp -pv /etc/yum.conf{,.builddep.orig}
35sudo python -c "import ConfigParser ; cp = ConfigParser.RawConfigParser() ; cp.read('/etc/yum.conf') ; cp.set('main', 'assumeyes', '1') ; cp.write(open('/etc/yum.conf', 'w'))"
36sudo yum-builddep $src_rpm || finished=1
37sudo cp -pv /etc/yum.conf{.builddep.orig,}
38rm $src_rpm
39[[ "$finished" == 1 ]] && exit
40QA_RPATHS=0x0001 rpmbuild  -ba ~/rpmbuild/SPECS/autoconf.spec >logs/build-autoconf.log 2>&1
41result=$?
42tail logs/build-autoconf.log
43cp -pv ~/rpmbuild/RPMS/noarch/autoconf-*$AUTOCONF_MAJOR_VERSION*.rpm rpms/
44cp -pv ~/rpmbuild/SRPMS/autoconf-$AUTOCONF_MAJOR_VERSION*.rpm rpms/
Note: See TracBrowser for help on using the browser.