#! /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 # dnf -y install yum-utils # Installing everything necessary to build a kernel should install # all developer tools required for us. dnf -y 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 wxGTK3-devel wxGTK3-gl wxGTK3-media wxGTK3-webview" P="$P gcc gcc-c++ gcc-gfortran gcc-objc gcc-objc++ make" P="$P rpm rpm-build rpm-devel rpmdevtools rpmlint libdb-devel" dnf -y install $P echo '' echo 'Remember to switch back to an unprivileged user to build the RPM.' echo ''