User:Tim Starling/HipHop in CentOS chroot

From mediawiki.org

# Get host packages

apt-get install rpm yum schroot

# Set up the chroot

mkdir -p /home/data/centos
export HOME=/root
rpm --rebuilddb --root=/home/data/centos
wget 'http://mirror.centos.org/centos/5/os/x86_64/CentOS/centos-release-5-5.el5.centos.x86_64.rpm'
wget 'http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5'
rpm --root=/home/data/centos --import RPM-GPG-KEY-CentOS-5
rpm -i --root=/home/data/centos --nodeps 'centos-release-5-5.el5.centos.x86_64.rpm'
yum --installroot=/home/data/centos install -y rpm-build yum

# Set up schroot

mkdir /home/data/chroot
cd /home/data/centos
tar -czf /home/data/chroot/centos.tgz .

echo '
[centos]
type=file
description=CentOS 5.5 x86-64
file=/home/data/chroot/centos.tgz
' > /etc/schroot/schroot.conf

# Enter chroot

schroot -c centos-source

# Get proper .bashrc

cd /root
cp /etc/skel/.* .
. ~/.bashrc

# Install HipHop

yum install redhat-release
rpm -ivh http://epel.osuosl.org/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh 'http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-8.ius.el5.noarch.rpm'
rpm -ivh 'http://pkg.tag1consulting.com/hphp/x86_64/hphp-release-1.0-2.el5.noarch.rpm'
yum install hiphop-php
. /etc/profile.d/hphp.sh

# Test

echo '<? echo "Hello!\n";' > test.php
hphpi -f test.php