]> git.evergreen-ils.org Git - Evergreen.git/blob - install.sh
added lines to break up the build
[Evergreen.git] / install.sh
1 #!/bin/bash
2 # --------------------------------------------------------------------
3 # Copyright (C) 2005  Georgia Public Library Service 
4 # Bill Erickson <highfalutin@gmail.com>
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 # --------------------------------------------------------------------
16
17
18 # --------------------------------------------------------------------
19 # ILS install script
20 # --------------------------------------------------------------------
21
22  
23 # *!*!* EDIT THESE *!*!*
24 # --------------------------------------------------------------------
25 # Here define all of the necessary install variables 
26 # --------------------------------------------------------------------
27 APXS2="/pines/apps/apache2/bin/apxs";
28 PREFIX="/pines/";
29 TMP="/tmp/pines/";
30 APACHE2_HEADERS="/pines/apps/apache2/include/";
31 LIBXML2_HEADERS="/usr/include/libxml2/";
32 TARGETS=("OpenSRF" "Open-ILS" "Evergreen");
33 # --------------------------------------------------------------------
34
35 # --------------------------------------------------------------------
36 # if FORCE is set to any non-empty value, we'll use 
37 # the default settings
38 FORCE=$1 
39 # --------------------------------------------------------------------
40
41
42
43
44
45 # --------------------------------------------------------------------
46 # Loads all of the path information from the user setting 
47 # install variables as it goes
48 # --------------------------------------------------------------------
49 function verifyInstallPaths {
50
51         cat <<-WORDS
52
53         -----------------------------------------------------------------------
54         Verify the following install directories are sane.
55         Note: * indicates that you must have write privelages for the location
56         -----------------------------------------------------------------------
57
58         -----------------------------------------------------------------------
59         Install prefix            [$PREFIX]*
60         Temporary files directory [$TMP]*
61         Apache2 apxs binary       [$APXS2]
62         Apache2 header directory  [$APACHE2_HEADERS]
63         Libxml2 header directory  [$LIBXML2_HEADERS]
64         Building targets          [${TARGETS[@]:0}];
65         -----------------------------------------------------------------------
66
67         If these are not OK, use control-c to break out and fix the variables 
68         at the top of this script.  Otherwise, type enter.
69
70         WORDS
71         read OK;
72 }
73
74 # --------------------------------------------------------------------
75 # Makes sure the install directories exist and are writable
76 # --------------------------------------------------------------------
77 function mkInstallDirs {
78
79         mkdir -p "$PREFIX";
80
81         if [ "$?" != "0" ]; then
82                 echo "Error creating $PREFIX";
83                 exit 99;
84         fi
85
86         mkdir -p "$TMP";
87         if [ "$?" != "0" ]; then
88                 echo "Error creating $TMP";
89                 exit 99;
90         fi
91
92         if [ ! -w "$PREFIX" ]; then
93                 echo "We don't have write access to $PREFIX";
94                 exit 99;
95         fi
96
97         if [ ! -w "$TMP" ]; then
98                 echo "We don't have write access to $TMP";
99                 exit 99;
100         fi
101
102 }
103
104
105 function runInstall {
106
107         [ -z "$FORCE" ] && verifyInstallPaths;
108         mkInstallDirs;
109
110         # pass the collected variables to make
111         for target in ${TARGETS[@]:0}; do
112
113                 cat <<-MSG
114
115                 --------------------------------------------------------------------
116                 Building $target
117                 --------------------------------------------------------------------
118
119                 MSG
120
121                 target="$target/src";
122
123                 make -C "$target" \
124                         APXS2="$APXS2" \
125                         PREFIX="$PREFIX" \
126                         TMP="$TMP" \
127                         APCHE2_HEADERS="$APACHE2_HEADERS" \
128                         LIBXML2_HEADERS="$LIBXML2_HEADERS" \
129                         all;    
130
131         done
132 }
133
134
135
136 # Kick it off...
137 runInstall;
138