SettingUpGenericBuildsystem: setup-generic-buildsystem.6.sh

File setup-generic-buildsystem.6.sh, 1.4 KB (added by Samuli Seppänen, 5 years ago)

openvpn-build setup script for Ubuntu 16.04

Line 
1#!/bin/sh
2#
3# Script to setup the environment for openvpn-build/generic and openvpn-build/windows-nsis
4
5BUILD_DEPS="mingw-w64 man2html dos2unix nsis unzip wget curl autoconf libtool gcc-arm-linux-gnueabi"
6OSSLSIGNCODE_DEPS="libssl-dev libcurl4-openssl-dev build-essential"
7OSSLSIGNCODE_URL="http://sourceforge.net/projects/osslsigncode/files/latest/download"
8OSSLSIGNCODE_PACKAGE="osslsigncode-latest.tar.gz"
9OPENVPN_BUILD_URL="https://github.com/OpenVPN/openvpn-build.git"
10MINGW_PACKAGES="mingw-w64 mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev"
11NSIS_PACKAGES="nsis nsis-common nsis-doc nsis-pluginapi"
12GIT_PKG="git"
13
14check_if_root() {
15    if ! [ `whoami` = "root" ]; then
16            echo "ERROR: you must run this script as root!"
17            exit 1
18    fi
19}
20
21install_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
27install_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
38clone_openvpn_build() {
39    if ! [ -d "openvpn-build" ]; then
40        git clone $OPENVPN_BUILD_URL
41    fi
42}
43
44# Main script
45check_if_root
46install_packages
47install_osslsigncode
48clone_openvpn_build