d8ac5e07aaace709a641bf14affbcd9d179c4096
max
  Fri Aug 20 06:35:28 2021 -0700
making GBIC work on Fedora 34, refs #27795

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
index 7b2fd53d..605cbb9 100755
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -658,34 +658,41 @@
     make
 
     #cd hg/htdocs
     #make doInstall destDir=$APACHDIR/htdocs FIND="find ."
     # dbTrash tool needed for trash cleaning
 }
 
 # redhat specific part of mysql and apache installation
 function installRedhat () {
     echo2 
     echo2 Installing EPEL, ghostscript, libpng
     waitKey
     # make sure we have and EPEL and ghostscript and rsync (not installed on vagrant boxes)
     # imagemagick is required for the session gallery
     yum -y update
+
+    # Fedora doesn't have or need EPEL, however, it does not include chkconfig by default
+    if cat /etc/redhat-release | grep edora > /dev/null; then
+	yum -y install chkconfig
+    else
         yum -y install epel-release
+    fi
+
     yum -y install ghostscript rsync ImageMagick R-core curl
 
-    # centos 7 and fedora 20 do not provide libpng by default
+    # centos 7 does not provide libpng by default
     if ldconfig -p | grep libpng12.so > /dev/null; then
         echo2 libpng12 found
     else
         yum -y install libpng12
     fi
     
     # install apache if not installed yet
     if [ ! -f /usr/sbin/httpd ]; then
         echo2
         echo2 Installing Apache and making it start on boot
         waitKey
         yum -y install httpd
         # start apache on boot
         chkconfig --level 2345 httpd on
         # there will be an error message that the apache 
@@ -761,30 +768,41 @@
 
     # MySQL-python is required for hgGeneGraph
     # CentOS up to and including 7 default to python2, so MySQL-python is in the repos
     if yum list MySQL-python 2> /dev/null ; then
             yum -y install MySQL-python
     # Centos 8 defaults to python3 and it does not have a package MySQL-python anymore
     # So we install python2, the mysql libraries and fix up my_config.h manually
     # This is strange, but I was unable to find a different working solution. MariaDB does not have my_config.h
     else
             yum install -y python2 mysql-devel python2-devel wget gcc
             if [ -f /usr/include/mysql/my_config.h ]; then
                     echo my_config.h found
             else
                 wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -P /usr/include/mysql/
             fi
+
+	    # this is very strange, but was necessary on Fedora https://github.com/DefectDojo/django-DefectDojo/issues/407
+	    sed '/st_mysql_options options;/a unsigned int reconnect;' /usr/include/mysql/mysql.h -i.bkp
+
+	    # fedora > 34 doesn't have any pip2 package anymore
+	    if ! type "pip2" > /dev/null; then
+                 wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
+		 python2 get-pip.py
+		 mv /usr/bin/pip /usr/bin/pip2
+
+	    fi
             pip2 install MySQL-python
     fi
 
 }
 
 # OSX specific setup of the installation
 function installOsx () 
 {
    # check for xcode
    if [ -f /usr/bin/xcode-select 2> /dev/null > /dev/null ]; then
        echo2 Found XCode
    else
        echo2
        echo2 'This installer has to compile the UCSC tools locally on OSX.'
        echo2 'Please install XCode from https://developer.apple.com/xcode/downloads/'