4289758601bbabfbe7f19370470fa9a30831fb38
galt
  Fri Dec 20 22:18:24 2024 -0800
Update browserSetup.sh after running it on Rocky 9.5 in vm on hgwdev.

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
index d555787..65fbe7d 100644
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -692,72 +692,78 @@
     cd $APACHEDIR/kent/src
     make libs
     make cgi-alpha
     cd hg/dbTrash
     make
 
     #cd hg/htdocs
     #make doInstall destDir=$APACHDIR/htdocs FIND="find ."
     # dbTrash tool needed for trash cleaning
 }
 
 # This should not be needed anymore: hgGeneGraph has moved to Python3 finally. But leaving the code in here
 # anyways, as it should not hurt and some mirrors may have old Python2 code or old CGIs around. 
 # We can remove this section in around 1-2 years when we are sure that no one needs Python2 anymore
 function installPy2MysqlRedhat () {
+
+    # Rocky 9
+    if yum list python3-mysqlclient 2> /dev/null ; then
+        yum install -y python3-mysqlclient python3 python3-devel mariadb-connector-c mariadb-common mariadb-connector-c-devel wget gcc
+    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
 	# somehow the mysql.h does not have the "reconnect" field anymore in Fedora
 	if grep -q "bool reconnect;" /usr/include/mysql/mysql.h ; then
 	    echo /usr/include/mysql/mysql.h already has reconnect attribute
 	else
 	    sed '/st_mysql_options options;/a    my_bool reconnect; // added by UCSC Genome browserSetup.sh script' /usr/include/mysql/mysql.h -i.bkp
 	fi
 
 	# fedora > 34 doesn't have any pip2 package anymore so install it now
 	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
     }
 
 # little function that compares two floating point numbers
 # see https://stackoverflow.com/questions/8654051/how-can-i-compare-two-floating-point-numbers-in-bash
 function numCompare () {
    awk -v n1="$1" -v n2="$2" 'BEGIN {printf (n1<n2?"<":">=") }'
 }
 
 # 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
+    if cat /etc/redhat-release | egrep '(edora|ocky)' > /dev/null; then
 	yum -y install chkconfig
     else
         yum -y install epel-release
     fi
 
     yum -y install ghostscript rsync ImageMagick R-core curl initscripts --allowerasing --nobest
 
     # 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
     
     # try to activate the powertools repo. Exists on CentOS and Rocky but not Redhat