root/other-projects/gs2-multi-os-merge/MERGE-GREENSTONE2S.sh @ 30904

Revision 23950, 3.8 KB (checked in by davidb, 9 years ago)

Useful scripts to help merge Greenstone installations for different Operating Systems into one unified directory. Useful when putting Greenstone on a USB, for example, to run on a variety of different computers.

Line 
1#!/bin/bash
2
3echo ""
4echo "Merging into MacOS Installed version of Greenstone"
5echo ""
6
7export LINUX32_GSDL_HOME=Greenstone-EGL-Linux32
8export LINUX64_GSDL_HOME=Greenstone-EGL-Linux64
9export WINDOWS_GSDL_HOME=Greenstone-EGL-Windows
10##export DARWIN_GSDL_HOME=Greenstone-EGL-Darwin
11
12export MERGED_GSDL_HOME=Greenstone-EGL-USB
13
14if [ ! -d "$MERGED_GSDL_HOME/jre" ] ; then
15  mkdir "$MERGED_GSDL_HOME/jre"
16fi
17
18
19if [ -d "$WINDOWS_GSDL_HOME" ] ; then
20
21  echo "#----"
22  echo "# Merging in Windows"
23  echo "#----"
24
25  /bin/cp -v -u -r "$WINDOWS_GSDL_HOME/bin/windows" "$MERGED_GSDL_HOME/bin/."
26
27  /bin/cp -v -u -r "$WINDOWS_GSDL_HOME/packages/jre" "$MERGED_GSDL_HOME/jre/windows"
28
29  /bin/cp -v -u -r "$WINDOWS_GSDL_HOME/perllib/cpan" "$MERGED_GSDL_HOME/perllib/."
30
31  /bin/cp -v -u -r "$WINDOWS_GSDL_HOME/apache-httpd/windows" "$MERGED_GSDL_HOME/apache-httpd/."
32
33  if [ -d "$WINDOWS_GSDL_HOME/cgi-bin/windows" ] ; then
34    /bin/cp -v -u -r "$WINDOWS_GSDL_HOME/cgi-bin/windows" "$MERGED_GSDL_HOME/cgi-bin/."
35  else
36
37    /bin/cp -v -u -r "$WINDOWS_GSDL_HOME/cgi-bin" "$MERGED_GSDL_HOME/cgi-bin/windows"
38
39    echo ""
40    echo "----"
41    echo "Remember to edit:"
42    echo "  $WINDOWS_GSDL_HOME/apache-httpd/windows/conf/httpd.conf"
43    echo "to set Greenstone's cgi-bin directory to match:"
44    echo "  **GSDLHOME**/cgi-bin/windows" 
45    echo "----"
46    echo ""
47  fi
48
49  /bin/cp -v -u $WINDOWS_GSDL_HOME/*.bat $MERGED_GSDL_HOME/.
50  /bin/cp -v -u $WINDOWS_GSDL_HOME/gli/*.bat $MERGED_GSDL_HOME/gli/.
51
52fi
53
54
55if [ -d "$LINUX32_GSDL_HOME" ] ; then
56  echo "#----"
57  echo "# Merging in Linux 32-bits"
58  echo "#----"
59
60  if [ -d "$LINUX32_GSDL_HOME/perllib/cpan/XML/share/man/man3" ] ; then
61    /bin/rm -rf "$LINUX32_GSDL_HOME/perllib/cpan/XML/share/man/man3"
62  fi
63
64  /bin/cp -v -u -r "$LINUX32_GSDL_HOME/bin/linux" "$MERGED_GSDL_HOME/bin/linux32"
65  /bin/cp -v -u -r "$LINUX32_GSDL_HOME/lib/linux" "$MERGED_GSDL_HOME/lib/linux32"
66
67  /bin/cp -v -u -r "$LINUX32_GSDL_HOME/packages/jre" "$MERGED_GSDL_HOME/jre/linux32"
68
69  /bin/cp -v -u -r "$LINUX32_GSDL_HOME/perllib/cpan" "$MERGED_GSDL_HOME/perllib/."
70
71  /bin/cp -v -u -r "$LINUX32_GSDL_HOME/apache-httpd/linux" "$MERGED_GSDL_HOME/apache-httpd/linux32"
72
73  if [ -d "$LINUX32_GSDL_HOME/cgi-bin/linux" ] ; then
74    /bin/cp -v -u -r "$LINUX32_GSDL_HOME/cgi-bin/linux" "$MERGED_GSDL_HOME/cgi-bin/linux32"
75  else
76
77    /bin/cp -v -u -r "$LINUX32_GSDL_HOME/cgi-bin" "$MERGED_GSDL_HOME/cgi-bin/linux32"
78
79    echo ""
80    echo "----"
81    echo "Remember to edit:"
82    echo "  $LINUX32_GSDL_HOME/apache-httpd/linux32/conf/httpd.conf"
83    echo "to set Greenstone's cgi-bin directory to match:"
84    echo "  **GSDLHOME**/cgi-bin/linux32" 
85    echo "----"
86    echo ""
87  fi
88
89
90fi
91
92if [ -d "$LINUX64_GSDL_HOME" ] ; then
93  echo "#----"
94  echo "# Merging in Linux 64-bits"
95  echo "#----"
96
97  if [ -d "$LINUX64_GSDL_HOME/perllib/cpan/XML/share/man/man3" ] ; then
98    /bin/rm -rf "$LINUX64_GSDL_HOME/perllib/cpan/XML/share/man/man3"
99  fi
100
101  /bin/cp -v -u -r "$LINUX64_GSDL_HOME/bin/linux" "$MERGED_GSDL_HOME/bin/linux64"
102  /bin/cp -v -u -r "$LINUX64_GSDL_HOME/lib/linux" "$MERGED_GSDL_HOME/lib/linux64"
103
104  /bin/cp -v -u -r "$LINUX64_GSDL_HOME/packages/jre" "$MERGED_GSDL_HOME/jre/linux64"
105
106  /bin/cp -v -u -r "$LINUX64_GSDL_HOME/perllib/cpan" "$MERGED_GSDL_HOME/perllib/."
107
108  /bin/cp -v -u -r "$LINUX64_GSDL_HOME/apache-httpd/linux" "$MERGED_GSDL_HOME/apache-httpd/linux64"
109
110  if [ -d "$LINUX64_GSDL_HOME/cgi-bin/linux" ] ; then
111    /bin/cp -v -u -r "$LINUX64_GSDL_HOME/cgi-bin/linux" "$MERGED_GSDL_HOME/cgi-bin/linux64"
112  else
113
114    /bin/cp -v -u -r "$LINUX64_GSDL_HOME/cgi-bin" "$MERGED_GSDL_HOME/cgi-bin/linux64"
115
116    echo ""
117    echo "----"
118    echo "Remember to edit:"
119    echo "  $LINUX64_GSDL_HOME/apache-httpd/linux64/conf/httpd.conf"
120    echo "to set Greenstone's cgi-bin directory to match:"
121    echo "  **GSDLHOME**/cgi-bin/linux64" 
122    echo "----"
123    echo ""
124  fi
125
126fi
127
128
Note: See TracBrowser for help on using the browser.