Imported Upstream version 2.3
[ossec-hids.git] / src / win32 / gen_win.sh
1 #!/bin/sh
2
3 # Generate windows packages
4 DIR=`dirname $0`;
5 FILE="win-files.txt"
6 CAT=`cat ${FILE}`
7 WINPKG="win-pkg"
8
9 # Generating configs
10 ./unix2dos.pl ossec.conf > ossec-win.conf
11 ./unix2dos.pl help.txt > help_win.txt
12 ./unix2dos.pl ../../etc/internal_options.conf > internal_options-win.conf
13 ./unix2dos.pl ../../LICENSE > LICENSE.txt
14 ./unix2dos.pl ../../active-response/win/route-null.cmd > route-null.cmd
15 ./unix2dos.pl ../../active-response/win/restart-ossec.cmd > restart-ossec.cmd
16
17 # Going to the source dir
18 cd ${DIR}
19 CAT=`cat ${FILE}`
20 cd ..
21 mkdir ${WINPKG}
22 mkdir ${WINPKG}/setup
23
24 source=""
25 dest=""
26 for i in ${CAT}; do
27     echo $i;
28     if [ "X${source}" = "X" ]; then
29         source=$i;
30     elif [ "X${dest}" = "X" ]; then
31         dest=$i;
32         echo "cp -pr ${source} ${WINPKG}/${dest}"
33         cp -pr ${source} "${WINPKG}/${dest}"
34         if [ ! $? = 0 ]; then
35             echo "Error copying ${source} to ${WINPKG}/${dest}"
36             exit 1;
37         fi    
38         source=""
39         dest=""
40     fi            
41 done    
42
43 # Final cleanup
44 rm ${WINPKG}/os_crypto/md5/main.c
45 rm ${WINPKG}/os_crypto/blowfish/main.c
46 rm ${WINPKG}/os_crypto/sha1/main.c
47 rm ${WINPKG}/os_crypto/md5_sha1/main.c
48 rm ${WINPKG}/shared/rules_op.c