From a72b021d098f6f49b5112ff2f63b7d0ee965e4db Mon Sep 17 00:00:00 2001 From: Vasyl Khomenko Date: Sat, 2 Feb 2013 04:20:29 +0400 Subject: [PATCH] Added centos 6.3 support --- conf/distros/rhel.yaml | 4 +++- smithy | 25 +++++++++++++++++++++---- tools/bootstrap/CentOS | 26 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 tools/bootstrap/CentOS diff --git a/conf/distros/rhel.yaml b/conf/distros/rhel.yaml index b033cfb1..8d4b4a19 100644 --- a/conf/distros/rhel.yaml +++ b/conf/distros/rhel.yaml @@ -1,7 +1,7 @@ --- # RedHat Enterprise Linux 6.0+ name: rhel -platform_pattern: redhat(.*) +platform_pattern: redhat(.*)|centos(.*) packager_name: anvil.packaging.yum:YumPackager commands: apache: @@ -320,6 +320,8 @@ components: pips: - name: nosexcover # Seems to be only in test-requires - name: setuptools-git # Seems to be only in test-requires + - name: discover # Seems to be only in test-requires + - name: testrepository # Seems to be only in test-requires horizon: action_classes: install: anvil.distros.rhel:HorizonInstaller diff --git a/smithy b/smithy index cbde03c6..20b00c3e 100755 --- a/smithy +++ b/smithy @@ -134,11 +134,28 @@ puke() ## Identify which bootstrap configuration file to use: either set ## explicitly (BSCONF_FILE) or determined based on the os distribution: BSCONF_DIR=${BSCONF_DIR:-$(dirname $(readlink -f "$0"))/tools/bootstrap} -TYPE=$(lsb_release -d | cut -f 2) -RELEASE=$(lsb_release -r | cut -f 2) +get_os_info(){ + OS=`uname` + if [ "${OS}" = "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + PKG="rpm" + OSNAME=`cat /etc/redhat-release` + OSDIST=`cat /etc/redhat-release | sed -e 's/release.*$//g;s/\s//g'` + PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` + RELEASE=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` + elif [ -f /etc/debian_version ] ; then + PKG="deb" + OSDIST=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }'` + PSUEDONAME=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }'` + RELEASE=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'` + OSNAME="$OSDIST $RELEASE ($PSUEDONAME)" + fi + fi +} + +get_os_info if [ -z "$BSCONF_FILE" ]; then - OSDIST=$(echo $TYPE | sed -e 's/release.*$//g;s/\s//g') BSCONF_FILE="$BSCONF_DIR/$OSDIST" fi @@ -179,7 +196,7 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi if [ ! -f $BSCONF_FILE ]; then - echo "Anvil has not been tested on distribution '$TYPE'" >&2 + echo "Anvil has not been tested on distribution '$OSNAME'" >&2 puke fi echo "Sourcing $BSCONF_FILE" diff --git a/tools/bootstrap/CentOS b/tools/bootstrap/CentOS new file mode 100644 index 00000000..2d5ad4f7 --- /dev/null +++ b/tools/bootstrap/CentOS @@ -0,0 +1,26 @@ +## Bootstrap for CentOS Linux 6.x +SHORTNAME=CENTOS +MIN_RELEASE=6.0 +STEPS="epel packages" +EPEL_RPM_URL="http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm" +## Package Requirements (Order matters!) +require rpm PyYAML +require rpm gcc +require rpm git +require rpm pylint +require rpm python +require rpm python-devel +require rpm python-iso8601 +require rpm python-netifaces +require rpm python-ordereddict +require rpm python-pip +require rpm python-progressbar +require rpm python-psutil +require rpm python-iniparse +require rpm patch +require pypi termcolor +require pypi hgtools +require pypi 'keyring>=0.9.2' +# This matches the nova version and doesn't really +# need to be a strong dependency for anvil to work.. +require pypi 'Cheetah==2.4.4'