Changes between Version 4 and Version 5 of PatchingDebs
- Timestamp:
- 01/13/16 09:47:13 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PatchingDebs
v4 v5 1 1 = Introduction = 2 2 3 The NSI script in [https://github.com/OpenVPN/openvpn-build openvpn-build repository] makes use of [http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries EnvVarUpdate.nsh] to append ''OpenVPN\bin'' to the system-wide PATH variable on Windows. When using default NSIS builds, PATH can't be longer than 1024 characters or OpenVPN install destroys it. To support longer PATHs you need rebuild ''makensis'' with larger ''NSIS_MAX_STRLEN''. 3 Official OpenVPN builds for Windows use the [https://github.com/OpenVPN/openvpn-build openvpn-build buildsystem], which uses MakeNSIS and mingw-w64 internally. Patched versions of both are required due to few issues: 4 4 5 = Rebuilding NSIS on Ubuntu 12.04 = 5 * The ''openvpn.nsi'' script makes use of [http://nsis.sourceforge.net/Environmental_Variables:_append,_prepend,_and_remove_entries EnvVarUpdate.nsh] to append ''OpenVPN\bin'' to the system-wide PATH variable on Windows. When using default NSIS builds, PATH can't be longer than 1024 characters or OpenVPN install destroys it. To support longer PATHs you need rebuild ''makensis'' with larger ''NSIS_MAX_STRLEN''. 6 * The mingw-w64 packages have buggy header files which prevent building of recent OpenVPN versions (2.3.8+ or so). 6 7 7 Here we rebuild ''nsis'' and ''nsis-common'' Debian packages with custom configuration. It is suggested that you [wiki:SettingUpGenericBuildsystem set up the openvpn-build buildsystem] using the automated script, because that installs most mingw-w64 tools you'll need. Once openvpn-build is setup, a few extra packages have to be installed: 8 = Preparations = 9 10 You need apt-src to build customized Debian packages: 8 11 9 12 {{{ 10 $ apt-get update 11 $ apt-get install apt-src g++-mingw-w64 13 $ apt-get install apt-src 12 14 }}} 13 15 14 Next fetch the NSIS sources:16 Because apt-src is a bit messy, it's best to create a separate working directory: 15 17 16 18 {{{ 19 $ mkdir ~/apt-src 20 }}} 21 22 = Rebuilding NSIS = 23 24 Here we rebuild ''nsis'' and ''nsis-common'': 25 26 {{{ 27 $ cd ~/apt-src 17 28 $ apt-src install nsis 18 29 }}} … … 25 36 }}} 26 37 27 N owbuild the packages:38 Next add a changelog entry as described below, then build the packages: 28 39 29 40 {{{ … … 31 42 }}} 32 43 33 Finally, install the customized packages using dpkg: 44 = Rebuilding mingw-w64 = 45 46 The process is about the same as for NSIS: 34 47 35 48 {{{ 36 $ dpkg -i nsis_2.46-* nsis-common_2.46-* 49 $ cd ~/apt-src 50 $ apt-src install mingw 37 51 }}} 38 52 39 If you now rebuild openvpn, the installer should support appending to long PATHs. 53 Download the two patches (''fwptypes.h.patch'' and ''iketypes.h.patch''). Copy the patches to the patches directory and the series file: 40 54 41 = Installing patched nsis_2.46 Ubuntu packages = 55 {{{ 56 $ cp *.patch ~/apt-src/mingw-w64-3.1.0/debian/patches 57 $ echo fwptypes.h.patch >> ~/apt-src/mingw-w64-3.1.0/debian/patches/series 58 $ echo iketypes.h.patch >> ~/apt-src/mingw-w64-3.1.0/debian/patches/series 59 }}} 42 60 43 Instead of patching and building nsis yourself, you can try installing standard nsis packages from Ubuntu 12.04 repositories and then installing 44 [http://build.openvpn.net/downloads/packaging these nsis packages] on top of those. Their build number is set high to prevent standard packages from overwriting them during system upgrades. 61 Next add a changelog entry as described below, then build mingw-w64: 62 63 {{{ 64 $ apt-src build mingw-w64 65 }}} 66 67 = Adding changelog entries = 68 69 Adding a changelog entry is important, because that determines the version and build number of the package. The changelog is in ''debian/changelog'', and an entry looks like this: 70 71 {{{ 72 mingw-w64 (3.1.0-101) unstable; urgency=medium 73 74 * Fixes to header files to allow OpenVPN builds 75 76 -- John Doe <john@domain.com> Wed, 13 Jan 2016 07:00:00 +0000 77 }}} 78 79 Note the last number (101) in the version: it prevents the package from getting updates (broken) by package updates from the stock Ubuntu repositories.