#!/bin/bash #=========================== # UMVIRT LINUX FROM SCRATCH #=========================== # Compilation script. # Network mode. #=========================== # Release: 0.1 # Package: qt4 #=========================== # DB commit: d35a620850806ab581b32cb34d268a904c9c0a5f # APP commit: #=========================== echo "ULFS Package installation start" echo "===============================" echo "Package: qt4" echo "Release: 0.1" 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/qt4/ #Saving start timestamp date +%s > /var/log/ulfs-packages/qt4/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..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/glib/install -O - | bash if [ ! -f /var/cache/ulfs-packages/glib ]; then echo "Dependance \"glib\" 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://ulfs.org/linux/packages//0.1/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://ulfs.org/linux/packages//0.1/libpng/install -O - | bash if [ ! -f /var/cache/ulfs-packages/libpng ]; then echo "Dependance \"libpng\" 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://ulfs.org/linux/packages//0.1/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://ulfs.org/linux/packages//0.1/tiff/install -O - | bash if [ ! -f /var/cache/ulfs-packages/tiff ]; then echo "Dependance \"tiff\" 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..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/icu/install -O - | bash if [ ! -f /var/cache/ulfs-packages/icu ]; then echo "Dependance \"icu\" is not installed. Exiting..." exit fi fi #Checking dbus... if [ ! -f /var/cache/ulfs-packages/dbus ]; then echo "Dependance \"dbus\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/dbus/install -O - | bash if [ ! -f /var/cache/ulfs-packages/dbus ]; then echo "Dependance \"dbus\" 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://ulfs.org/linux/packages//0.1/sqlite/install -O - | bash if [ ! -f /var/cache/ulfs-packages/sqlite ]; then echo "Dependance \"sqlite\" 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://ulfs.org/linux/packages//0.1/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 X... if [ ! -f /var/cache/ulfs-packages/X ]; then echo "Dependance \"X\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/X/install -O - | bash if [ ! -f /var/cache/ulfs-packages/X ]; then echo "Dependance \"X\" is not installed. Exiting..." exit fi fi #Checking openssl... if [ ! -f /var/cache/ulfs-packages/openssl ]; then echo "Dependance \"openssl\" not found. Trying to install..."; wget --no-check-certificate https://ulfs.org/linux/packages//0.1/openssl/install -O - | bash if [ ! -f /var/cache/ulfs-packages/openssl ]; then echo "Dependance \"openssl\" is not installed. Exiting..." exit fi fi #Saving downloading timestamp date +%s > /var/log/ulfs-packages/qt4/download.time #Downloading source package archive... wget --no-check-certificate -nc https://ulfs.org/linux/downloads/package_files/0.1/packages/q/qt-everywhere-opensource-src-4.8.7.tar.gz.md5sum wget --no-check-certificate -nc https://ulfs.org/linux/downloads/package_files/0.1/packages/q/qt-everywhere-opensource-src-4.8.7.tar.gz #Checking source package file existance if [ ! -f qt-everywhere-opensource-src-4.8.7.tar.gz ]; then echo "Error: Can't find qt-everywhere-opensource-src-4.8.7.tar.gz. Exiting!" exit fi #Checking source package file checksum if [ -f qt-everywhere-opensource-src-4.8.7.tar.gz.md5sum ]; then MD5=`LANG=C md5sum -c qt-everywhere-opensource-src-4.8.7.tar.gz.md5sum | grep OK` if [ "$MD5" == "" ] ; then echo "Error: Checksum of qt-everywhere-opensource-src-4.8.7.tar.gz is wrong. Exiting!" exit fi fi #Downloadning patches... wget --no-check-certificate -nc https://ulfs.org/linux/downloads/package_files/0.1/patches/qt-everywhere-opensource-src-4.8.7-gcc6.patch #Saving cleanup timestamp date +%s > /var/log/ulfs-packages/qt4/cleanup.time rm -rfv /sources/qt-everywhere-opensource-src-4.8.7/ #Saving extracting timestamp date +%s > /var/log/ulfs-packages/qt4/unpack.time #Extracting tar source package archive with default parameters... tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz #Checking package directory size after unpack... du -s qt-everywhere-opensource-src-4.8.7 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/qt4/unpack.size #Going to source package directory... cd qt-everywhere-opensource-src-4.8.7 #Applying patches... patch -Np -i ../qt-everywhere-opensource-src-4.8.7-gcc6.patch #Saving configuration timestamp date +%s > /var/log/ulfs-packages/qt4/configure.time #Sleep 1 second sleep 1 #Running configuration script... export QT4PREFIX=/opt/qt4 export QT4BINDIR=\$QT4PREFIX/bin CXXFLAGS="\$CXXFLAGS -std=gnu++98" CXXFLAGS="\$CXXFLAGS -Wno-deprecated" export CXXFLAGS sed -i -e '631a if (image->isNull()) { state = Error; return -1; }' \ src/gui/image/qgifhandler.cpp sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \ config.tests/unix/libmng/libmng.cpp && sed -i '/CONFIG -/ a\isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..' \ src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro && ./configure -prefix \$QT4PREFIX \ -sysconfdir /etc/xdg \ -bindir \$QT4BINDIR \ -plugindir \$QT4PREFIX/lib/qt4/plugins \ -importdir \$QT4PREFIX/lib/qt4/imports \ -headerdir \$QT4PREFIX/include/qt4 \ -datadir \$QT4PREFIX/share/qt4 \ -docdir \$QT4PREFIX/share/doc/qt4 \ -translationdir \$QT4PREFIX/share/qt4/translations \ -demosdir \$QT4PREFIX/share/doc/qt4/demos \ -examplesdir \$QT4PREFIX/share/doc/qt4/examples \ -no-webkit \ -no-javascript-jit \ -confirm-license \ -opensource \ -release \ -dbus-linked \ -openssl-linked \ -system-sqlite \ -no-phonon \ -no-phonon-backend \ -no-openvg \ -nomake demos \ -nomake examples \ -no-openssl \ -optimized-qmake #Saving build timestamp date +%s > /var/log/ulfs-packages/qt4/build.time #Running build script... make #Saving install timestamp date +%s > /var/log/ulfs-packages/qt4/install.time #Running install script... cat > ulfs_install.sh << EOIS find . -name "*.pc" -exec perl -pi -e "s, -L\$PWD/?\S+,,g" {} \; make install for file in 3Support CLucene Core DBus Declarative DesignerComponents \ Designer Gui Help Multimedia Network OpenGL Script \ ScriptTools Sql Svg Test UiTools WebKit XmlPatterns Xml phonon; do [ -e \$QT4PREFIX/lib/libQt\${file}.prl ] && sed -r '/^QMAKE_PRL_BUILD_DIR/d;s/(QMAKE_PRL_LIBS =).*/\1/' \ -i \$QT4PREFIX/lib/libQt\${file}.prl done unset file install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \ /usr/share/pixmaps/qt4logo.png && install -v -Dm644 tools/assistant/tools/assistant/images/assistant-128.png \ /usr/share/pixmaps/assistant-qt4.png && install -v -Dm644 tools/designer/src/designer/images/designer.png \ /usr/share/pixmaps/designer-qt4.png && install -v -Dm644 tools/linguist/linguist/images/icons/linguist-128-32.png \ /usr/share/pixmaps/linguist-qt4.png && install -v -Dm644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \ /usr/share/pixmaps/qdbusviewer-qt4.png && install -v -dm755 /usr/share/applications && cat > /usr/share/applications/assistant-qt4.desktop << EOF [Desktop Entry] Name=Qt4 Assistant Comment=Shows Qt4 documentation and examples Exec=\$QT4BINDIR/assistant Icon=assistant-qt4.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Documentation; EOF cat > /usr/share/applications/designer-qt4.desktop << EOF [Desktop Entry] Name=Qt4 Designer Comment=Design GUIs for Qt4 applications Exec=\$QT4BINDIR/designer Icon=designer-qt4.png MimeType=application/x-designer; Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development; EOF cat > /usr/share/applications/linguist-qt4.desktop << EOF [Desktop Entry] Name=Qt4 Linguist Comment=Add translations to Qt4 applications Exec=\$QT4BINDIR/linguist Icon=linguist-qt4.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-qt4.desktop << EOF [Desktop Entry] Name=Qt4 QDbusViewer GenericName=D-Bus Debugger Comment=Debug D-Bus applications Exec=\$QT4BINDIR/qdbusviewer Icon=qdbusviewer-qt4.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Development;Debugger; EOF cat > /usr/share/applications/qtconfig-qt4.desktop << EOF [Desktop Entry] Name=Qt4 Config Comment=Configure Qt4 behavior, styles, fonts Exec=\$QT4BINDIR/qtconfig Icon=qt4logo.png Terminal=false Encoding=UTF-8 Type=Application Categories=Qt;Settings; EOF EOIS USER=`whoami` if [ "$USER" == "root" ] ; then cat ulfs_install.sh | bash 2>&1 | tee /var/log/ulfs-packages/qt4/install.log else cat ulfs_install.sh | sudo bash 2>&1 | tee /var/log/ulfs-packages/qt4/install.log fi #Saving finish timestamp date +%s > /var/log/ulfs-packages/qt4/finish.time #Checking package directory size after unpack... cd /sources du -s qt-everywhere-opensource-src-4.8.7 | awk 'NR==1 {print $1}' > /var/log/ulfs-packages/qt4/install.size echo "ULFS package installation completed." #Producing files list echo "Looking for installed files..." if [ -f /var/log/ulfs-packages/qt4/files.txt ]; then rm /var/log/ulfs-packages/qt4/files.txt fi USER=`whoami` if [ "$USER" == "root" ] ; then find /bin -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /sbin -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /usr -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /etc -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /opt -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /lib -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /lib64 -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt find /var -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time \! -path "/var/log/ulfs-packages/qt4/*" >> /var/log/ulfs-packages/qt4/files.txt else sudo find /bin -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /sbin -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /usr -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /etc -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /opt -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /lib -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /lib64 -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time >> /var/log/ulfs-packages/qt4/files.txt sudo find /var -type f -newer /var/log/ulfs-packages/qt4/configure.time \! -newer /var/log/ulfs-packages/qt4/finish.time \! -path "/var/log/ulfs-packages/qt4/*" >> /var/log/ulfs-packages/qt4/files.txt fi #Marking package as installed... mkdir -p /var/cache/ulfs-packages USER=`whoami` if [ "$USER" == "root" ] ; then touch /var/cache/ulfs-packages/qt4 else sudo touch /var/cache/ulfs-packages/qt4 fi #Calculate delta size a=`cat /var/log/ulfs-packages/qt4/unpack.size` b=`cat /var/log/ulfs-packages/qt4/install.size` c=$(($b-$a)) echo $c > /var/log/ulfs-packages/qt4/delta.size #Calculate prepare time a=`cat /var/log/ulfs-packages/qt4/start.time` b=`cat /var/log/ulfs-packages/qt4/configure.time` dp=$(($b-$a)) #Calculate download time a=`cat /var/log/ulfs-packages/qt4/download.time` b=`cat /var/log/ulfs-packages/qt4/unpack.time` dd=$(($b-$a)) #Calculate delta time a=`cat /var/log/ulfs-packages/qt4/configure.time` b=`cat /var/log/ulfs-packages/qt4/finish.time` db=$(($b-$a)) echo $db > /var/log/ulfs-packages/qt4/delta.time #Report echo "" echo "ULFS Package installation report" echo "================================" echo "Package: qt4" 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