root/packaging/centuryegg/build-sqlite-rpm

Revision 12655, 1.8 KB (checked in by build, 13 months ago)

Add bcond_Definitions into the sqlite build when building on Centos 4

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:mime-type set to text/plain
Line 
1#!/bin/bash
2SQLITE_VERSION=3.4.2-3
3SQLITE_MAJOR_VERSION=$(echo $SQLITE_VERSION | cut -d "-" -f 1)
4mkdir -p logs rpms srpms
5rpm_arch=`rpmbuild -E %{_arch} 2>/dev/null`
6if [ -f rpms/sqlite-$SQLITE_VERSION.${rpm_arch}.rpm ]
7then
8    echo "Not building sqlite as rpms/sqlite-$SQLITE_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/releases/8/Everything/source/SRPMS/sqlite-$SQLITE_VERSION.fc8.src.rpm
25rpm -ivh --nomd5 sqlite-$SQLITE_MAJOR_VERSION*.src.rpm
26)
27if [ "x$REDHAT_VERSION" != "x" ] && [ $REDHAT_VERSION -lt 5 ] && [ $(grep "define bcond_with" ~/rpmbuild/SPECS/sqlite.spec | wc -l) -eq 0 ]
28then
29    cat bcond_definitions ~/rpmbuild/SPECS/sqlite.spec >~/rpmbuild/SPECS/sqlite_.spec
30    mv ~/rpmbuild/SPECS/sqlite{_,}.spec
31fi
32# add to changelog
33src_rpm=`rpmbuild -bs --nodeps $HOME/rpmbuild/SPECS/sqlite.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/sqlite.spec >logs/build-sqlite.log 2>&1
41result=$?
42tail logs/build-sqlite.log
43cp -pv ~/rpmbuild/RPMS/$rpm_arch/sqlite-{,debuginfo-,devel-}*$SQLITE_MAJOR_VERSION*.rpm rpms/
44cp -pv ~/rpmbuild/SRPMS/sqlite-$SQLITE_MAJOR_VERSION*.rpm rpms/
Note: See TracBrowser for help on using the browser.