#! /bin/sh DEBVMAJ=`cat /etc/debian_version | cut -f 1 -d .` case "X$DEBVMAJ" in "X8") DEBVMAJ="jessie" ;; "X9") DEBVMAJ="stretch" ;; "X10") DEBVMAJ="buster" ;; "X") echo 'E: Not on a Debian system' exit 1 ;; *) echo 'E: Can not handle Debian major version' $DEBVMAJ exit 1 ;; esac # CORRECTION: Probably the version numbers for libjpeg-turbo and # wxWidgets need a change in later Debian versions or on non-Debian systems. WXVERS="3.0" LJTVERS="62" # Ensure to run the script as root if [ "X$LOGNAME" != "Xroot" ] then echo 'ERROR: This script must be run as root!' exit 1 fi # Make sure system is up to date apt-get -y update apt-get -y upgrade # Installing everything needed to build a kernel should cover # most development tools # You should activate (uncomment) the following line only if necessary. # apt-get -y build-dep kernel # Install developer tools and DK tools library dependencies P="aptitude build-essential autoconf automake autotools-dev" P="$P dh-make debhelper dh-systemd" P="$P devscripts fakeroot file gfortran git gnupg fp-compiler" P="$P lintian patch patchutils pbuilder perl python" P="$P quilt xutils-dev make gcc g++" P="$P zlib1g-dev libbz2-dev libssl-dev libdb-dev" P="$P libpng-dev libjpeg-dev" P="$P libjpeg${LJTVERS}-turbo-dev libsnmp-dev" P="$P wx${WXVERS}-headers" P="$P libwxgtk${WXVERS}-dev" P="$P libwxbase${WXVERS}-dev" if [ "X$DEBVMAJ" != "Xjessie" ] then echo 'I: Not jessie' P="$P libtiff5-dev time libmariadb-dev libmariadbclient-dev" else echo 'I: jessie' P="$P libtiff-dev libopenjpeg-dev libmysqlclient-dev libwxsvg-dev" P="$P libwxsvg-dev" fi apt-get -y install $P # Finally write hint to switch back to unprivileged user echo '' echo 'Remember to switch back to an unprivileged user to build the DEB file.' echo ''