diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2007-03-06 06:48:09 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2007-03-06 06:48:09 +0000 |
commit | f9ad66c789308d99576ca5d28b1bedf973957ab2 (patch) | |
tree | 2bd88a8bf758ac32c8e8e85bfdeb2cd068626536 /install-win32 | |
parent | Allow installation of TAP-Win64 (diff) | |
download | openvpn-f9ad66c789308d99576ca5d28b1bedf973957ab2.tar.xz |
Changes to Windows build environment, to allow straightforward building
directly from an svn checkout or export.
install-win32/version.nsi contains high-level version info.
The script install-win32/winconfig should be run initially to set up
build configuration files.
Then make can be executed as such:
. autodefs/nsidefs.sh
make -f makefile.w32 -j 2
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1757 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'install-win32')
-rw-r--r-- | install-win32/macro.pl | 28 | ||||
-rw-r--r-- | install-win32/nsitran.pl | 16 | ||||
-rwxr-xr-x | install-win32/openvpn.nsi (renamed from install-win32/openvpn.nsi.in) | 3 | ||||
-rwxr-xr-x | install-win32/prebuild | 159 | ||||
-rw-r--r-- | install-win32/preconfig.patch | 76 | ||||
-rw-r--r-- | install-win32/version.nsi | 9 | ||||
-rw-r--r-- | install-win32/winconfig | 27 |
7 files changed, 82 insertions, 236 deletions
diff --git a/install-win32/macro.pl b/install-win32/macro.pl new file mode 100644 index 0000000..e3a7f30 --- /dev/null +++ b/install-win32/macro.pl @@ -0,0 +1,28 @@ +die "usage: macro.pl <control-file>" if (@ARGV < 1); +($control_file) = @ARGV; + +open(CONTROL, "< $control_file") or die "cannot open $control_file"; + +%Parms = (); + +while (<CONTROL>) { + chomp; + if (/^!define\s+(\w+)\s+['"]?(.+?)['"]?\s*$/) { + $Parms{$1} = $2 + } +} + +while (<STDIN>) { + s{ + @@ + \s* + ( + \w+ + ) + \s* + @@ + }{ + $Parms{$1} + }xge; + print; +} diff --git a/install-win32/nsitran.pl b/install-win32/nsitran.pl new file mode 100644 index 0000000..7c04e40 --- /dev/null +++ b/install-win32/nsitran.pl @@ -0,0 +1,16 @@ +($mode) = @ARGV; + +while (<STDIN>) { + chomp; + if (/^\s*$/) { + print "\n"; + } elsif (/^[#;](.*)$/) { + print "//$1\n" if ($mode eq "c"); + print "#$1\n" if ($mode eq "sh"); + print "//$1\n" if ($mode eq "js"); + } elsif (/^!define\s+(\w+)\s+(.+)$/) { + print "#define $1 $2\n" if ($mode eq "c"); + print "export $1=$2\n" if ($mode eq "sh"); + print "var $1=$2;\n" if ($mode eq "js"); + } +} diff --git a/install-win32/openvpn.nsi.in b/install-win32/openvpn.nsi index 298046e..2ab2f54 100755 --- a/install-win32/openvpn.nsi.in +++ b/install-win32/openvpn.nsi @@ -7,6 +7,7 @@ ; OpenVPN install script for Windows, using NSIS +!include "version.nsi" !include "MUI.nsh" !include "setpath.nsi" !include "GetWindowsVersion.nsi" @@ -15,7 +16,7 @@ !define BIN "${HOME}\bin" !define PRODUCT_NAME "OpenVPN" -!define VERSION "@VERSION@" # AUTO_VERSION +!define VERSION "${PRODUCT_VERSION}" !define TAP "tap0901" !define TAPDRV "${TAP}.sys" diff --git a/install-win32/prebuild b/install-win32/prebuild deleted file mode 100755 index 7aec69a..0000000 --- a/install-win32/prebuild +++ /dev/null @@ -1,159 +0,0 @@ -# Given a standard OpenVPN tarball tree, -# build a Windows tree which is NSIS-ready. -# -# Requires: -# MinGW -# MSYS GNU shell environment -# See other requirements below - -# Top level directory. -H=/c/src - -# Output NSIS-ready tree here (will be deleted -# if already exists). -OUT=$H/21 - -# Source distribution is here. Can be the top -# level directory of exploded tarball. -IN=/y/openvpn/21/openvpn - -# Already built OpenSSL tree. -SSL=$H/openssl-0.9.7l - -# Already built LZO tree. -LZO=$H/lzo-2.02 - -# Already built dmalloc tree. -# Optional, but leave defined even if you are not using -# dmalloc. -DMALLOC=$H/dmalloc-5.4.2 - -# TAP binaries should be here: tap0901.sys and tapinstall.exe -# These must be built with MS DDK. -TAPBIN=$H/tapbin-0901 -TAPBIN64=$H/tapbin64-0901 - -# u2d.c should exist here. -SCRIPTS=$IN/install-win32 - -# Put service.[ch] here from MS Platform SDK. -SVC_TEMPLATE=$H/svc-template - -# Misc files/directories which should be copied to OUT (optional) -MISC=$H/add - -# Temporary directory -TMP=/tmp - -# End of user-defined parameters. - -U2D=$TMP/u2d - -echo BUILD u2d -gcc -O2 $SCRIPTS/u2d.c -o $U2D - -echo BUILD output dir from source -rm -rf $OUT -mkdir $OUT -mkdir $OUT/pkcs11-headers - -cp $IN/*.[ch] $OUT -rm -f $OUT/config.h -cp $IN/pkcs11-headers/*.h $OUT/pkcs11-headers - -if [ $MISC ]; then - cp $MISC/*.* $OUT -fi - -echo BUILD makefile - -sed "s#^OPENSSL = .*\$#OPENSSL = $SSL#" <$IN/makefile.w32 | \ -sed "s#^LZO = .*\$#LZO = $LZO#" | \ -sed "s#^DMALLOC = .*\$#DMALLOC = $DMALLOC#" >$OUT/Makefile - -echo BUILD bin - -mkdir $OUT/bin -for f in libeay32.dll libssl32.dll openssl.exe ; do - cp $SSL/$f $OUT/bin - strip $OUT/bin/$f -done - -echo BUILD install-win32 - -mkdir $OUT/install-win32 - -cp $IN/install-win32/openvpn.nsi $OUT/install-win32 -cp $IN/install-win32/setpath.nsi $OUT/install-win32 -cp $IN/install-win32/GetWindowsVersion.nsi $OUT/install-win32 -cp $IN/images/install-whirl.bmp $OUT/install-win32 -cp $IN/images/openvpn.ico $OUT/install-win32 -cp $IN/INSTALL-win32.txt $OUT/install-win32 -cat $IN/COPYING $IN/COPYRIGHT.GPL | $U2D >$OUT/install-win32/license.txt - -$U2D <$IN/sample-config-files/client.conf >$OUT/install-win32/client.ovpn -$U2D <$IN/sample-config-files/server.conf >$OUT/install-win32/server.ovpn -cp $IN/install-win32/sample.ovpn $OUT/install-win32 -$U2D <$IN/easy-rsa/1.0/openssl.cnf >$OUT/install-win32/openssl.cnf.sample - -echo BUILD tap-win32 for x86 and amd64 - -mkdir $OUT/tap-win32 -cp $IN/tap-win32/*.[ch] $OUT/tap-win32 -cp $IN/tap-win32/*.rc $OUT/tap-win32 -cp $IN/tap-win32/MAKEFILE $OUT/tap-win32 -cp $IN/tap-win32/SOURCES $OUT/tap-win32 - -mkdir $OUT/tap-win32/i386 -cp $TAPBIN/OemWin2k.inf $OUT/tap-win32/i386 -cp $TAPBIN/tap.cat $OUT/tap-win32/i386 -cp $TAPBIN/tap0901.sys $OUT/tap-win32/i386 - -mkdir $OUT/tap-win32/amd64 -cp $TAPBIN64/OemWin2k.inf $OUT/tap-win32/amd64 -cp $TAPBIN64/tap.cat $OUT/tap-win32/amd64 -cp $TAPBIN64/tap0901.sys $OUT/tap-win32/amd64 - -mkdir $OUT/bin/ti3790-i386 -cp $TAPBIN/tapinstall.exe $OUT/bin/ti3790-i386 -mkdir $OUT/bin/ti3790-amd64 -cp $TAPBIN64/tapinstall.exe $OUT/bin/ti3790-amd64 - -echo BUILD service-win32 - -mkdir $OUT/service-win32 -cp $IN/service-win32/Makefile $OUT/service-win32 -cp $IN/service-win32/mkpatch $OUT/service-win32 -cp $IN/service-win32/openvpnserv.c $OUT/service-win32 -cp $IN/service-win32/service.patch $OUT/service-win32 - -cp $SVC_TEMPLATE/service.[ch] $OUT/service-win32 -cp $OUT/service-win32/service.h $OUT/service-win32/service.h.orig -cp $OUT/service-win32/service.c $OUT/service-win32/service.c.orig - -pushd $OUT/service-win32 - -# Vista security theatre -cp `which patch` p.exe - -./p <service.patch -popd - -echo BUILD easy-rsa -cp -a $IN/easy-rsa $OUT - -echo BUILD sample-keys -cp -a $IN/sample-keys $OUT - -echo COMPILE OpenVPN -pushd $OUT -make -strip openvpn.exe -popd - -echo COMPILE OpenVPN Service -pushd $OUT/service-win32 -make clean -make -strip openvpnserv.exe -popd diff --git a/install-win32/preconfig.patch b/install-win32/preconfig.patch deleted file mode 100644 index 62bb895..0000000 --- a/install-win32/preconfig.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- openvpn.nsi 2005-12-27 19:34:10.000000000 -0700 -+++ planet.nsi 2005-12-29 16:00:41.253252888 -0700 -@@ -19,11 +19,19 @@ - !define TAP "tap0801" - !define TAPDRV "${TAP}.sys" - -+# PRECONFIG -+ - ; something like "-DBG2" --!define OUTFILE_LABEL "" -+!define OUTFILE_LABEL "-PC" - - ; something like "DEBUG2" --!define TITLE_LABEL "" -+!define TITLE_LABEL "Planet" -+ -+!define PRECONFIG_DIR "..\..\preconfig" -+!define GUI_EXE "openvpn-gui-1.0.3.exe" -+!define CONFIG_FILE "planet.ovpn" -+ -+# END PRECONFIG - - ; Default service settings - !define SERV_CONFIG_DIR "$INSTDIR\config" -@@ -188,6 +196,10 @@ - - File "${HOME}\openvpn.exe" - -+# PRECONFIG -+ File "${PRECONFIG_DIR}\${GUI_EXE}" -+# END PRECONFIG -+ - SectionEnd - - Section "OpenVPN RSA Certificate Management Scripts" SecOpenVPNEasyRSA -@@ -222,6 +234,10 @@ - - SetOutPath "$INSTDIR\config" - -+# PRECONFIG -+ File "${PRECONFIG_DIR}\${CONFIG_FILE}" -+# END PRECONFIG -+ - FileOpen $R0 "$INSTDIR\config\README.txt" w - FileWrite $R0 "This directory should contain OpenVPN configuration files$\r$\n" - FileWrite $R0 "each having an extension of .${SERV_CONFIG_EXT}$\r$\n" -@@ -422,8 +438,16 @@ - !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\run" "" "Start OpenVPN on this config file" - !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\run\command" "" '"$INSTDIR\bin\openvpn.exe" --pause-exit --config "%1"' - -- ; Create start menu shortcuts to addtap.bat and deltapall.bat - noass: -+ -+# PRECONFIG -+ ; Create GUI shortcut -+ IfFileExists "$INSTDIR\bin\${GUI_EXE}" "" nogui -+ CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN GUI.lnk" "$INSTDIR\bin\${GUI_EXE}" "" -+ nogui: -+# END PRECONFIG -+ -+ ; Create start menu shortcuts to addtap.bat and deltapall.bat - IfFileExists "$INSTDIR\bin\addtap.bat" "" trydeltap - CreateShortCut "$SMPROGRAMS\OpenVPN\Add a new TAP-Win32 virtual ethernet adapter.lnk" "$INSTDIR\bin\addtap.bat" "" - -@@ -513,6 +537,11 @@ - - RMDir /r $SMPROGRAMS\OpenVPN - -+# PRECONFIG -+ Delete "$INSTDIR\config\${CONFIG_FILE}" -+ Delete "$INSTDIR\bin\${GUI_EXE}" -+# END PRECONFIG -+ - Delete "$INSTDIR\bin\openvpn.exe" - Delete "$INSTDIR\bin\openvpnserv.exe" - Delete "$INSTDIR\bin\libeay32.dll" diff --git a/install-win32/version.nsi b/install-win32/version.nsi new file mode 100644 index 0000000..7aeaca4 --- /dev/null +++ b/install-win32/version.nsi @@ -0,0 +1,9 @@ +; Version numbers and settings + +!define PRODUCT_VERSION "2.1_rc2c" +!define OPENSSL_VERSION "0.9.7l" + +; TAP Adapter +!define PRODUCT_TAP_MAJOR_VER 9 +!define PRODUCT_TAP_MINOR_VER 2 +!define PRODUCT_TAP_RELDATE "03/05/2007" diff --git a/install-win32/winconfig b/install-win32/winconfig new file mode 100644 index 0000000..01deebd --- /dev/null +++ b/install-win32/winconfig @@ -0,0 +1,27 @@ +#!/bin/sh + +# prepare files for building on Windows +# run from top directory: install-win32/winconfig + +c=`pwd` + +rm -rf autodefs +mkdir autodefs + +TRAN="perl install-win32/nsitran.pl" +VER=install-win32/version.nsi +MACRO="perl install-win32/macro.pl $HSV" +PATCH="/tmp/p.exe" + +cp `which patch` $PATCH + +$TRAN c <$VER >autodefs/nsidefs.h +$TRAN sh <$VER >autodefs/nsidefs.sh + +$MACRO $VER <tap-win32/SOURCES.in >tap-win32/SOURCES +$MACRO $VER <tap-win32/i386/OemWin2k.inf.in >tap-win32/i386/OemWin2k.inf +rm -rf tap-win32/amd64 +mkdir tap-win32/amd64 +cp tap-win32/i386/OemWin2k.inf tap-win32/amd64 +cd tap-win32/amd64 +$PATCH <../inf64.patch |