diff --git a/dev/linux/build_installer_64_bits b/dev/linux/build_installer_64_bits index 0fd7b9c3..8d0e2210 100755 --- a/dev/linux/build_installer_64_bits +++ b/dev/linux/build_installer_64_bits @@ -1,9 +1,29 @@ #!/bin/bash -if [[ $LOG4CPP_HOME != *"null"* ]]; then - echo "Releases require log4cpp_null rather than log4cpp. Stopping" - exit -fi +function checkMakeselfVersion() +{ + # Parse 'Makeself version #.#.#' to verify that makeself issue #32 is fixed so permissions + # of files/directories outside of the engauge install directory are not changed. Version + # 2.2.0 is known bad and version 2.4.0 is known good + MAJORGOT=`makeself -v | awk '{print $3}' | awk -F. '{print $1}'` + MINORGOT=`makeself -v | awk '{print $3}' | awk -F. '{print $2}'` + REVISIONGOT=`makeself -v | awk '{print $3}' | awk -F. '{print $3}'` + MAJORWANTED=2 + MINORWANTED=4 + REVISIONWANTED=0 + BAD=0 + if [ "$MAJORGOT" -lt "$MAJORWANTED" ]; then + BAD=1 + elif [ "$MAJORGOT" -eq "$MAJORWANTED" ] && [ "$MINORGOT" -lt "$MINORWANTED" ]; then + BAD=1 + fi + if (( $BAD )); then + echo "Releases require makeself version $MAJORWANTED.$MINORWANTED.$REVISIONWANTED or newer so issue #32 is fixed. Stopping" + exit + fi +} + +checkMakeselfVersion export FROMQCH="$HOME/engauge-digitizer/bin/documentation/engauge.qch" export FROMQHC="$HOME/engauge-digitizer/bin/documentation/engauge.qhc" @@ -25,7 +45,7 @@ read -p 'If the version numbers are correct, press Enter to continue' VERSION_NUMBER_CODE=`echo $VERSION_NUMBER_CODE | sed 's/\./_/g'` export STAGINGDIR=engauge -export TRANSLATIONSDIR=engauge/translations +export TRANSLATIONSDIR=$STAGINGDIR/translations export DOCDIR=$STAGINGDIR/documentation export IMAGEDIR=$STAGINGDIR/imageformats export PLATFORMSDIR=$STAGINGDIR/platforms @@ -80,8 +100,6 @@ cp $HOME/Qt5.8/5.8/gcc_64/lib/libicui18n.so.56 $STAGINGDIR cp $HOME/Qt5.8/5.8/gcc_64/lib/libicuuc.so.56 $STAGINGDIR cp $HOME/Qt5.8/5.8/gcc_64/lib/libQt5XcbQpa.so.5 $STAGINGDIR cp /usr/lib/x86_64-linux-gnu/libGL.so $STAGINGDIR -cp $LOG4CPP_HOME/lib/liblog4cpp.so $STAGINGDIR -cp $LOG4CPP_HOME/lib/liblog4cpp.so.1 $STAGINGDIR cp $POPPLER_LIB/libpoppler.so $STAGINGDIR cp $POPPLER_LIB/libpoppler.so.66 $STAGINGDIR cp $POPPLER_LIB/libpoppler-cpp.so $STAGINGDIR @@ -103,7 +121,7 @@ cp $HOME/Qt5.8/5.8/gcc_64/plugins/sqldrivers/libqsqlite.so $SQLDIR echo "***Rebuilding release executable" && export ENGAUGE_RELEASE=1 && cd ../.. && -qmake engauge.pro CONFIG+=pdf && +qmake engauge.pro CONFIG+=pdf CONFIG+=log4cpp_null && make clean && make && cd dev/linux diff --git a/dev/linux/build_installer_cross_compile_to_32_bits b/dev/linux/build_installer_cross_compile_to_32_bits index 041d6b99..aec1fca0 100755 --- a/dev/linux/build_installer_cross_compile_to_32_bits +++ b/dev/linux/build_installer_cross_compile_to_32_bits @@ -1,9 +1,29 @@ #!/bin/bash -if [[ $LOG4CPP_HOME != *"null"* ]]; then - echo "Releases require log4cpp_null rather than log4cpp. Stopping" - exit -fi +function checkMakeselfVersion() +{ + # Parse 'Makeself version #.#.#' to verify that makeself issue #32 is fixed so permissions + # of files/directories outside of the engauge install directory are not changed. Version + # 2.2.0 is known bad and version 2.4.0 is known good + MAJORGOT=`makeself -v | awk '{print $3}' | awk -F. '{print $1}'` + MINORGOT=`makeself -v | awk '{print $3}' | awk -F. '{print $2}'` + REVISIONGOT=`makeself -v | awk '{print $3}' | awk -F. '{print $3}'` + MAJORWANTED=2 + MINORWANTED=4 + REVISIONWANTED=0 + BAD=0 + if [ "$MAJORGOT" -lt "$MAJORWANTED" ]; then + BAD=1 + elif [ "$MAJORGOT" -eq "$MAJORWANTED" ] && [ "$MINORGOT" -lt "$MINORWANTED" ]; then + BAD=1 + fi + if (( $BAD )); then + echo "Releases require makeself version $MAJORWANTED.$MINORWANTED.$REVISIONWANTED or newer so issue #32 is fixed. Stopping" + exit + fi +} + +checkMakeselfVersion export FROMQCH="$HOME/engauge-digitizer/bin/documentation/engauge.qch" export FROMQHC="$HOME/engauge-digitizer/bin/documentation/engauge.qhc" @@ -25,7 +45,7 @@ read -p 'If the version numbers are correct, press Enter to continue' VERSION_NUMBER_CODE=`echo $VERSION_NUMBER_CODE | sed 's/\./_/g'` export STAGINGDIR=engauge -export TRANSLATIONSDIR=engauge/translations +export TRANSLATIONSDIR=$STAGINGDIR/translations export DOCDIR=$STAGINGDIR/documentation export IMAGEDIR=$STAGINGDIR/imageformats export PLATFORMSDIR=$STAGINGDIR/platforms @@ -76,8 +96,6 @@ cp /usr/lib/i386-linux-gnu/libfftw3.so.3 $STAGINGDIR cp /usr/lib/i386-linux-gnu/libicudata.so.52 $STAGINGDIR cp /usr/lib/i386-linux-gnu/libicui18n.so.52 $STAGINGDIR cp /usr/lib/i386-linux-gnu/libicuuc.so.52 $STAGINGDIR -cp $LOG4CPP_HOME/lib/liblog4cpp.so $STAGINGDIR -cp $LOG4CPP_HOME/lib/liblog4cpp.so.5 $STAGINGDIR cp $POPPLER_LIB/libpoppler.so $STAGINGDIR cp $POPPLER_LIB/libpoppler.so.61 $STAGINGDIR cp $POPPLER_LIB/libpoppler-cpp.so $STAGINGDIR @@ -100,7 +118,7 @@ cp /usr/lib/i386-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so $SQLDIR echo "***Rebuilding release executable" && export ENGAUGE_RELEASE=1 && cd ../.. && -qmake engauge.pro CONFIG+=pdf && +qmake engauge.pro CONFIG+=pdf CONFIG+=log4cpp_null && make clean && make && cd dev/linux diff --git a/dev/linux/startup_script.run b/dev/linux/startup_script.run index 90a26c0d..81e5f641 100755 --- a/dev/linux/startup_script.run +++ b/dev/linux/startup_script.run @@ -1,18 +1,24 @@ #!/bin/bash -read -e -p "Installation directory [/usr/local/engauge]:" -i "/usr/local/engauge" INSTALLDIR +read -e -p "Installation directory [/usr/local/engauge]: " -i "/usr/local/engauge" INSTALLDIR -PARENTDIR=$INSTALLDIR/.. +if [ -d "$INSTALLDIR" ]; then + echo "Warning: installation directory already exists. This installer will only install into an empty directory. If reinstalling then remove the old installation directory, otherwise append \"/engauge\" or similar to the installation directory" +else + + PARENTDIR=$INSTALLDIR/.. -# First cp duplicates the recursive second cp, but gives a single tidy error about privileges if there is a privilege problem -mkdir -p $INSTALLDIR && -cp engauge $INSTALLDIR && -cp -r . $INSTALLDIR && -EXECEXE=$INSTALLDIR/engauge.exe && -EXECSCRIPT=$INSTALLDIR/engauge && -mv $INSTALLDIR/engauge $EXECEXE && -echo "export LD_LIBRARY_PATH=$INSTALLDIR:$INSTALLDIR/platforms" >$EXECSCRIPT && -echo "$EXECEXE" >>$EXECSCRIPT && -chmod -R 755 $PARENTDIR && -chmod +x $EXECSCRIPT && -echo "Engauge Digitizer has been installed. Your PATH should include $INSTALLDIR" + # First cp duplicates the recursive second cp, but gives a single tidy error about privileges if there is a privilege problem + mkdir -p $INSTALLDIR && + cp engauge $INSTALLDIR && + cp -r . $INSTALLDIR && + EXECEXE=$INSTALLDIR/engauge.exe && + EXECSCRIPT=$INSTALLDIR/engauge && + mv $INSTALLDIR/engauge $EXECEXE && + echo "export LD_LIBRARY_PATH=$INSTALLDIR:$INSTALLDIR/platforms" >$EXECSCRIPT && + echo "$EXECEXE" >>$EXECSCRIPT && + chmod 755 $PARENTDIR && + chmod -R 755 $INSTALLDIR && + chmod +x $EXECSCRIPT && + echo "Engauge Digitizer has been installed. Your PATH should include $INSTALLDIR" +fi