Skip to content
Snippets Groups Projects
Commit ddc9e48c authored by Alexander Schlarb's avatar Alexander Schlarb
Browse files

make-ring: Avoid unquoted shell variables wherever possible (install.sh)

Change-Id: I9d580743ebe40a8c9edc534ba23b5ddbb01e921b
parent 2d6169b0
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ set -ex ...@@ -15,7 +15,7 @@ set -ex
global=false global=false
static='' static=''
client='' client=''
proc='' proc='1'
while getopts gsc:p: OPT; do while getopts gsc:p: OPT; do
case "$OPT" in case "$OPT" in
g) g)
...@@ -37,7 +37,7 @@ while getopts gsc:p: OPT; do ...@@ -37,7 +37,7 @@ while getopts gsc:p: OPT; do
done done
make_install() { make_install() {
if $1; then if [ "$1" = "true" ]; then
sudo make install sudo make install
# Or else the next non-sudo install will fail, because this generates some # Or else the next non-sudo install will fail, because this generates some
# root owned files like install_manifest.txt under the build directory. # root owned files like install_manifest.txt under the build directory.
...@@ -50,7 +50,7 @@ make_install() { ...@@ -50,7 +50,7 @@ make_install() {
TOP="$(pwd)" TOP="$(pwd)"
INSTALL="${TOP}/install" INSTALL="${TOP}/install"
if $global; then if [ "${global}" = "true" ]; then
BUILDDIR="build-global" BUILDDIR="build-global"
else else
BUILDDIR="build-local" BUILDDIR="build-local"
...@@ -71,38 +71,38 @@ if [[ "$OSTYPE" != "darwin"* ]]; then ...@@ -71,38 +71,38 @@ if [[ "$OSTYPE" != "darwin"* ]]; then
sharedLib="--disable-shared" sharedLib="--disable-shared"
fi fi
if $global; then if [ "${global}" = "true" ]; then
./configure $sharedLib $CONFIGURE_FLAGS ./configure $sharedLib $CONFIGURE_FLAGS
else else
./configure $sharedLib $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon" ./configure $sharedLib $CONFIGURE_FLAGS --prefix="${INSTALL}/daemon"
fi fi
make -j${proc} make -j"${proc}"
make_install $global make_install "${global}"
cd "${TOP}/lrc" cd "${TOP}/lrc"
mkdir -p ${BUILDDIR} mkdir -p "${BUILDDIR}"
cd ${BUILDDIR} cd "${BUILDDIR}"
if $global; then if [ "${global}" = "true" ]; then
cmake .. -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_BUILD_TYPE=Debug $static cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_BUILD_TYPE=Debug $static
else else
cmake .. -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" \ -DCMAKE_INSTALL_PREFIX="${INSTALL}/lrc" \
-DRING_BUILD_DIR="${DAEMON}/src" $static -DRING_BUILD_DIR="${DAEMON}/src" $static
fi fi
make -j${proc} make -j"${proc}"
make_install $global make_install "${global}"
cd "${TOP}/${client}" cd "${TOP}/${client}"
mkdir -p ${BUILDDIR} mkdir -p "${BUILDDIR}"
cd ${BUILDDIR} cd "${BUILDDIR}"
if $global; then if [ "${global}" = "true" ]; then
cmake .. -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH $static cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" $static
else else
cmake .. -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ cmake .. -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL}/${client}" \
-DRINGTONE_DIR="${INSTALL}/daemon/share/ring/ringtones" \ -DRINGTONE_DIR="${INSTALL}/daemon/share/ring/ringtones" \
-DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" $static -DLibRingClient_DIR="${INSTALL}/lrc/lib/cmake/LibRingClient" $static
fi fi
make -j${proc} make -j"${proc}"
make_install $global make_install "${global}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment