#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.1 # Package: qt5 #=========================== # DB commit: d35a620850806ab581b32cb34d268a904c9c0a5f # APP commit: f0568a86eced844506f88e1faa2e7a1c73783ddf #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: qt5" echo "Release: 0.1" echo "Install with chimp: NO" downloadFile() { local filename=$1 echo "Downloading $filename ..." if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl -k -O $filename else wget --no-check-certificate -nc $filename fi } echo "loading environment settings(profile)" . /etc/profile 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 glib... if [ ! -f /var/cache/ulfs-packages/glib ]; then echo "Dependance \"glib\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/glib/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/glib/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/glib ]; then echo "Dependance \"glib\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/xcb-util-image/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/xcb-util-image/install -O - | bash fi 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/xcb-util-keysyms/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/xcb-util-keysyms/install -O - | bash fi 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/xcb-util-renderutil/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/xcb-util-renderutil/install -O - | bash fi 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/xcb-util-wm/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/xcb-util-wm/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/xcb-util-wm ]; then echo "Dependance \"xcb-util-wm\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/mesa/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/mesa/install -O - | bash fi 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/libpng/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/libpng/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/wayland/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/wayland/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/wayland ]; then echo "Dependance \"wayland\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/libjpeg-turbo/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/libjpeg-turbo/install -O - | bash fi 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/tiff/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/tiff/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" is not installed. Exiting..." exit fi fi #Checking harfbuzz... if [ ! -f /var/cache/ulfs-packages/harfbuzz ]; then echo "Dependance \"harfbuzz\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/harfbuzz/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/harfbuzz/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/harfbuzz ]; then echo "Dependance \"harfbuzz\" is not installed. Exiting..." exit fi fi #Checking icu... if [ ! -f /var/cache/ulfs-packages/icu ]; then echo "Dependance \"icu\" not found. Trying to install..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/icu/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/icu/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/icu ]; then echo "Dependance \"icu\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/mtdev/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/mtdev/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/mtdev ]; then echo "Dependance \"mtdev\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/make-ca/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/make-ca/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/make-ca ]; then echo "Dependance \"make-ca\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/libxkbcommon/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/libxkbcommon/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/libxkbcommon ]; then echo "Dependance \"libxkbcommon\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/sqlite/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/sqlite/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/sqlite ]; then echo "Dependance \"sqlite\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/pcre2/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/pcre2/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/pcre2 ]; then echo "Dependance \"pcre2\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/gst-plugins-base/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/gst-plugins-base/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/gst-plugins-base ]; then echo "Dependance \"gst-plugins-base\" 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..."; if [[ "$ULFS_DOWNLOAD_APP" == "curl" ]]; then curl https://umvirt.com/linux/packages//0.1/alsa-lib/install -k | bash else wget --no-check-certificate https://umvirt.com/linux/packages//0.1/alsa-lib/install -O - | bash fi if [ ! -f /var/cache/ulfs-packages/alsa-lib ]; then echo "Dependance \"alsa-lib\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/qt5/download.time #Downloading source package archive... downloadFile https://umvirt.com/linux/downloads/0.1/packages/q/qt-everywhere-src-5.13.2.tar.xz.md5sum downloadFile https://umvirt.com/linux/downloads/0.1/packages/q/qt-everywhere-src-5.13.2.tar.xz #Checking source package file existance if [ ! -f qt-everywhere-src-5.13.2.tar.xz ]; then echo "Error: Can't find qt-everywhere-src-5.13.2.tar.xz. Exiting!" exit fi #Checking source package file checksum if [ -f qt-everywhere-src-5.13.2.tar.xz.md5sum ]; then MD5=`LANG=C md5sum -c qt-everywhere-src-5.13.2.tar.xz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of qt-everywhere-src-5.13.2.tar.xz is wrong. Exiting!" exit fi fi #Downloadning patches... downloadFile https://umvirt.com/linux/downloads/0.1/patches/qt-5.11.1-glibc228-1.patch #Checking patch file existance if [ ! -f qt-5.11.1-glibc228-1.patch ]; then echo -e "Error: Can't find patch \"qt-5.11.1-glibc228-1.patch\". Exiting!" exit fi #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/qt5/cleanup.time rm -rfv /sources/qt-everywhere-src-5.13.2/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/qt5/unpack.time #Extracting tar source package archive with default parameters... tar -xf qt-everywhere-src-5.13.2.tar.xz #Checking package directory size after unpack... du -s qt-everywhere-src-5.13.2 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/qt5/unpack.size #Going to source package directory... cd qt-everywhere-src-5.13.2 #Applying patches... patch -Np -i ../qt-5.11.1-glibc228-1.patch #Saving configuration timestamp date +%s > /var/log/ulfs-packages/qt5/configure.time #Sleep 1 second sleep 1 #Running configuration script... export QT5PREFIX=/opt/qt5 ./configure -prefix \$QT5PREFIX \ -sysconfdir /etc/xdg \ -confirm-license \ -opensource \ -dbus-linked \ -openssl-linked \ -system-harfbuzz \ -system-sqlite \ -nomake examples \ -no-rpath \ -skip qtwebengine #Saving build timestamp date +%s > /var/log/ulfs-packages/qt5/build.time #Running build script... make #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 -sfrvn \$QT5BINDIR/\$file /usr/bin/\$file-qt5 done cat >> /etc/ld.so.conf << EOF # Begin Qt addition /opt/qt5/lib # End Qt addition EOF ldconfig cat > /etc/profile.d/qt5.sh << "EOF" # Begin /etc/profile.d/qt5.sh QT5DIR=/opt/qt5 pathappend \$QT5DIR/bin PATH pathappend \$QT5DIR/lib/pkgconfig PKG_CONFIG_PATH export QT5DIR # End /etc/profile.d/qt5.sh EOF . /etc/profile EOIS echo "/sbin/ldconfig" >> ulfs_install.sh 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.13.2 | 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 \! -path /etc/ld.so.cache >> /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/*" \! -path /var/cache/ldconfig/aux-cache >> /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 \! -path /etc/ld.so.cache >> /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/*" \! -path /var/cache/ldconfig/aux-cache >> /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.1" echo "Build size: $c" echo "Prepare time: $dp sec." echo "Download time: $dd sec." echo "Build time: $db sec." #End of script