#! /bin/sh # Check whether the script runs as root if [ "X$LOGNAME" != "Xroot" ] then echo 'ERROR: This script must be run as root!' exit 1 fi # Install the yum-builddep tool yum -y install yum-utils # Installing everything necessary to build a kernel should install # all developer tools required for us. yum-builddep kernel # Explicit dependencies to build our project and to create RPM files P="zlib-devel bzip2-devel openssl-devel db4-devel db4-cxx mysql-devel" P="$P libpng-devel libjpeg-turbo-devel openjpeg-devel libtiff-devel" P="$P net-snmp-devel wxGTK-devel" P="$P gcc g++ make rpm rpm-build rpm-devel rpmdevtools rpmlint" yum -y install $P echo '' echo 'Remember to switch back to an unprivileged user to build the RPM.' echo ''