aboutsummaryrefslogtreecommitdiff
path: root/install-win32/makeservice
blob: 647e17890d4643773378fade27c034c437cd6377 (plain) (blame)
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
#!/bin/sh

# get version.nsi definitions
. autodefs/defs.sh

# build OpenVPN service (openvpnserv.exe)
if [ -d "$SVC_TEMPLATE" ] ; then
    # silly vista security theatre
    PATCH="/tmp/p.exe"
    cp `which patch` $PATCH

    # build service sources
    cp $SVC_TEMPLATE/service.[ch] service-win32
    cd service-win32
    cp service.c service.c.orig
    cp service.h service.h.orig
    $PATCH <service.patch

    # compile/link
    [ "$CLEAN" = "yes" ] && make clean
    make -j $MAKE_JOBS
    cd ..

    # copy service to GENOUT/bin
    mkdir $GENOUT/bin &>/dev/null
    cp service-win32/${PRODUCT_UNIX_NAME}serv.exe $GENOUT/bin
    if [ -z "$NO_STRIP" ]; then
	strip $GENOUT/bin/${PRODUCT_UNIX_NAME}serv.exe
    fi
else
    echo OpenVPN service not built -- template directory $SVC_TEMPLATE NOT FOUND
fi