forked from espenhw/gnus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.bat
341 lines (315 loc) · 11.3 KB
/
make.bat
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
@echo OFF
REM Change this to ON when debugging this batch file.
rem Written by Frank Schmitt ([email protected])
rem based on the work by David Charlap ([email protected])
rem .
rem .
rem Clear PWD so emacs doesn't get confused
set GNUS_PWD_SAVE=%PWD%
set PWD=
set ERROR=:
REM set pause=
if %1p == p goto usage
echo * Installing Gnus on your system. Operating system:
ver
rem Emacs 20.7 no longer includes emacs.bat. Use emacs.exe if the batch file is
rem not present -- this also fixes the problem about too many parameters on Win9x.
if exist %1\emacs.bat goto ebat
if exist %1\emacs.exe goto eexe
if exist %1\xemacs.exe goto xemacs
goto noemacs
:ebat
set EMACS=emacs.bat
echo.
echo ***************************************************************************
echo * Using emacs.bat (If you've got Emacs 20.3 or higher please remove
echo * Emacs.bat, it isn't needed anymore.)
echo ***************************************************************************
echo.
goto emacs
:eexe
set EMACS=emacs.exe
echo.
echo ***************************************************************************
echo * Using emacs.exe
echo ***************************************************************************
echo.
goto emacs
:emacs
if not "%2" == "/copy" goto emacsnocopy
if not exist %1\..\site-lisp\nul mkdir %1\..\site-lisp
if not exist %1\..\site-lisp\gnus\nul mkdir %1\..\site-lisp\gnus
if not exist %1\..\site-lisp\subdirs.el set subdirwarning=yes
:emacsnocopy
set EMACS_ARGS=-batch -q -no-site-file
set GNUS_INFO_DIR=%1\..\info
set GNUS_LISP_DIR=%1\..\site-lisp\gnus\lisp
set GNUS_ETC_DIR=%1\..\site-lisp\gnus\etc
goto lisp
:xemacs
set EMACS=xemacs.exe
if not "%2" == "/copy" goto xemacsnocopy
if not exist %1\..\..\site-packages\nul mkdir %1\..\..\site-packages\
if not exist %1\..\..\site-packages\info\nul mkdir %1\..\..\site-packages\info
if not exist %1\..\..\site-packages\lisp\nul mkdir %1\..\..\site-packages\lisp
if not exist %1\..\..\site-packages\etc\nul mkdir %1\..\..\site-packages\etc
:xemacsnocopy
set EMACS_ARGS=-batch -no-autoloads
set GNUS_INFO_DIR=%1\..\..\site-packages\info
set GNUS_LISP_DIR=%1\..\..\site-packages\lisp\gnus
set GNUS_ETC_DIR=%1\..\..\site-packages\etc
echo.
echo ***************************************************************************
echo * Using xemacs.exe
echo ***************************************************************************
echo.
goto lisp
:lisp
if "%pause%" == "pause" pause
set EMACSBATCH=call %1\%EMACS% %EMACS_ARGS%
cd lisp
if exist gnus-load.el attrib -r gnus-load.el
if exist gnus-load.el del gnus-load.el
echo.
echo * Stand by while generating autoloads.
echo.
%EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-cus-load .
if ErrorLevel 1 set ERROR=make-cus-load
%EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-auto-load .
if ErrorLevel 1 set ERROR=%ERROR%,make-auto-load
%EMACSBATCH% -l ./dgnushack.el -f dgnushack-make-load
if ErrorLevel 1 set ERROR=%ERROR%,make-load
echo.
echo * Stand by while compiling lisp files.
echo.
%EMACSBATCH% -l ./dgnushack.el -f dgnushack-compile
if ErrorLevel 1 set ERROR=%ERROR%,compile
if not "%2" == "/copy" goto infotest
echo.
echo * Stand by while copying lisp files.
echo.
if not exist %GNUS_LISP_DIR%\nul mkdir %GNUS_LISP_DIR%
xcopy /R /Q /Y *.el* %GNUS_LISP_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-lisp
goto infotest
:infotest
cd ..\texi
if exist sieve attrib -r sieve
if exist sieve del sieve
echo * Checking if makeinfo is available...
makeinfo sieve.texi
if exist sieve goto minfo
echo * No makeinfo found, using infohack.el.
set EMACSINFO=%EMACSBATCH% -l infohack.el -f batch-makeinfo
echo.
echo ***************************************************************************
echo * Using infohack.el, if you've got makeinfo.exe put it in PATH.
echo ***************************************************************************
echo.
goto info
:minfo
set EMACSINFO=makeinfo
echo.
echo ***************************************************************************
echo * Using makeinfo
echo ***************************************************************************
echo.
goto info
:info
if "%pause%" == "pause" pause
echo.
echo * Stand by while generating info files.
echo.
%EMACSINFO% emacs-mime.texi
if ErrorLevel 1 set ERROR=%ERROR%,emacs-mime.texi
%EMACSINFO% gnus.texi
if ErrorLevel 1 set ERROR=%ERROR%,gnus.texi
%EMACSINFO% sieve.texi
if ErrorLevel 1 set ERROR=%ERROR%,sieve.texi
%EMACSINFO% pgg.texi
if ErrorLevel 1 set ERROR=%ERROR%,pgg.texi
%EMACSINFO% message.texi
if ErrorLevel 1 set ERROR=%ERROR%,message.texi
%EMACSINFO% sasl.texi
if ErrorLevel 1 set ERROR=%ERROR%,sasl.texi
if not "%2" == "/copy" goto nocopy
if not exist %GNUS_INFO_DIR%\nul mkdir %GNUS_INFO_DIR%
echo.
echo * Stand by while copying info files.
echo.
xcopy /R /Q /Y gnus %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-info
xcopy /R /Q /Y gnus-? %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-x-info
xcopy /R /Q /Y gnus-?? %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-gnus-xx-info
xcopy /R /Q /Y message %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-message-info
if exist message-1 xcopy /R /Q /Y message-? %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-message-x-info
xcopy /R /Q /Y emacs-mime %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-emacs-mime-info
xcopy /R /Q /Y sieve %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-sieve-info
xcopy /R /Q /Y pgg %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-pgg-info
xcopy /R /Q /Y sasl %GNUS_INFO_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-sasl-info
echo.
echo ***************************************************************************
echo * You should add the following lines to
echo * %GNUS_INFO_DIR%\dir
echo * if they aren't already there:
echo *
echo * * PGG: (pgg). Emacs interface to various PGP implementations.
echo * * Sieve: (sieve). Managing Sieve scripts in Emacs.
echo * * SASL: (sasl). The Emacs SASL library.
echo ***************************************************************************
echo.
:etc
if "%pause%" == "pause" pause
cd ..\etc
echo.
echo * Stand by while copying etc files.
echo.
REM
if not exist %GNUS_ETC_DIR% mkdir %GNUS_ETC_DIR%
echo ** gnus-tut.txt ...
xcopy /R /Q /Y gnus-tut.txt %GNUS_ETC_DIR%
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-gnus-tut-txt
REM
REM FIXME: Instead of C&P, we should use a FOR loop.
REM
set i=images
if not exist %GNUS_ETC_DIR%\%i%\nul mkdir %GNUS_ETC_DIR%\%i%
echo ** .\%i%\ ...
xcopy /R /Q /Y .\%i%\*.* %GNUS_ETC_DIR%\%i%\
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-%i%
REM
set i=images\mail
if not exist %GNUS_ETC_DIR%\%i%\nul mkdir %GNUS_ETC_DIR%\%i%
echo ** .\%i%\ ...
xcopy /R /Q /Y .\%i%\*.* %GNUS_ETC_DIR%\%i%\
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-%i%
REM
set i=images\gnus
if not exist %GNUS_ETC_DIR%\%i%\nul mkdir %GNUS_ETC_DIR%\%i%
echo ** .\%i%\ ...
xcopy /R /Q /Y .\%i%\*.* %GNUS_ETC_DIR%\%i%\
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-%i%
REM
set i=images\smilies
if not exist %GNUS_ETC_DIR%\%i%\nul mkdir %GNUS_ETC_DIR%\%i%
echo ** .\%i%\ ...
xcopy /R /Q /Y .\%i%\*.* %GNUS_ETC_DIR%\%i%\
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-%i%
REM
set i=images\smilies\grayscale
if not exist %GNUS_ETC_DIR%\%i%\nul mkdir %GNUS_ETC_DIR%\%i%
echo ** .\%i%\ ...
xcopy /R /Q /Y .\%i%\*.* %GNUS_ETC_DIR%\%i%\
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-%i%
REM
set i=images\smilies\medium
if not exist %GNUS_ETC_DIR%\%i%\nul mkdir %GNUS_ETC_DIR%\%i%
echo ** .\%i%\ ...
xcopy /R /Q /Y .\%i%\*.* %GNUS_ETC_DIR%\%i%\
if ErrorLevel 1 set ERROR=%ERROR%,copy-etc-%i%
REM
set i=
goto warnings
:nocopy
echo.
echo ***************************************************************************
echo * You chose not to copy the files, therefore you should add the
echo * following lines to the TOP of your [X]emacs customization file:
echo *
echo * (add-to-list 'load-path "/Path/to/gnus/lisp")
echo * (if (featurep 'xemacs)
echo * (add-to-list 'Info-directory-list "c:/Path/to/gnus/texi/")
echo * (add-to-list 'Info-default-directory-list "c:/Path/to/gnus/texi/"))
echo * (require 'gnus-load)
echo *
echo * Replace c:/Path/to/gnus with the Path where your new Gnus is (that's here
echo * and yes, you've got to use forward slashes).
echo ***************************************************************************
echo.
:warnings
if not "%subdirwarning%" == "yes" goto warngnusload
echo.
echo ***************************************************************************
echo * There's no subdirs.el file in your site-lisp directory, you should
echo * therefor add the following line to the TOP of your Emacs
echo * customization file:
echo *
echo * (add-to-list 'load-path "/Path/to/emacs-site-lisp-directory/gnus/lisp")
echo * (require 'gnus-load)
echo * Yes, it must be forward slashes.
echo ***************************************************************************
echo.
goto warnerrors
:warngnusload
echo.
echo ***************************************************************************
echo * You should add the following line to the TOP of your Emacs
echo * customization file:
echo *
echo * (require 'gnus-load)
echo ***************************************************************************
echo.
:warnerrors
if "%ERROR%"==":" goto noerrors
set errorlevel=1
echo.
echo ***************************************************************************
echo * WARNING ERRORS OCCURRED!
echo * You should look for error messages in the output of the called programs
echo * and try to find out what exactly went wrong.
echo * Errors occured in the following modules:
echo * %ERROR%
echo ***************************************************************************
echo.
goto done
:noerrors
set errorlevel=0
:done
cd ..
goto end
:noemacs
echo.
echo ***************************************************************************
echo * Unable to find emacs.exe or xemacs.exe on the path you specified!
echo * STOP!
echo ***************************************************************************
echo.
goto usage
:usage
echo.
echo ***************************************************************************
REM echo * Usage: make.bat :[X]Emacs-exe-dir: [/copy] [ ^> inst-log.txt 2^>^&1 ]
echo * Usage: make.bat :[X]Emacs-exe-dir: [/copy]
echo *
echo * where: :[X]Emacs-exe-dir: is the directory your
echo * emacs.exe respectively xemacs.exe resides in,
echo * e.g. G:\Programme\XEmacs\XEmacs-21.4.11\i586-pc-win32\
echo * or G:\Emacs\bin
echo * /copy indicates that the compiled files should be copied to your
echo * emacs lisp, info, and etc site directories.
REM echo * ^> inst-log.txt 2^>^&1
REM echo * Log output to inst-log.txt
echo *
echo * Note: If you have Emacs/w3 you should set the environment variable
echo * W3DIR to the directory where w3 is installed eg.
echo * set W3DIR=d:\lisp\w3-4.0pre46\lisp
echo ***************************************************************************
echo.
:end
rem Restore environment variables
set PWD=%GNUS_PWD_SAVE%
set GNUS_PWD_SAVE=
set EMACSBATCH=
set GNUS_LISP_DIR=
set GNUS_INFO_DIR=
set GNUS_ETC_DIR=
set subdirwarning=
set ERROR=