Last active
February 22, 2017 10:43
-
-
Save RGPaul/b3b4429b45f2370ed806d94bc6ffcd12 to your computer and use it in GitHub Desktop.
Build latest OpenVPN CLI Binary on MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Script for building OpenVPN CLI (MacOS) | |
# This Script requires that the OpenSSL Library (1.0.x) and the LZO Library are installed under /usr/local/lib and the | |
# headers under /usr/local/include | |
# For compiling the OpenSSL Library see: https://gist.github.com/Manromen/0cd572aa7694d6902260 | |
# For compiling the LZO Library see: https://gist.github.com/Manromen/ac41c615aa4a95134eae6813402dd297 | |
# | |
# OpenSSL Library: https://www.openssl.org | |
# LZO Library: https://www.oberhumer.com/opensource/lzo/ | |
# set the version to build | |
OPENVPN_VERSION="2.4.0" | |
# download src if not already present | |
if [ ! -f openvpn-${OPENVPN_VERSION}.tar.gz ]; then | |
curl -O https://swupdate.openvpn.org/community/releases/openvpn-${OPENVPN_VERSION}.tar.gz | |
fi | |
# untar source | |
tar -xvzf openvpn-${OPENVPN_VERSION}.tar.gz | |
mv openvpn-${OPENVPN_VERSION} openvpn | |
cd openvpn | |
# configure | |
CFLAGS="-I/usr/local/include -L/usr/local/lib" ./configure | |
# build | |
make | |
cd .. | |
# copy executable | |
mkdir ${OPENVPN_VERSION} | |
cp openvpn/src/openvpn/openvpn ${OPENVPN_VERSION}/ | |
# cleanup temporary build folder | |
rm -rf openvpn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment