--- /dev/null
+#!/usr/bin/env bash
+
+build() {
+ if [[ $YES != "y" ]]
+ then
+ echo "Do you want Raisin to automatically install build time dependencies for you? (y/n)"
+ while read answer
+ do
+ if [[ "$answer" = "n" ]]
+ then
+ NO_DEPS=1
+ break
+ elif [[ "$answer" = "y" ]]
+ then
+ break
+ else
+ echo "Reply y or n"
+ fi
+ done
+ fi
+
+ mkdir -p "$INST_DIR" &>/dev/null
+ install_dependencies git
+ if [[ $DISTRO = "Fedora" ]]
+ then
+ install_dependencies rpm-build
+ fi
+ # build and install under $DESTDIR
+ for_each_component clean
+ for_each_component build
+
+ build_package xen-system
+}
+
+unraise() {
+ for_each_component clean
+
+ uninstall_package xen-system
+ for_each_component unconfigure
+
+ rm -rf "$INST_DIR"
+}
+
+install() {
+ # need single braces for filename matching expansion
+ if [ ! -f xen-sytem*rpm ] && [ ! -f xen-system*deb ]
+ then
+ echo You need to raise build first.
+ exit 1
+ fi
+ install_package xen-system
+}
+
+configure() {
+ if [[ $YES != "y" ]]
+ then
+ echo "Proceeding we'll make changes to the running system,"
+ echo "are you sure that you want to continue? (y/n)"
+ while read answer
+ do
+ if [[ "$answer" = "n" ]]
+ then
+ exit 0
+ elif [[ "$answer" = "y" ]]
+ then
+ break
+ else
+ echo "Reply y or n"
+ fi
+ done
+ fi
+
+ for_each_component configure
+}
+
--- /dev/null
+#!/usr/bin/env bash
+
+set -e
+
+_help() {
+ echo "Usage: ./build.sh <options> <command>"
+ echo "where options are:"
+ echo " -n | --no-deps Do no install build-time dependencies"
+ echo " -v | --verbose Verbose"
+ echo " -y | --yes Do not ask questions and continue"
+ echo "where commands are:"
+ echo " build Build the components enabled in config"
+ echo " install Install binaries under / (requires sudo)"
+ echo " configure Configure the system (requires sudo)"
+ echo " unraise Uninstall and unconfigure the system (requires sudo)"
+}
+
+# Include your defaults
+if [[ -e "./config" ]] ; then
+ . ./config
+fi
+
+# To use this as a library, set RAISIN_PATH appropriately
+[[ -z "$RAISIN_PATH" ]] && RAISIN_PATH="$PWD/lib"
+
+# Then as many as the sub-libraries as you need
+source ${RAISIN_PATH}/common-functions.sh
+source ${RAISIN_PATH}/git-checkout.sh
+source ${RAISIN_PATH}/commands.sh
+
+# Set up basic functionality
+common_init
+
+# parameters check
+export VERBOSE=0
+export YES="n"
+export NO_DEPS=0
+while [[ $# -gt 1 ]]
+do
+ if [[ "$1" = "-v" || "$1" = "--verbose" ]]
+ then
+ VERBOSE=1
+ shift 1
+ elif [[ "$1" = "-y" || "$1" = "--yes" ]]
+ then
+ YES="y"
+ shift 1
+ else
+ _help
+ exit 1
+ fi
+done
+
+case "$1" in
+ "build" | "install" | "configure" | "unraise" )
+ COMMAND=$1
+ ;;
+ *)
+ _help
+ exit 1
+ ;;
+esac
+
+$COMMAND
+
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-source config
-source lib/common-functions.sh
-source lib/git-checkout.sh
-
-_help() {
- echo "Usage: ./build.sh <options> <command>"
- echo "where options are:"
- echo " -n | --no-deps Do no install build-time dependencies"
- echo " -v | --verbose Verbose"
- echo " -y | --yes Do not ask questions and continue"
- echo "where commands are:"
- echo " build Build the components enabled in config"
- echo " install Install binaries under / (requires sudo)"
- echo " configure Configure the system (requires sudo)"
-}
-
-_build() {
- if [[ $YES != "y" ]]
- then
- echo "Do you want Raisin to automatically install build time dependencies for you? (y/n)"
- while read answer
- do
- if [[ "$answer" = "n" ]]
- then
- NO_DEPS=1
- break
- elif [[ "$answer" = "y" ]]
- then
- break
- else
- echo "Reply y or n"
- fi
- done
- fi
-
- mkdir -p "$INST_DIR" &>/dev/null
- install_dependencies git
- if [[ $DISTRO = "Fedora" ]]
- then
- install_dependencies rpm-build
- fi
- # build and install under $DESTDIR
- for_each_component clean
- for_each_component build
-
- build_package xen-system
-}
-
-_install() {
- # need single braces for filename matching expansion
- if [ ! -f xen-sytem*rpm ] && [ ! -f xen-system*deb ]
- then
- echo You need to raise.sh build first.
- exit 1
- fi
- install_package xen-system
-}
-
-_configure() {
- if [[ $YES != "y" ]]
- then
- echo "Proceeding we'll make changes to the running system,"
- echo "are you sure that you want to continue? (y/n)"
- while read answer
- do
- if [[ "$answer" = "n" ]]
- then
- exit 0
- elif [[ "$answer" = "y" ]]
- then
- break
- else
- echo "Reply y or n"
- fi
- done
- fi
-
- for_each_component configure
-}
-
-# start execution
-common_init
-
-# parameters check
-export VERBOSE=0
-export YES="n"
-export NO_DEPS=0
-while [[ $# -gt 1 ]]
-do
- if [[ "$1" = "-v" || "$1" = "--verbose" ]]
- then
- VERBOSE=1
- shift 1
- elif [[ "$1" = "-y" || "$1" = "--yes" ]]
- then
- YES="y"
- shift 1
- else
- _help
- exit 1
- fi
-done
-
-case "$1" in
- "build" | "install" | "configure" )
- COMMAND=$1
- ;;
- *)
- _help
- exit 1
- ;;
-esac
-
-_$COMMAND
-
cp -r data deb/opt/raisin
cp -r components deb/opt/raisin
cp -r scripts deb/opt/raisin
-cp config raise.sh unraise.sh deb/opt/raisin
+cp -r lib deb/opt/raisin
+cp config raise deb/opt/raisin
# Debian doesn't use /usr/lib64 for 64-bit libraries
cp -r "$BASEDIR"/data \$RPM_BUILD_ROOT/opt/raisin
cp -r "$BASEDIR"/components \$RPM_BUILD_ROOT/opt/raisin
cp -r "$BASEDIR"/scripts \$RPM_BUILD_ROOT/opt/raisin
+cp -r "$BASEDIR"/lib \$RPM_BUILD_ROOT/opt/raisin
cp "$BASEDIR"/config \$RPM_BUILD_ROOT/opt/raisin
-cp "$BASEDIR"/raise.sh \$RPM_BUILD_ROOT/opt/raisin
-cp "$BASEDIR"/unraise.sh \$RPM_BUILD_ROOT/opt/raisin
+cp "$BASEDIR"/raise \$RPM_BUILD_ROOT/opt/raisin
%clean
+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-source config
-source lib/common-functions.sh
-
-
-# start execution
-common_init
-
-for_each_component clean
-
-uninstall_package xen-system
-for_each_component unconfigure
-
-rm -rf "$INST_DIR"