dodan override za lintian
[ossec-hids.git] / src / win32 / gen_win.cmd
1 REM Generate windows packages
2 REM Author: Michael Starks
3 REM Based on gen_win.sh by Daniel Cid
4
5 REM This program is a free software; you can redistribute it
6 REM and/or modify it under the terms of the GNU General Public
7 REM License (version 2) as published by the FSF - Free Software
8 REM Foundation
9
10 REM Enable delayed variable expansion
11 SETLOCAL ENABLEDELAYEDEXPANSION
12 SET FILE=win-files.txt
13 SET WINPKG=win-pkg
14
15 REM Check for public domain unix2dos.exe. It can be found here: http://www.efgh.com/software/unix2dos.htm
16 IF NOT EXIST unix2dos.exe echo unix2dos.exe not found, exiting... && EXIT 1
17
18 REM Generating configs
19 unix2dos.exe ossec.conf 
20 type ossec.conf > ossec-win.conf
21 unix2dos.exe help.txt
22 type help.txt > help_win.txt
23 unix2dos.exe ..\..\etc\internal_options.conf
24 type ..\..\etc\internal_options.conf > internal_options-win.conf
25 unix2dos.exe ..\..\LICENSE
26 type ..\..\LICENSE > LICENSE.txt
27 unix2dos.exe ..\..\active-response\win\route-null.cmd
28 type ..\..\active-response\win\route-null.cmd > route-null.cmd
29 unix2dos.exe ..\..\active-response\win\restart-ossec.cmd
30 type ..\..\active-response\win\restart-ossec.cmd > restart-ossec.cmd
31
32 REM Going to the source dir
33 cd ..
34 IF NOT EXIST %WINPKG%\setup mkdir %WINPKG%\setup
35
36 FOR /F "tokens=1,2 delims= " %%i in (Win32\%FILE%) DO (
37   REM Fix the slash
38   SET FS1=%%i
39   SET FS1=!FS1:/=\!
40   SET FS2=%%j
41   SET FS2=!FS2:/=\!
42   IF EXIST !FS1!\NUL (
43     xcopy "!FS1!" "%WINPKG%\!FS2!" /E /I /F /Y || echo Error copying !FS1! to "%WINPKG%\!FS2!" && EXIT 1
44   ) ELSE (
45   copy !FS1! "%WINPKG%\!FS2!" || echo Error copying !FS1! to "%WINPKG%\!FS2!" EXIT 1
46   )
47 )
48
49 REM Final cleanup
50 del %WINPKG%\os_crypto\md5\main.c
51 del %WINPKG%\os_crypto\blowfish\main.c
52 del %WINPKG%\os_crypto\sha1\main.c
53 del %WINPKG%\os_crypto\md5_sha1\main.c
54 del %WINPKG%\shared\rules_op.c
55
56 ENDLOCAL