ubuntu-15.10-install.sh 1.29 KB
Newer Older
Ciro Santilli's avatar
Ciro Santilli committed
1 2 3 4 5 6 7
#!/usr/bin/env bash

# Build and install to a local prefix under this repository.

# Flags:

  # -g: install globally instead for all users
8
  # -s: link everything statically, no D-Bus communication. More likely to work!
Ciro Santilli's avatar
Ciro Santilli committed
9 10 11 12

set -ex

global=false
13 14
static=''
while getopts gs OPT; do
Ciro Santilli's avatar
Ciro Santilli committed
15 16 17 18
  case "$OPT" in
    g)
      global='true'
    ;;
19 20 21
    s)
      static='-DENABLE_STATIC=true'
    ;;
Ciro Santilli's avatar
Ciro Santilli committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    \?)
      exit 1
    ;;
  esac
done

make_install() {
  if $1; then
    sudo make install
  else
    make install
  fi
}

./ubuntu-15.10-dependencies.sh

TOP="$(pwd)"
INSTALL="${TOP}/install"

cd daemon
DAEMON="$(pwd)"
cd contrib
mkdir -p native
cd native
../bootstrap
make -j$(nproc)
cd "${DAEMON}"
./autogen.sh
if $global; then
  ./configure
else
  ./configure --prefix="${INSTALL}/daemon"
fi
make -j$(nproc)
make_install $global

cd "${TOP}/lrc"
mkdir -p build
cd build
if $global; then
62
  cmake .. -DCMAKE_BUILD_TYPE=Debug $static
Ciro Santilli's avatar
Ciro Santilli committed
63
else
64
  cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" -DRING_BUILD_DIR="${DAEMON}/src" $static
Ciro Santilli's avatar
Ciro Santilli committed
65 66 67 68 69 70 71 72
fi
make
make_install $global

cd "${TOP}/client-gnome"
mkdir -p build
cd build
if $global; then
73
  cmake .. $static
Ciro Santilli's avatar
Ciro Santilli committed
74
else
75
  cmake .. -DCMAKE_INSTALL_PREFIX="${INSTALL}/client-gnome" -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" $static
Ciro Santilli's avatar
Ciro Santilli committed
76 77 78
fi
make
make_install $global