source: gsdl/trunk/makegs2.bat@ 19268

Last change on this file since 19268 was 19122, checked in by ak19, 15 years ago

Some rudimentary steps to ensure that glisite.cfg, llssite.cfg and cgi-bin/gsdlsite.cfg are there.

File size: 8.7 KB
Line 
1@echo off
2pushd "%CD%"
3CD /D "%~dp0"
4
5
6:: Path to VCVARS32.bat -- You can set this variable manually if needed
7:: e.g. set VCVARS="C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
8set VCVARS=""
9
10
11
12
13rem Checking for Winbin and Unzip utility
14IF NOT EXIST .\bin\windows\*.* GOTO ENDNOWINBIN
15IF NOT EXIST .\bin\windows\choice.exe GOTO ENDNOWINBIN
16
17
18echo.
19echo.
20echo #### # ###
21echo ## # #
22echo # ### ## ## ### ### ### ## ### ## #
23echo # # # #### #### # # ## # # # # # #### ##
24echo ## # # # # # # # # # # # # # ##
25echo #### # ### ### # # ### ## ## # # ### ####
26echo (C) 2008, New Zealand Digital Library Project
27echo.
28echo.
29echo.
30
31
32rem Checking for existance of the packages extracted / zipped
33IF NOT EXIST .\common-src\packages\windows\crypt\crypt\*.* IF NOT EXIST .\common-src\packages\windows\crypt\crypt.zip GOTO ENDNOWINPACK
34
35IF NOT EXIST .\common-src\packages\windows\expat\expat\*.* IF NOT EXIST .\common-src\packages\windows\expat\expat.zip GOTO ENDNOWINPACK
36
37:: IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm\*.* IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm.zip GOTO ENDNOWINPACK
38
39IF NOT EXIST .\common-src\packages\windows\stlport\stlport\*.* IF NOT EXIST .\common-src\packages\windows\stlport\stlport.zip GOTO ENDNOWINPACK
40
41IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv\*.* IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv.zip GOTO ENDNOICONV
42
43IF NOT EXIST .\common-src\packages\sqlite\sqlite* IF NOT EXIST .\common-src\packages\sqlite\sqlite*.tar.gz GOTO ENDNOSQLITE
44
45rem Ask the user to extract now or to directly compile
46echo Do you want to extract the required packages (Recommended)? This will be the default action in 10 seconds.
47.\bin\windows\choice.exe /T:Y,10 /C:YN
48 IF errorlevel 2 GOTO COMPILE
49 IF errorlevel 1 GOTO UNZIP
50 IF errorlevel 0 GOTO END
51
52
53:UNZIP
54IF NOT EXIST .\bin\windows\unzip.exe GOTO ENDNOUNZIP
55IF NOT EXIST .\bin\windows\gunzip.exe GOTO ENDNOUNZIP
56IF NOT EXIST .\bin\windows\tar.exe GOTO ENDNOUNZIP
57
58rem Extracting the packages
59IF EXIST .\common-src\packages\windows\crypt\crypt.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\crypt\crypt.zip -d .\common-src\packages\windows\crypt\
60
61IF EXIST .\common-src\packages\windows\expat\expat.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\expat\expat.zip -d .\common-src\packages\windows\expat\
62
63IF EXIST .\common-src\packages\windows\gdbm\gdbm.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\gdbm\gdbm.zip -d .\common-src\packages\windows\gdbm\
64
65IF EXIST .\common-src\packages\windows\stlport\stlport.zip .\bin\windows\unzip.exe -o .\common-src\packages\windows\stlport\stlport.zip -d .\common-src\packages\windows\stlport\
66
67IF EXIST .\common-src\indexers\packages\windows\iconv\iconv.zip .\bin\windows\unzip.exe -o .\common-src\indexers\packages\windows\iconv\iconv.zip -d .\common-src\indexers\packages\windows\iconv\
68
69IF EXIST .\common-src\packages\sqlite\sqlite*.tar.gz .\bin\windows\gunzip.exe -cd .\common-src\packages\sqlite\sqlite*.tar.gz | .\bin\windows\tar.exe xv --directory=./common-src/packages/sqlite
70echo.
71echo.
72:COMPILE
73
74rem Last check if all the packages have been extracted prior compilation
75IF NOT EXIST .\common-src\packages\windows\crypt\crypt\*.* GOTO NEEDUNZIP
76IF NOT EXIST .\common-src\packages\windows\expat\expat\*.* GOTO NEEDUNZIP
77:: IF NOT EXIST .\common-src\packages\windows\gdbm\gdbm\*.* GOTO NEEDUNZIP
78IF NOT EXIST .\common-src\packages\windows\stlport\stlport\*.* GOTO NEEDUNZIP
79IF NOT EXIST .\common-src\indexers\packages\windows\iconv\iconv\*.* GOTO NEEDUNZIP
80IF NOT EXIST .\common-src\packages\sqlite\sqlite* GOTO NEEDUNZIP
81
82rem Check some known paths to VCVARS32.BAT
83:: if the user has set VCVARS32 don't look in the default places at all
84IF NOT %VCVARS%=="" GOTO CALLVCVARS
85
86:: Visual Studio 2005 Pro --- NOT READY YET
87::IF EXIST "%programfiles%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" set VCVARS="%programfiles%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
88
89:: Visual Studio 2003 \ VS7
90IF EXIST "%programfiles%\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat" set VCVARS="%programfiles%\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
91
92:: Visual Studio 6 \ VS6
93IF EXIST "%programfiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT" set VCVARS="%programfiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
94
95
96IF %VCVARS%=="" GOTO ENDNOVCVARS32
97
98:CALLVCVARS
99call %VCVARS%
100echo.
101echo.
102echo.
103rem Ask the user what to compile
104echo What do you want to compile?
105echo.
106echo 1. Local library only
107echo 2. Web library only
108echo 3. Both
109echo 4. Set up configuration files (glisite.cfg, llssite.cfg, gsdlsite)
110echo 5. Quit
111echo.
112echo Please choose a number from the menu. Otherwise both libraries will be compiled in 15 seconds.
113.\bin\windows\choice.exe /N /T:3,15 /C:1234
114 IF errorlevel 5 GOTO END
115 IF errorlevel 4 GOTO ENDOK
116 IF errorlevel 3 GOTO WITHBOTH
117 IF errorlevel 2 GOTO WITHOUTLOCALLIB
118 IF errorlevel 1 GOTO WITHLOCALLIB
119 IF errorlevel 0 GOTO END
120
121
122:WITHOUTLOCALLIB
123nmake /f win32.mak
124GOTO ENDOK
125
126:WITHLOCALLIB
127nmake /f win32.mak LOCAL_LIBRARY=1
128GOTO ENDOK
129
130:WITHBOTH
131nmake /f win32.mak
132nmake /f win32.mak LOCAL_LIBRARY=1
133GOTO ENDOK
134
135:NEEDUNZIP
136echo.
137echo /!\ Error /!\ - Some or all the packages are not properly extracted.
138echo.
139echo If you wish to compile Greenstone 2 you need to unzip the required packages now.
140echo.
141rem Ask to Unzip the packages now otherwise quit
142echo Do you want to unzip these required packages now? This will be the default action in 10 seconds.
143.\bin\windows\choice.exe /T:Y,10 /c:YN
144 IF errorlevel 2 GOTO END
145 IF errorlevel 1 GOTO UNZIP
146 IF errorlevel 0 GOTO END
147
148:ENDNOWINBIN
149echo.
150echo /!\ Error /!\ - Winbin has not been found.
151echo This is required to get the conversion tools used for importing different types of files.
152echo For more info please visit this page
153echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
154GOTO END
155
156:ENDNOUNZIP
157echo.
158echo /!\ Error /!\ - Extacting tools are missing.
159echo They are required to extract all packages needed for compilation.
160echo These tools are contained in the Winbin folder, more info on this web page:
161echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows#Getting_winbin
162GOTO END
163
164:ENDNOWINPACK
165echo.
166echo /!\ Error /!\ - Windows packages are missing.
167echo Some required packages are missing in .\common-src\packages\windows\
168echo Please go to this page for more information on how to get everything:
169echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
170GOTO END
171
172:ENDNOSQLITE
173echo.
174echo /!\ Error /!\ - SQLite is missing.
175echo Some required packages are missing in .\common-src\packages\sqlite\
176echo Please go to this page for more information on how to get everything:
177echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
178GOTO END
179
180:ENDNOICONV
181echo.
182echo /!\ Error /!\ - Indexers are missing.
183echo Some required packages are missing in .\common-src\indexers\packages\windows\
184echo Please go to this page for more information on how to get everything:
185echo http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone_2_from_SVN_source_on_Windows
186GOTO END
187
188:ENDNOVCVARS32
189echo.
190echo /!\ Error /!\ - Not able to find 'vcvars32.bat'.
191echo You need Visual Studio to compile the source code but we were
192echo unable to find the file vcvars32.bat in your system.
193echo.
194echo Please edit this bat file and manually set the full path to
195echo vcvars32.bat then run this script again.
196GOTO END
197
198:ENDOK
199if not exist llssite.cfg copy llssite.cfg.in llssite.cfg
200if not exist glisite.cfg copy glisite.cfg.in glisite.cfg
201if not exist cgi-bin\gsdlsite.cfg echo "Please replace the GSDLHOME placeholder in cgi-bin\gsdlsite.cfg with your GS2 installation path"
202if not exist cgi-bin\gsdlsite.cfg copy cgi-bin\gsdlsite.cfg.in cgi-bin\gsdlsite.cfg
203echo.
204echo Done!
205echo.
206echo This program is free software; you can redistribute it and/or
207echo modify it under the terms of the GNU General Public License
208echo as published by the Free Software Foundation; either version 2
209echo of the License, or (at your option) any later version.
210echo.
211echo This program is distributed in the hope that it will be useful,
212echo but WITHOUT ANY WARRANTY; without even the implied warranty of
213echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
214echo GNU General Public License for more details.
215echo.
216GOTO END
217
218:END
219popd
Note: See TracBrowser for help on using the repository browser.