1 | #!/bin/sh |
---|
2 | # |
---|
3 | # Script to setup the environment for openvpn-build/generic and openvpn-build/windows-nsis |
---|
4 | |
---|
5 | BUILD_DEPS="mingw-w64 man2html dos2unix nsis unzip wget curl autoconf libtool gcc-arm-linux-gnueabi" |
---|
6 | OSSLSIGNCODE_DEPS="libssl-dev libcurl4-openssl-dev build-essential" |
---|
7 | OSSLSIGNCODE_URL="http://sourceforge.net/projects/osslsigncode/files/latest/download" |
---|
8 | OSSLSIGNCODE_PACKAGE="osslsigncode-latest.tar.gz" |
---|
9 | OPENVPN_BUILD_URL="https://github.com/OpenVPN/openvpn-build.git" |
---|
10 | MINGW_PACKAGES="mingw-w64 mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev" |
---|
11 | NSIS_PACKAGES="nsis nsis-common nsis-doc nsis-pluginapi" |
---|
12 | GIT_PKG="git" |
---|
13 | |
---|
14 | check_if_root() { |
---|
15 | if ! [ `whoami` = "root" ]; then |
---|
16 | echo "ERROR: you must run this script as root!" |
---|
17 | exit 1 |
---|
18 | fi |
---|
19 | } |
---|
20 | |
---|
21 | install_packages() { |
---|
22 | apt-get update |
---|
23 | apt-get -y install $BUILD_DEPS $GIT_PKG $GNUEABI_PKG $MINGW_PACKAGES $NSIS_PACKAGES |
---|
24 | } |
---|
25 | |
---|
26 | # osslsigncode is required for signing the binaries and installers |
---|
27 | install_osslsigncode() { |
---|
28 | apt-get -y install $OSSLSIGNCODE_DEPS |
---|
29 | curl -L $OSSLSIGNCODE_URL > $OSSLSIGNCODE_PACKAGE |
---|
30 | tar -zxf $OSSLSIGNCODE_PACKAGE |
---|
31 | cd osslsigncode-* |
---|
32 | ./configure |
---|
33 | make |
---|
34 | make install |
---|
35 | cd .. |
---|
36 | } |
---|
37 | |
---|
38 | clone_openvpn_build() { |
---|
39 | if ! [ -d "openvpn-build" ]; then |
---|
40 | git clone $OPENVPN_BUILD_URL |
---|
41 | fi |
---|
42 | } |
---|
43 | |
---|
44 | # Main script |
---|
45 | check_if_root |
---|
46 | install_packages |
---|
47 | install_osslsigncode |
---|
48 | clone_openvpn_build |
---|