#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.2.2 # Package: qt5 #=========================== # DB commit: 48bb9ee31306c82c48dfaaad707eb4f6a926eb8a # APP commit: 1ca4178aea919e4c9e869e3d650ff8af9678bd6f #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: qt5" 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/qt5/ #Saving start timestamp date +%s > /var/log/ulfs-packages/qt5/start.time #Going to source directory... cd /sources #Checking dependances... #Checking icu... if [ ! -f /var/cache/ulfs-packages/icu ]; then echo "Dependance \"icu\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/icu/install -O - | bash if [ ! -f /var/cache/ulfs-packages/icu ]; then echo "Dependance \"icu\" 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 make-ca... if [ ! -f /var/cache/ulfs-packages/make-ca ]; then echo "Dependance \"make-ca\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/make-ca/install -O - | bash if [ ! -f /var/cache/ulfs-packages/make-ca ]; then echo "Dependance \"make-ca\" 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 xcb-util-image... if [ ! -f /var/cache/ulfs-packages/xcb-util-image ]; then echo "Dependance \"xcb-util-image\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/xcb-util-image/install -O - | bash if [ ! -f /var/cache/ulfs-packages/xcb-util-image ]; then echo "Dependance \"xcb-util-image\" is not installed. Exiting..." exit fi fi #Checking xcb-util-keysyms... if [ ! -f /var/cache/ulfs-packages/xcb-util-keysyms ]; then echo "Dependance \"xcb-util-keysyms\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/xcb-util-keysyms/install -O - | bash if [ ! -f /var/cache/ulfs-packages/xcb-util-keysyms ]; then echo "Dependance \"xcb-util-keysyms\" is not installed. Exiting..." exit fi fi #Checking xcb-util-renderutil... if [ ! -f /var/cache/ulfs-packages/xcb-util-renderutil ]; then echo "Dependance \"xcb-util-renderutil\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/xcb-util-renderutil/install -O - | bash if [ ! -f /var/cache/ulfs-packages/xcb-util-renderutil ]; then echo "Dependance \"xcb-util-renderutil\" is not installed. Exiting..." exit fi fi #Checking xcb-util-wm... if [ ! -f /var/cache/ulfs-packages/xcb-util-wm ]; then echo "Dependance \"xcb-util-wm\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/xcb-util-wm/install -O - | bash if [ ! -f /var/cache/ulfs-packages/xcb-util-wm ]; then echo "Dependance \"xcb-util-wm\" is not installed. Exiting..." exit fi fi #Checking wayland... if [ ! -f /var/cache/ulfs-packages/wayland ]; then echo "Dependance \"wayland\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/wayland/install -O - | bash if [ ! -f /var/cache/ulfs-packages/wayland ]; then echo "Dependance \"wayland\" is not installed. Exiting..." exit fi fi #Checking mesa... if [ ! -f /var/cache/ulfs-packages/mesa ]; then echo "Dependance \"mesa\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/mesa/install -O - | bash if [ ! -f /var/cache/ulfs-packages/mesa ]; then echo "Dependance \"mesa\" 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 mtdev... if [ ! -f /var/cache/ulfs-packages/mtdev ]; then echo "Dependance \"mtdev\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/mtdev/install -O - | bash if [ ! -f /var/cache/ulfs-packages/mtdev ]; then echo "Dependance \"mtdev\" 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 tiff... if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/tiff/install -O - | bash if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" is not installed. Exiting..." exit fi fi #Checking sqlite... if [ ! -f /var/cache/ulfs-packages/sqlite ]; then echo "Dependance \"sqlite\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/sqlite/install -O - | bash if [ ! -f /var/cache/ulfs-packages/sqlite ]; then echo "Dependance \"sqlite\" is not installed. Exiting..." exit fi fi #Checking libxkbcommon... if [ ! -f /var/cache/ulfs-packages/libxkbcommon ]; then echo "Dependance \"libxkbcommon\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/libxkbcommon/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libxkbcommon ]; then echo "Dependance \"libxkbcommon\" is not installed. Exiting..." exit fi fi #Checking alsa-lib... if [ ! -f /var/cache/ulfs-packages/alsa-lib ]; then echo "Dependance \"alsa-lib\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/alsa-lib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/alsa-lib ]; then echo "Dependance \"alsa-lib\" is not installed. Exiting..." exit fi fi #Checking gst-plugins-base... if [ ! -f /var/cache/ulfs-packages/gst-plugins-base ]; then echo "Dependance \"gst-plugins-base\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/gst-plugins-base/install -O - | bash if [ ! -f /var/cache/ulfs-packages/gst-plugins-base ]; then echo "Dependance \"gst-plugins-base\" 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 #Checking which... if [ ! -f /var/cache/ulfs-packages/which ]; then echo "Dependance \"which\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/which/install -O - | bash if [ ! -f /var/cache/ulfs-packages/which ]; then echo "Dependance \"which\" is not installed. Exiting..." exit fi fi #Checking cups... if [ ! -f /var/cache/ulfs-packages/cups ]; then echo "Dependance \"cups\" not found. Trying to install..."; wget --no-check-certificate https://umvirt.com/linux/packages//0.2.2/cups/install -O - | bash if [ ! -f /var/cache/ulfs-packages/cups ]; then echo "Dependance \"cups\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/qt5/download.time #Downloading source package archive... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/q/qt-everywhere-opensource-src-5.15.14.tar.xz.md5sum wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/packages/q/qt-everywhere-opensource-src-5.15.14.tar.xz #Checking source package file existance if [ ! -f qt-everywhere-opensource-src-5.15.14.tar.xz ]; then echo "Error: Can't find qt-everywhere-opensource-src-5.15.14.tar.xz. Exiting!" exit fi #Checking source package file checksum if [ -f qt-everywhere-opensource-src-5.15.14.tar.xz.md5sum ]; then MD5=`LANG=C md5sum -c qt-everywhere-opensource-src-5.15.14.tar.xz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of qt-everywhere-opensource-src-5.15.14.tar.xz is wrong. Exiting!" exit fi fi #Downloadning patches... wget --no-check-certificate -nc https://umvirt.com/linux/downloads/0.2.2/patches/qt-everywhere-opensource-src-5.15.14-kf5-1.patch #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/qt5/cleanup.time rm -rfv /sources/qt-everywhere-src-5.15.14/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/qt5/unpack.time #Extracting tar source package archive with default parameters... tar -xf qt-everywhere-opensource-src-5.15.14.tar.xz #Checking package directory size after unpack... du -s qt-everywhere-src-5.15.14 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/qt5/unpack.size #Going to source package directory... cd qt-everywhere-src-5.15.14 #Applying patches... patch -Np1 -i ../qt-everywhere-opensource-src-5.15.14-kf5-1.patch #Saving configuration timestamp date +%s > /var/log/ulfs-packages/qt5/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/qt-everywhere-src-5.15.14 \! -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 export QT5PREFIX=/opt/qt5 mkdir -pv qtbase/.git ls -Fd qt* | grep / | sed 's/^/-skip /;s@/@@' > tempconf && sed -i -r '/base|tools|x11extras|svg|declarative|wayland/d' tempconf ./configure -prefix \$QT5PREFIX \\ -sysconfdir /etc/xdg \\ -confirm-license \\ -opensource \\ -dbus-linked \\ -openssl-linked \\ -system-harfbuzz \\ -system-sqlite \\ -nomake examples \\ -no-rpath \\ -journald \\ \$(cat tempconf) EOIS cat ulfs_configure.sh | bash 2>&1 | tee /var/log/ulfs-packages/qt5/configure.log #Saving build timestamp date +%s > /var/log/ulfs-packages/qt5/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 EOIS cat ulfs_build.sh | bash 2>&1 | tee /var/log/ulfs-packages/qt5/build.log #Saving install timestamp date +%s > /var/log/ulfs-packages/qt5/install.time #Running install script... cat > ulfs_install.sh << EOIS export QT5PREFIX=/opt/qt5 make install find \$QT5PREFIX/ -name \*.prl \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; QT5BINDIR=\$QT5PREFIX/bin install -v -dm755 /usr/share/pixmaps/ && install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png \ /usr/share/pixmaps/assistant-qt5.png && install -v -Dm644 qttools/src/designer/src/designer/images/designer.png \ /usr/share/pixmaps/designer-qt5.png && install -v -Dm644 qttools/src/linguist/linguist/images/icons/linguist-128-32.png \ /usr/share/pixmaps/linguist-qt5.png && install -v -Dm644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \ /usr/share/pixmaps/qdbusviewer-qt5.png && install -dm755 /usr/share/applications && cat > /usr/share/applications/assistant-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Assistant Comment=Shows Qt5 documentation and examples Exec=\$QT5BINDIR/assistant Icon=assistant-qt5.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Documentation; EOF cat > /usr/share/applications/designer-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Designer GenericName=Interface Designer Comment=Design GUIs for Qt5 applications Exec=\$QT5BINDIR/designer Icon=designer-qt5.png MimeType=application/x-designer; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/linguist-qt5.desktop << EOF [Desktop Entry] Name=Qt5 Linguist Comment=Add translations to Qt5 applications Exec=\$QT5BINDIR/linguist Icon=linguist-qt5.png MimeType=text/vnd.trolltech.linguist;application/x-linguist; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/qdbusviewer-qt5.desktop << EOF [Desktop Entry] Name=Qt5 QDbusViewer GenericName=D-Bus Debugger Comment=Debug D-Bus applications Exec=\$QT5BINDIR/qdbusviewer Icon=qdbusviewer-qt5.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Debugger; EOF for file in moc uic rcc qmake lconvert lrelease lupdate; do ln -sfvn \$QT5BINDIR/\$file /usr/bin/\$file-qt5 done cat > /etc/sudoers.d/qt << "EOF" Defaults env_keep += QT5DIR EOF cat >> /etc/ld.so.conf << EOF # Begin Qt addition /opt/qt5/lib # End Qt addition EOF ldconfig cat > /etc/profile.d/qt_5.sh << "EOF" # Begin /etc/profile.d/qt_5.sh QT5DIR=/opt/qt5 pathappend \$QT5DIR/bin PATH pathappend \$QT5DIR/lib/pkgconfig PKG_CONFIG_PATH export QT5DIR # End /etc/profile.d/qt_5.sh EOF EOIS USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/qt5/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/qt5/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/qt5/finish.time #Checking package directory size after unpack... cd /sources du -s qt-everywhere-src-5.15.14 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/qt5/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/qt5/files.txt ]; then rm /var/log/ulfs-packages/qt5/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /sbin -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /usr -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /etc -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /opt -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /lib -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt find /var -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time \! -path "/var/log/ulfs-packages/qt5/*" >> /var/log/ulfs-packages/qt5/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time >> /var/log/ulfs-packages/qt5/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/qt5/configure.time \! -newer /var/log/ulfs-packages/qt5/finish.time \! -path "/var/log/ulfs-packages/qt5/*" >> /var/log/ulfs-packages/qt5/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/qt5 else sudo touch /var/cache/ulfs-packages/qt5 fi #Calculate delta size a=`cat /var/log/ulfs-packages/qt5/unpack.size` b=`cat /var/log/ulfs-packages/qt5/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/qt5/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/qt5/start.time` b=`cat /var/log/ulfs-packages/qt5/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/qt5/download.time` b=`cat /var/log/ulfs-packages/qt5/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/qt5/configure.time` b=`cat /var/log/ulfs-packages/qt5/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/qt5/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: qt5" 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