#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.2 # Package: netsurf #=========================== # DB commit: 48bb9ee31306c82c48dfaaad707eb4f6a926eb8a # APP commit: 1ca4178aea919e4c9e869e3d650ff8af9678bd6f #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: netsurf" echo "Release: 0.2.2" echo "checking config file" if [ -f $ULFS_CONFIG_FILE ] then echo "loading config file $ULFS_CONFIG_FILE..." . $ULFS_CONFIG_FILE fi #Creating log directory mkdir -p /var/log/ulfs-packages/netsurf/ #Saving start timestamp date +%s > /var/log/ulfs-packages/netsurf/start.time #Going to source directory... cd /sources #Checking dependances... #Checking gtk3... if [ ! -f /var/cache/ulfs-packages/gtk3 ]; then echo "Dependance \"gtk3\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gtk3/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gtk3 ]; then echo "Dependance \"gtk3\" is not installed. Exiting..." exit fi fi #Checking libxml2... if [ ! -f /var/cache/ulfs-packages/libxml2 ]; then echo "Dependance \"libxml2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libxml2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libxml2 ]; then echo "Dependance \"libxml2\" is not installed. Exiting..." exit fi fi #Checking glib... if [ ! -f /var/cache/ulfs-packages/glib ]; then echo "Dependance \"glib\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/glib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/glib ]; then echo "Dependance \"glib\" is not installed. Exiting..." exit fi fi #Checking pcre2... if [ ! -f /var/cache/ulfs-packages/pcre2 ]; then echo "Dependance \"pcre2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/pcre2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/pcre2 ]; then echo "Dependance \"pcre2\" is not installed. Exiting..." exit fi fi #Checking curl... if [ ! -f /var/cache/ulfs-packages/curl ]; then echo "Dependance \"curl\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/curl/install -O - | bash if [ ! -f /var/cache/ulfs-packages/curl ]; then echo "Dependance \"curl\" is not installed. Exiting..." exit fi fi #Checking gobject-introspection... if [ ! -f /var/cache/ulfs-packages/gobject-introspection ]; then echo "Dependance \"gobject-introspection\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gobject-introspection/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gobject-introspection ]; then echo "Dependance \"gobject-introspection\" is not installed. Exiting..." exit fi fi #Checking fontconfig... if [ ! -f /var/cache/ulfs-packages/fontconfig ]; then echo "Dependance \"fontconfig\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/fontconfig/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fontconfig ]; then echo "Dependance \"fontconfig\" is not installed. Exiting..." exit fi fi #Checking Xlibs... if [ ! -f /var/cache/ulfs-packages/Xlibs ]; then echo "Dependance \"Xlibs\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/Xlibs/install -O - | bash if [ ! -f /var/cache/ulfs-packages/Xlibs ]; then echo "Dependance \"Xlibs\" is not installed. Exiting..." exit fi fi #Checking libpng... if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libpng/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" is not installed. Exiting..." exit fi fi #Checking pixman... if [ ! -f /var/cache/ulfs-packages/pixman ]; then echo "Dependance \"pixman\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/pixman/install -O - | bash if [ ! -f /var/cache/ulfs-packages/pixman ]; then echo "Dependance \"pixman\" is not installed. Exiting..." exit fi fi #Checking graphite2... if [ ! -f /var/cache/ulfs-packages/graphite2 ]; then echo "Dependance \"graphite2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/graphite2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/graphite2 ]; then echo "Dependance \"graphite2\" is not installed. Exiting..." exit fi fi #Checking gtk2... if [ ! -f /var/cache/ulfs-packages/gtk2 ]; then echo "Dependance \"gtk2\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gtk2/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gtk2 ]; then echo "Dependance \"gtk2\" is not installed. Exiting..." exit fi fi #Checking gdk-pixbuf... if [ ! -f /var/cache/ulfs-packages/gdk-pixbuf ]; then echo "Dependance \"gdk-pixbuf\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gdk-pixbuf/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gdk-pixbuf ]; then echo "Dependance \"gdk-pixbuf\" is not installed. Exiting..." exit fi fi #Checking libjpeg-turbo... if [ ! -f /var/cache/ulfs-packages/libjpeg-turbo ]; then echo "Dependance \"libjpeg-turbo\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libjpeg-turbo/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libjpeg-turbo ]; then echo "Dependance \"libjpeg-turbo\" is not installed. Exiting..." exit fi fi #Checking fribidi... if [ ! -f /var/cache/ulfs-packages/fribidi ]; then echo "Dependance \"fribidi\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/fribidi/install -O - | bash if [ ! -f /var/cache/ulfs-packages/fribidi ]; then echo "Dependance \"fribidi\" is not installed. Exiting..." exit fi fi #Checking cairo... if [ ! -f /var/cache/ulfs-packages/cairo ]; then echo "Dependance \"cairo\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/cairo/install -O - | bash if [ ! -f /var/cache/ulfs-packages/cairo ]; then echo "Dependance \"cairo\" is not installed. Exiting..." exit fi fi #Checking pango... if [ ! -f /var/cache/ulfs-packages/pango ]; then echo "Dependance \"pango\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/pango/install -O - | bash if [ ! -f /var/cache/ulfs-packages/pango ]; then echo "Dependance \"pango\" is not installed. Exiting..." exit fi fi #Checking libcroco... if [ ! -f /var/cache/ulfs-packages/libcroco ]; then echo "Dependance \"libcroco\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libcroco/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libcroco ]; then echo "Dependance \"libcroco\" is not installed. Exiting..." exit fi fi #Checking librsvg... if [ ! -f /var/cache/ulfs-packages/librsvg ]; then echo "Dependance \"librsvg\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/librsvg/install -O - | bash if [ ! -f /var/cache/ulfs-packages/librsvg ]; then echo "Dependance \"librsvg\" is not installed. Exiting..." exit fi fi #Checking libwebp... if [ ! -f /var/cache/ulfs-packages/libwebp ]; then echo "Dependance \"libwebp\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libwebp/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libwebp ]; then echo "Dependance \"libwebp\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/netsurf/download.time #Downloading source package archive... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/n/netsurf-all-3.11.tar.gz.md5sum wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/n/netsurf-all-3.11.tar.gz #Checking source package file existance if [ ! -f netsurf-all-3.11.tar.gz ]; then echo "Error: Can't find netsurf-all-3.11.tar.gz. Exiting!" exit fi #Checking source package file checksum if [ -f netsurf-all-3.11.tar.gz.md5sum ]; then MD5=`LANG=C md5sum -c netsurf-all-3.11.tar.gz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of netsurf-all-3.11.tar.gz is wrong. Exiting!" exit fi fi #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/netsurf/cleanup.time rm -rfv /sources/netsurf-all-3.11/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/netsurf/unpack.time #Extracting tar source package archive with default parameters... tar -xf netsurf-all-3.11.tar.gz #Checking package directory size after unpack... du -s netsurf-all-3.11 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/netsurf/unpack.size #Going to source package directory... cd netsurf-all-3.11 #Saving configuration timestamp date +%s > /var/log/ulfs-packages/netsurf/configure.time #Sleep 1 second sleep 1 if [[ "$ULFS_PKG_DATERESET" == "YES" ]] then #Changing all files creation time (except build configuration files) in source directory to find them after installation find /sources/netsurf-all-3.11 \! -path "*/configure*" \! -path "*/Makefile*" \! -path "*.make" \! -path "*.m4" \! -path "*.am" \! -path "*.mk" \! -path "*.stamp" \! -path "*gentpl.py" -exec touch -m {} + fi #Running configuration script... echo "checking config file" if [ -f $ULFS_CONFIG_FILE ] then echo "loading config file $ULFS_CONFIG_FILE..." . $ULFS_CONFIG_FILE fi cat > ulfs_configure.sh << EOIS echo "Initializing distributed build environment... " if [[ "\$ULFS_ICECC" == "YES" ]] then export PATH="\$ULFS_ICECC_PATH:\$PATH" echo "ICECC" fi echo "Environment debug..." echo "PATH: \$PATH" echo "MAKEFLAGS: \$MAKEFLAGS" echo "NINJAJOBS: \$NINJAJOBS" env | grep ULFS # EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/netsurf/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/netsurf/build.time #Running build script... echo "checking config file" if [ -f $ULFS_CONFIG_FILE ] then echo "loading config file $ULFS_CONFIG_FILE..." . $ULFS_CONFIG_FILE fi cat > ulfs_build.sh << EOIS echo "Initializing distributed build environment... " if [[ "\$ULFS_ICECC" == "YES" ]] then export PATH="\$ULFS_ICECC_PATH:\$PATH" echo "ICECC" fi echo "Environment debug..." echo "PATH: \$PATH" echo "MAKEFLAGS: \$MAKEFLAGS" echo "NINJAJOBS: \$NINJAJOBS" env | grep ULFS make PREFIX=/usr TARGET=gtk3 NETSURF_UA_FORMAT_STRING='"Mozilla/5.0 (ULFS; %s) NetSurf/%d.%d"' EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/netsurf/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/netsurf/install.time #Running install script... cat > ulfs_install.sh << EOIS make PREFIX=/usr TARGET=gtk3 install cat > /usr/share/applications/netsurf.desktop << EOF [Desktop Entry] Name=NetSurf Comment=Simple & lightweight Web-browser Exec=/usr/bin/netsurf-gtk3 Terminal=false Type=Application Icon=/usr/share/netsurf/netsurf.xpm Categories=Network EOF EOIS USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/netsurf/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/netsurf/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/netsurf/finish.time #Checking package directory size after unpack... cd /sources du -s netsurf-all-3.11 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/netsurf/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/netsurf/files.txt ]; then rm /var/log/ulfs-packages/netsurf/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /sbin -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /usr -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /etc -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /opt -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /lib -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt find /var -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time \! -path "/var/log/ulfs-packages/netsurf/*" >> /var/log/ulfs-packages/netsurf/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time >> /var/log/ulfs-packages/netsurf/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/netsurf/configure.time \! -newer /var/log/ulfs-packages/netsurf/finish.time \! -path "/var/log/ulfs-packages/netsurf/*" >> /var/log/ulfs-packages/netsurf/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/netsurf else sudo touch /var/cache/ulfs-packages/netsurf fi #Calculate delta size a=`cat /var/log/ulfs-packages/netsurf/unpack.size` b=`cat /var/log/ulfs-packages/netsurf/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/netsurf/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/netsurf/start.time` b=`cat /var/log/ulfs-packages/netsurf/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/netsurf/download.time` b=`cat /var/log/ulfs-packages/netsurf/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/netsurf/configure.time` b=`cat /var/log/ulfs-packages/netsurf/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/netsurf/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: netsurf" echo "Release: 0.2.2" echo "Build size: $c" echo "Prepare time: $dp sec." echo "Download time: $dd sec." echo "Build time: $db sec." #End of script