From: George Dunlap Date: Mon, 20 Apr 2015 15:04:58 +0000 (+0000) Subject: raisin: Use PKGTYPE rather than DISTRO to determine how to build a package X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=49b5a84ac66585f03a58f51a4aa82c8eb9f02b11;p=raisin.git raisin: Use PKGTYPE rather than DISTRO to determine how to build a package From: George Dunlap Signed-off-by: George Dunlap Signed-off-by: Stefano Stabellini --- diff --git a/README b/README index e9a2413..847128e 100644 --- a/README +++ b/README @@ -80,6 +80,7 @@ GIT: git command to run, but prefer the git-checkout.sh script RAISIN_MAKE: make command to run SUDO: sudo command to run DISTRO: which Linux distribution we are running on, Debian, Fedora, etc +PKGTYPE: which package format is used by the distro, rpm, deb, etc ARCH: which architecture we are running on, x86_64, arm32, etc. BASEDIR: absolute path of the raisin directory PREFIX: installation PREFIX diff --git a/lib/common-functions.sh b/lib/common-functions.sh index 05e8fa8..5aecdb9 100644 --- a/lib/common-functions.sh +++ b/lib/common-functions.sh @@ -245,16 +245,16 @@ function for_each_component () { done } +function _build_package_deb() { + fakeroot bash ./scripts/mkdeb "$1" +} + +function _build_package_rpm() { + ./scripts/mkrpm "$1" +} + function build_package() { - if [[ $DISTRO = "Debian" ]] - then - fakeroot bash ./scripts/mkdeb "$1" - elif [[ $DISTRO = "Fedora" ]] - then - ./scripts/mkrpm "$1" - else - echo "Don't know how to create packages for $DISTRO" - fi + _build_package_"$PKGTYPE" "$1" } function install_package() {