-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.cmd
170 lines (134 loc) · 4.16 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
@echo off
set URL=http://sphinxsearch.googlecode.com/svn/trunk
set REL=1.11
set PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;%PATH%;
set ICONVROOT=C:\Bin\Iconv
set EXPATROOT=C:\Bin\Expat
set MYSQLROOT=C:\Program Files\MySQL\MySQL Server 5.0
set PGSQLROOT=C:\Program Files\PostgreSQL\8.3
if "%1" EQU "" (
echo *** FATAL: specify build tag as 1st argument (eg. build.cmd rc2 or build.cmd r2345^).
exit
) else (
set TAG=-%1
)
rmdir /s /q sphinxbuild 2>nul
mkdir sphinxbuild
cd sphinxbuild
if %ERRORLEVEL% NEQ 0 (
echo *** FATAL: failed to create build directory.
exit
)
svn co %URL% checkout
if %ERRORLEVEL% NEQ 0 (
echo *** FATAL: checkout error.
exit
)
call checkout\src\svnxrev.cmd checkout
echo #define SPHINX_TAG "%TAG%" >> checkout\src\sphinxversion.h
perl -i.bak -p -e "s/(_TAGREV \").*(r\d+\")/\1\2/g;" checkout\src\sphinxversion.h
rmdir /s /q checkout\.svn
@rem strip "release" tag from zip names
if "%1" EQU "release" (
set TAG=
)
@rem ==========================================
@rem === regular build and common packaging ===
@rem ==========================================
cd checkout
devenv sphinx05.sln /Rebuild Release
if %ERRORLEVEL% NEQ 0 (
echo *** FATAL: build error.
exit
)
del /q bin\release\test*.*
cd ..
mkdir common
for %%i in (api doc contrib) do (
svn export checkout\%%i common\%%i
)
for %%i in (COPYING INSTALL sphinx.conf.in sphinx-min.conf.in example.sql) do (
copy checkout\%%i common\%%i
)
set BASE=sphinx-%REL%%TAG%-win32
mkdir %BASE%
mkdir %BASE%\bin
copy checkout\bin\release\*.exe %BASE%\bin
copy "%ICONVROOT%\bin\iconv.dll" %BASE%\bin
copy "%EXPATROOT%\libs\libexpat.dll" %BASE%\bin
copy "%MYSQLROOT%\bin\libmysql.dll" %BASE%\bin
xcopy /q /s common\* %BASE%
pkzip25 -add %BASE%.zip -dir %BASE%\*
move %BASE%.zip ..
set PDBS=sphinx-%REL%%TAG%-win32-debug
mkdir %PDBS%
mkdir %PDBS%\regular
copy checkout\bin\release\*.pdb %PDBS%\regular
@rem ===================
@rem === pgsql build ===
@rem ===================
cd checkout
perl -i.bak -p -e "s/USE_PGSQL\s+\d/USE_PGSQL 1/g;" src\sphinx.h
devenv sphinx05.sln /Rebuild Release
if %ERRORLEVEL% NEQ 0 (
echo *** FATAL: build error.
exit
)
del /q bin\release\test*.*
cd ..
set BASE=sphinx-%REL%%TAG%-win32-pgsql
mkdir %BASE%
mkdir %BASE%\bin
copy checkout\bin\release\*.exe %BASE%\bin
for %%i in (comerr32.dll gssapi32.dll iconv.dll k5sprt32.dll krb5_32.dll libeay32.dll libiconv2.dll libintl3.dll libpq.dll ssleay32.dll msvcr71.dll) do (
copy "%PGSQLROOT%\bin\%%i" %BASE%\bin
)
copy "%EXPATROOT%\libs\libexpat.dll" %BASE%\bin
copy "%MYSQLROOT%\bin\libmysql.dll" %BASE%\bin
xcopy /q /s common\* %BASE%
pkzip25 -add %BASE%.zip -dir %BASE%\*
move %BASE%.zip ..
mkdir %PDBS%\pgsql
copy checkout\bin\release\*.pdb %PDBS%\pgsql
@rem =======================
@rem === id64-full build ===
@rem =======================
cd checkout
perl -i.bak -p -e "s/USE_LIBSTEMMER\s+\d/USE_LIBSTEMMER 1/g;" src\sphinx.h
perl -i.bak -p -e "s/USE_64BIT\s+\d/USE_64BIT 1/g;" src\sphinx.h
wget http://snowball.tartarus.org/dist/libstemmer_c.tgz
gunzip libstemmer_c.tgz
tar xvf libstemmer_c.tar
cd libstemmer_c
devenv libstemmer_c.sln /Rebuild Release
if %ERRORLEVEL% NEQ 0 (
echo *** FATAL: build error.
exit
)
cd ..
devenv sphinx05.sln /Rebuild Release
if %ERRORLEVEL% NEQ 0 (
echo *** FATAL: build error.
exit
)
del /q bin\release\test*.*
cd ..
set BASE=sphinx-%REL%%TAG%-win32-id64-full
mkdir %BASE%
mkdir %BASE%\bin
copy checkout\bin\release\*.exe %BASE%\bin
for %%i in (comerr32.dll gssapi32.dll iconv.dll k5sprt32.dll krb5_32.dll libeay32.dll libiconv2.dll libintl3.dll libpq.dll ssleay32.dll msvcr71.dll) do (
copy "%PGSQLROOT%\bin\%%i" %BASE%\bin
)
copy "%EXPATROOT%\libs\libexpat.dll" %BASE%\bin
copy "%MYSQLROOT%\bin\libmysql.dll" %BASE%\bin
xcopy /q /s common\* %BASE%
pkzip25 -add %BASE%.zip -dir %BASE%\*
move %BASE%.zip ..
mkdir %PDBS%\id64full
copy checkout\bin\release\*.pdb %PDBS%\id64full
@rem =============================
@rem === debug symbols archive ===
@rem ==============================
pkzip25 -add %PDBS%.zip -dir %PDBS%\*
move %PDBS%.zip ..