root/gs2-extensions/tdb/trunk/disable_tdb.sh @ 30182

Revision 30182, 4.6 KB (checked in by jmt12, 4 years ago)

Removing extra src-level directory

  • Property svn:executable set to *
Line 
1#!/bin/bash
2# Used to merge in the code needed to add TDB support to Greenstone. The script
3# is responsible for updating both Makefile.in and source code files. You can
4# later run 'disable_tdb.sh' to undo these changes.
5# @author John Thompson, University of Waikato, NZ
6
7echo
8echo '===== Removing TDB support code from Greenstone ====='
9echo
10
11# Test that GSDLHOME is set otherwise we won't be able to find the required files
12if [ "$GSDLHOME" == "" ] ; then echo 'Error! GSDLHOME not set. Please source setup.bash before running.' ; echo ; exit 0 ; fi
13
14
15echo ' - removing TDB support from common function library'
16# - Makefile.in
17sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' $GSDLHOME/common-src/src/lib/Makefile.in
18sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/tdb-edit/linux/include\s*-I$(GSDL_DIR)/ext/tdb-edit/darwin/include\s*-I$(GSDL_DIR)/ext/tdb-edit/src/lib\(.*\):\1\2:' $GSDLHOME/common-src/src/lib/Makefile.in
19sed -i 's:\(EXT_SOURCES\s*=.*\)\stdbclass.cpp\(.*\):\1\2:' $GSDLHOME/common-src/src/lib/Makefile.in
20sed -i 's:\(EXT_OBJECTS\s*=.*\)\stdbclass.o\(.*\):\1\2:' $GSDLHOME/common-src/src/lib/Makefile.in
21rm -f $GSDLHOME/common-src/src/lib/Makefile
22# - Remove symlink
23rm -f $GSDLHOME/common-src/src/lib/tdbclass.h
24rm -f $GSDLHOME/common-src/src/lib/tdbclass.cpp
25# - Remove compiled files
26rm -f $GSDLHOME/common-src/src/lib/tdbclass.o
27rm -f $GSDLHOME/common-src/src/lib/gsdllib.a
28
29
30echo ' - removing TDB support from collection server'
31# - Makefile.in
32sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' $GSDLHOME/runtime-src/src/colservr/Makefile.in
33sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/tdb-edit/linux/include\s*-I$(GSDL_DIR)/ext/tdb-edit/darwin/include\s*-I$(GSDL_DIR)/ext/tdb-edit/src/lib\(.*\):\1\2:' $GSDLHOME/runtime-src/src/colservr/Makefile.in
34rm -f $GSDLHOME/runtime-src/src/colservr/Makefile
35# - collectset.cpp
36# BUG: leaves behind the newlines...
37sed -i '/^#include "tdbclass.h" \/\/TDB/ d' $GSDLHOME/runtime-src/src/colservr/collectset.cpp
38sed -i '/^[ ]*if (infodbtype == "tdb") {db_ptr = new tdbclass(gsdlhome);} \/\/TDB/ d' $GSDLHOME/runtime-src/src/colservr/collectset.cpp
39sed -i '/^[ ]*if (infodbtype == "tdbserver") {db_ptr = new tdbclass(gsdlhome);} \/\/TDBServer/ d' $GSDLHOME/runtime-src/src/colservr/collectset.cpp
40# - collectserver.cpp
41sed -i '/^if (infodbtype == "tdb") { } \/\/ TDB Do nothing/ d' $GSDLHOME/runtime-src/src/colservr/collectset.cpp
42sed -i '/^if (infodbtype == "tdbserver") { } \/\/ TDBServer Do nothing/ d' $GSDLHOME/runtime-src/src/colservr/collectset.cpp
43# - Remove compiled files
44rm -f $GSDLHOME/runtime-src/src/colservr/gsdlcolservr.a
45
46
47
48
49echo ' - removing TDB support from Greenstone receptionist'
50# - Makefile.in
51sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' $GSDLHOME/runtime-src/src/recpt/Makefile.in
52sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/tdb-edit/linux/include\s*-I$(GSDL_DIR)/ext/tdb-edit/darwin/include\s*-I$(GSDL_DIR)/ext/tdb-edit/src/lib\(.*\):\1\2:' $GSDLHOME/runtime-src/src/recpt/Makefile.in
53sed -i 's:\(EXT_LDFLAGS\s*=.*\)\s-L$(GSDL_DIR)/ext/tdb-edit/linux/lib -L$(GSDL_DIR)/ext/tdb-edit/darwin/lib\(.*\):\1\2:' $GSDLHOME/runtime-src/src/recpt/Makefile.in
54sed -i 's:\(EXT_LIBS\s*=.*\)\s-ltdb\(.*\):\1\2:' $GSDLHOME/runtime-src/src/recpt/Makefile.in
55rm -f $GSDLHOME/runtime-src/src/recpt/Makefile
56# - Remove compiled files
57rm -f $GSDLHOME/runtime-src/src/recpt/gsdlrecpt.a
58rm -f $GSDLHOME/runtime-src/src/recpt/library.cgi
59rm -f $GSDLHOME/cgi-bin/library.cgi
60
61
62echo ' - removing TDB support from OAI Server receptionist'
63# - Makefile.in
64sed -i 's:\(EXT_DEFINES\s*=.*\)\s-DUSE_TDB\(.*\):\1\2:' $GSDLHOME/runtime-src/src/oaiservr/Makefile.in
65sed -i 's:\(EXT_INCLUDES\s*=.*\)\s-I$(GSDL_DIR)/ext/tdb-edit/linux/include\s*-I$(GSDL_DIR)/ext/tdb-edit/darwin/include\s*-I$(GSDL_DIR)/ext/tdb-edit/src/lib\(.*\):\1\2:' $GSDLHOME/runtime-src/src/oaiservr/Makefile.in
66sed -i 's:\(EXT_LDFLAGS\s*=.*\)\s-L$(GSDL_DIR)/ext/tdb-edit/linux/lib -L$(GSDL_DIR)/ext/tdb-edit/darwin/lib\(.*\):\1\2:' $GSDLHOME/runtime-src/src/oaiservr/Makefile.in
67sed -i 's:\(EXT_LIBS\s*=.*\)\s-ltdb\(.*\):\1\2:' $GSDLHOME/runtime-src/src/oaiservr/Makefile.in
68rm -f $GSDLHOME/runtime-src/src/oaiservr/Makefile
69# - Remove compiled files
70rm -f $GSDLHOME/runtime-src/src/oaiservr/oaiserver.cgi
71rm -f $GSDLHOME/cgi-bin/oaiserver.cgi
72
73echo
74echo '====================================================='
75echo
76echo 'TDB support has now been removed from Greenstone.'
77echo 'Please return to the main Greenstone directory and'
78echo 'rerun:'
79echo
80echo ' ./configure <any required arguments>'
81echo ' make'
82echo ' make install'
83echo
84echo 'to complete TDB removal.'
85echo
86echo '====================================================='
87echo
88
89exit 0
Note: See TracBrowser for help on using the browser.