Changeset 30258 for gs2-extensions/tdb

Show
Ignore:
Timestamp:
21.09.2015 12:44:27 (4 years ago)
Author:
jmt12
Message:

Extending disable script to support Greenstone3's gs2build package as well

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/tdb/trunk/disable_tdb.sh

    r30239 r30258  
    1010 
    1111# Test that GSDLHOME is set otherwise we won't be able to find the required files 
    12 if [ "${GSDLHOME}x" == "x" ] ; then echo 'Error! GSDLHOME not set. Please source setup.bash before running.' ; echo ; exit 0 ; fi 
    13 if [ "${GSDLOS}x" == "x" ] ; then echo 'Error! GSDLOS not set. Please source setup.bash before running.' ; echo ; exit 0 ; fi 
     12if [ "${GSDLHOME}x" == "x" ] 
     13then 
     14    echo 'Error! GSDLHOME not set. Please source setup.bash before running.' 
     15    echo 
     16    exit 0 
     17fi 
     18if [ "${GSDLOS}x" == "x" ] 
     19then 
     20    echo 'Error! GSDLOS not set. Please source setup.bash before running.' 
     21    echo 
     22    exit 0 
     23fi 
    1424 
    1525# Black magic to determine the actual name of the extension folder (in case I 
    1626# change from tdb-edit to tdb in the future (writing in hindsight)) 
     27EXTDIR=${PWD} 
    1728EXTNAME=${PWD##*/} 
    1829 
    19 echo ' - removing TDB support from common function library' 
     30printf ' * Removing TDB support from common function library... ' 
    2031# - Makefile.in 
    2132MAKEFILE="${GSDLHOME}/common-src/src/lib/Makefile.in" 
    2233sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
    23 sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
     34sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I'${EXTDIR}'/'${GSDLOS}'/include\(.*\):\1\2:' "${MAKEFILE}" 
    2435sed -i 's:\(EXT_SOURCES\s*=.*\)\stdbclass.cpp\(.*\):\1\2:' "${MAKEFILE}" 
    2536sed -i 's:\(EXT_OBJECTS\s*=.*\)\stdbclass.o\(.*\):\1\2:' "${MAKEFILE}" 
     
    3243rm -f "${GSDLHOME}/common-src/src/lib/tdbclass.o" 
    3344rm -f "${GSDLHOME}/common-src/src/lib/gsdllib.a" 
     45echo 'Done!' 
    3446 
     47if [ "${GSDL3HOME}x" == "x" ] 
     48then 
     49    printf ' * Removing TDB support from collection server... ' 
     50    # - Makefile.in 
     51    MAKEFILE="${GSDLHOME}/runtime-src/src/colservr/Makefile.in" 
     52    sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
     53    sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
     54    rm -f "${GSDLHOME}/runtime-src/src/colservr/Makefile" 
     55    # - collectset.cpp 
     56    # BUG: leaves behind the newlines... 
     57    SRCFILE="${GSDLHOME}/runtime-src/src/colservr/collectset.cpp" 
     58    sed -i '/^#include "tdbclass.h" \/\/TDB/ d' "${SRCFILE}" 
     59    sed -i '/^[ ]*if (infodbtype == "tdb") {db_ptr = new tdbclass(gsdlhome);} \/\/TDB/ d' "${SRCFILE}" 
     60    sed -i '/^[ ]*if (infodbtype == "tdbserver") {db_ptr = new tdbclass(gsdlhome);} \/\/TDBServer/ d' "${SRCFILE}" 
     61    # - collectserver.cpp 
     62    SRCFILE="${GSDLHOME}/runtime-src/src/colservr/collectserver.cpp" 
     63    sed -i '/^if (infodbtype == "tdb") { } \/\/ TDB Do nothing/ d' "${SRCFILE}" 
     64    sed -i '/^if (infodbtype == "tdbserver") { } \/\/ TDBServer Do nothing/ d' "${SRCFILE}" 
     65    # - Remove compiled files 
     66    rm -f "${GSDLHOME}/runtime-src/src/colservr/gsdlcolservr.a" 
     67    echo 'Done!' 
    3568 
    36 echo ' - removing TDB support from collection server' 
    37 # - Makefile.in 
    38 MAKEFILE="${GSDLHOME}/runtime-src/src/colservr/Makefile.in" 
    39 sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
    40 sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
    41 rm -f "${GSDLHOME}/runtime-src/src/colservr/Makefile" 
    42 # - collectset.cpp 
    43 # BUG: leaves behind the newlines... 
    44 SRCFILE="${GSDLHOME}/runtime-src/src/colservr/collectset.cpp" 
    45 sed -i '/^#include "tdbclass.h" \/\/TDB/ d' "${SRCFILE}" 
    46 sed -i '/^[ ]*if (infodbtype == "tdb") {db_ptr = new tdbclass(gsdlhome);} \/\/TDB/ d' "${SRCFILE}" 
    47 sed -i '/^[ ]*if (infodbtype == "tdbserver") {db_ptr = new tdbclass(gsdlhome);} \/\/TDBServer/ d' "${SRCFILE}" 
    48 # - collectserver.cpp 
    49 SRCFILE="${GSDLHOME}/runtime-src/src/colservr/collectserver.cpp" 
    50 sed -i '/^if (infodbtype == "tdb") { } \/\/ TDB Do nothing/ d' "${SRCFILE}" 
    51 sed -i '/^if (infodbtype == "tdbserver") { } \/\/ TDBServer Do nothing/ d' "${SRCFILE}" 
    52 # - Remove compiled files 
    53 rm -f "${GSDLHOME}/runtime-src/src/colservr/gsdlcolservr.a" 
     69    printf ' * Removing TDB support from Greenstone receptionist... ' 
     70    # - Makefile.in 
     71    MAKEFILE="${GSDLHOME}/runtime-src/src/recpt/Makefile.in" 
     72    sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
     73    sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
     74    sed -i 's:\(EXT_LDFLAGS\s*=.*\)\s-L$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/lib\(.*\):\1\2:' "${MAKEFILE}" 
     75    sed -i 's:\(EXT_LIBS\s*=.*\)\s-ltdb\(.*\):\1\2:' "${MAKEFILE}" 
     76    rm -f "${GSDLHOME}/runtime-src/src/recpt/Makefile" 
     77    # - Remove compiled files 
     78    rm -f "${GSDLHOME}/runtime-src/src/recpt/gsdlrecpt.a" 
     79    rm -f "${GSDLHOME}/runtime-src/src/recpt/library.cgi" 
     80    rm -f "${GSDLHOME}/cgi-bin/library.cgi" 
     81    echo 'Done!' 
    5482 
    55  
    56 echo ' - removing TDB support from Greenstone receptionist' 
    57 # - Makefile.in 
    58 MAKEFILE="${GSDLHOME}/runtime-src/src/recpt/Makefile.in" 
    59 sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
    60 sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
    61 sed -i 's:\(EXT_LDFLAGS\s*=.*\)\s-L$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/lib\(.*\):\1\2:' "${MAKEFILE}" 
    62 sed -i 's:\(EXT_LIBS\s*=.*\)\s-ltdb\(.*\):\1\2:' "${MAKEFILE}" 
    63 rm -f "${GSDLHOME}/runtime-src/src/recpt/Makefile" 
    64 # - Remove compiled files 
    65 rm -f "${GSDLHOME}/runtime-src/src/recpt/gsdlrecpt.a" 
    66 rm -f "${GSDLHOME}/runtime-src/src/recpt/library.cgi" 
    67 rm -f "${GSDLHOME}/cgi-bin/library.cgi" 
    68  
    69  
    70 echo ' - removing TDB support from OAI Server receptionist' 
    71 # - Makefile.in 
    72 MAKEFILE="${GSDLHOME}/runtime-src/src/oaiservr/Makefile.in" 
    73 sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
    74 sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
    75 sed -i 's:\(EXT_LDFLAGS\s*=.*\)\s-L$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/lib\(.*\):\1\2:' "${MAKEFILE}" 
    76 sed -i 's:\(EXT_LIBS\s*=.*\)\s-ltdb\(.*\):\1\2:' "${MAKEFILE}" 
    77 rm -f "${GSDLHOME}/runtime-src/src/oaiservr/Makefile" 
    78 # - Remove compiled files 
    79 rm -f "${GSDLHOME}/runtime-src/src/oaiservr/oaiserver.cgi" 
    80 rm -f "${GSDLHOME}/cgi-bin/oaiserver.cgi" 
     83    printf ' * Removing TDB support from OAI Server receptionist... ' 
     84    # - Makefile.in 
     85    MAKEFILE="${GSDLHOME}/runtime-src/src/oaiservr/Makefile.in" 
     86    sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' "${MAKEFILE}" 
     87    sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/include\s*-I$(GSDL_DIR)/ext/'${EXTNAME}'/src/lib\(.*\):\1\2:' "${MAKEFILE}" 
     88    sed -i 's:\(EXT_LDFLAGS\s*=.*\)\s-L$(GSDL_DIR)/ext/'${EXTNAME}'/'${GSDLOS}'/lib\(.*\):\1\2:' "${MAKEFILE}" 
     89    sed -i 's:\(EXT_LIBS\s*=.*\)\s-ltdb\(.*\):\1\2:' "${MAKEFILE}" 
     90    rm -f "${GSDLHOME}/runtime-src/src/oaiservr/Makefile" 
     91    # - Remove compiled files 
     92    rm -f "${GSDLHOME}/runtime-src/src/oaiservr/oaiserver.cgi" 
     93    rm -f "${GSDLHOME}/cgi-bin/oaiserver.cgi" 
     94    echo 'Done!' 
     95else 
     96    echo ' * TDB runtime support offered via Java/JNI/TDB bridge.' 
     97fi 
    8198 
    8299echo 
     
    87104echo 'rerun:' 
    88105echo 
    89 echo ' ./configure <any required arguments>' 
    90 echo ' make' 
    91 echo ' make install' 
     106if [ "${GSDL3HOME}x" == "x" ] 
     107then 
     108    echo ' ./configure <any required arguments>' 
     109    echo ' make' 
     110    echo ' make install' 
     111else 
     112    echo ' ant install' 
     113fi 
    92114echo 
    93115echo 'to complete TDB removal.'