diff --git a/README.md b/README.md index 047d5f69937e34608f4436cd0ecb4307da01886b..addc03232c3a7bedd5a2a55ae6a40057464a8f75 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,28 @@ I'd rather have a single Git repo, but without official support, maintaining a m Build and install locally under this repository: - ./ubuntu-15.10-local-install.sh + ./ubuntu-15.10-install.sh -Run daemon and client on background: +Run daemon and client that were installed locally on the background: ./ubuntu-15.10-run.sh +Stdout and stderr go to `daemon.log` and `client-gnome.log`. + Stop daemon and client: ./ubuntu-15.10-stop.sh +Install globally for all users instead: + + ./ubuntu-15.10-install.sh -g + +Run global install: + + gnome-ring + +This already starts the daemon for us. + ## Ubuntu 15.10 host Android device This script does not automate the installation of any Android development tools. diff --git a/ubuntu-15.10-install.sh b/ubuntu-15.10-install.sh new file mode 100755 index 0000000000000000000000000000000000000000..03270b48e6ecd872d59171e55c9ce56ba46fe594 --- /dev/null +++ b/ubuntu-15.10-install.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +# Build and install to a local prefix under this repository. + +# Flags: + + # -g: install globally instead for all users + +set -ex + +global=false +while getopts g OPT; do + case "$OPT" in + g) + global='true' + ;; + \?) + 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 + cmake .. -DCMAKE_BUILD_TYPE=Debug +else + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" -DRING_BUILD_DIR="${DAEMON}/src" +fi +# If we don't use -DENABLE_STATIC here and on the client, +# we'd have to point LD_LIBRARY_PATH to the directory containing libringclient.so +make +make_install $global + +cd "${TOP}/client-gnome" +mkdir -p build +cd build +if $global; then + cmake .. +else + cmake .. -DCMAKE_INSTALL_PREFIX="${INSTALL}/client-gnome" -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" +fi +make +make_install $global diff --git a/ubuntu-15.10-local-install.sh b/ubuntu-15.10-local-install.sh deleted file mode 100755 index 8315ccb779d3d6dc5f0eae877187f7b8fa984c23..0000000000000000000000000000000000000000 --- a/ubuntu-15.10-local-install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# Build and install to a local prefix under this repository. - -set -e - -./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 -./configure --prefix="${INSTALL}/daemon" -make -j$(nproc) -make install - -cd "${TOP}/lrc" -mkdir -p build -cd build -# If we don't use -DENABLE_STATIC here and on the client, -# we'd have to point LD_LIBRARY_PATH to the directory containing libringclient.so -cmake .. \ - -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" \ - -DRING_BUILD_DIR="${DAEMON}/src" -make -make install - -cd "${TOP}/client-gnome" -mkdir -p build -cd build -cmake .. \ - -DCMAKE_INSTALL_PREFIX="${INSTALL}/client-gnome" \ - -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" -make -make install