#!/bin/bash
section=$1
version=7.4
mkdir $section
cd $section

# download and check packages
grep -v '^#' ../${section}-${version}.wget | wget -i- -c \
    -B http://xorg.freedesktop.org/releases/individual/${section}/
md5sum -c ../${section}-${version}.md5

# build packages
for package in $(grep -v '^#' ../${section}-${version}.wget)
do
  packagedir=$(echo $package | sed 's/.tar.bz2//')
  tar -xf $package
  cd $packagedir
  ./configure $XORG_CONFIG
  make
  make install
  cd ..
  rm -rf $packagedir
  rm -f $package
done 2>&1 | tee -a ../xorg-${section}-compile.log #log the entire loop