diff --git a/files/ebuilds/ceilometer-collector b/files/ebuilds/ceilometer-collector new file mode 100644 index 0000000000..11082eefc1 --- /dev/null +++ b/files/ebuilds/ceilometer-collector @@ -0,0 +1,4 @@ +# Not available in openSUSE main repositories, but can be fetched from OBS +# (devel:languages:python and server:database projects) +dev-db/mongodb +dev-python/pymongo diff --git a/files/ebuilds/cinder b/files/ebuilds/cinder new file mode 100644 index 0000000000..f154f811ef --- /dev/null +++ b/files/ebuilds/cinder @@ -0,0 +1,2 @@ +sys-fs/lvm2 +sys-block/tgt diff --git a/files/ebuilds/general b/files/ebuilds/general new file mode 100644 index 0000000000..e27b1076a2 --- /dev/null +++ b/files/ebuilds/general @@ -0,0 +1,24 @@ +net-misc/bridge-utils +net-misc/curl +euca2ools # NOPRIME +dev-vcs/git +net-misc/iputils +net-misc/openssh +dev-libs/openssl +sys-process/psmisc +dev-python/cmd2 +dev-python/netaddr +dev-python/pep8 +dev-python/pip +dev-python/pylint +dev-python/unittest2 +dev-python/virtualenv +app-misc/screen +app-arch/tar +net-analyzer/tcpdump +app-arch/unzip +app-editors/vim +net-misc/wget + +sys-apps/mlocate # useful when debugging +sys-process/lsof # useful when debugging diff --git a/files/ebuilds/glance b/files/ebuilds/glance new file mode 100644 index 0000000000..a19bdd48fd --- /dev/null +++ b/files/ebuilds/glance @@ -0,0 +1,12 @@ +sys-devel/gcc +dev-libs/libxml2 +dev-python/pastedeploy +dev-python/routes +dev-python/sqlalchemy +dev-python/argparse +dev-lang/python +dev-python/eventlet +dev-python/greenlet +dev-python/iso8601 +wsgiref # NOPRIME +dev-python/pyxattr diff --git a/files/ebuilds/horizon b/files/ebuilds/horizon new file mode 100644 index 0000000000..1d8e9f9c58 --- /dev/null +++ b/files/ebuilds/horizon @@ -0,0 +1,23 @@ +www-servers/apache +www-apache/mod_wsgi +net-libs/nodejs +dev-python/cherrypy +dev-python/paste +dev-python/pastedeploy +dev-python/routes +dev-python/sphinx +dev-python/sqlalchemy +dev-python/webob +dev-python/anyjson +dev-python/beautifulsoup +dev-python/coverage +dev-python/python-dateutil +dev-python/eventlet +dev-python/kombu +dev-python/mox +dev-python/netaddr +dev-python/nose +dev-python/pep8 +dev-python/pylint +dev-python/sqlalchemy-migrate +dev-python/pyxattr diff --git a/files/ebuilds/keystone b/files/ebuilds/keystone new file mode 100644 index 0000000000..130226e5a2 --- /dev/null +++ b/files/ebuilds/keystone @@ -0,0 +1,15 @@ +dev-libs/cyrus-sasl +net-nds/openldap +dev-python/paste +dev-python/pastedeploy +dev-python/pastescript +dev-python/routes +dev-python/sqlalchemy +dev-python/webob +dev-lang/python +dev-python/setuptools # instead of python-distribute; dist:sle11sp2 +dev-python/greenlet +dev-python/lxml +dev-python/mysql-python +dev-python/pysqlite # NOPRIME needs sqlite use flag +dev-db/sqlite diff --git a/files/ebuilds/ldap b/files/ebuilds/ldap new file mode 100644 index 0000000000..62d4eb311c --- /dev/null +++ b/files/ebuilds/ldap @@ -0,0 +1,2 @@ +net-nds/openldap +dev-python/python-ldap diff --git a/files/ebuilds/n-api b/files/ebuilds/n-api new file mode 100644 index 0000000000..2f870cff49 --- /dev/null +++ b/files/ebuilds/n-api @@ -0,0 +1,2 @@ +dev-python/python-ldap # temporary because this pulls in glance to get the client without running the glance prereqs +dev-python/python-dateutil diff --git a/files/ebuilds/n-cpu b/files/ebuilds/n-cpu new file mode 100644 index 0000000000..50996cef86 --- /dev/null +++ b/files/ebuilds/n-cpu @@ -0,0 +1,6 @@ +# Stuff for diablo volumes +app-cdr/cdrkit +sys-fs/lvm2 +sys-block/open-iscsi +sys-fs/sysfsutils +sys-apps/sg3_utils diff --git a/files/ebuilds/n-novnc b/files/ebuilds/n-novnc new file mode 100644 index 0000000000..d2179d4385 --- /dev/null +++ b/files/ebuilds/n-novnc @@ -0,0 +1 @@ +dev-python/numpy diff --git a/files/ebuilds/n-spice b/files/ebuilds/n-spice new file mode 100644 index 0000000000..d2179d4385 --- /dev/null +++ b/files/ebuilds/n-spice @@ -0,0 +1 @@ +dev-python/numpy diff --git a/files/ebuilds/nova b/files/ebuilds/nova new file mode 100644 index 0000000000..6bf2d7e98d --- /dev/null +++ b/files/ebuilds/nova @@ -0,0 +1,49 @@ +net-misc/curl +# Note: we need to package dhcp_release in dnsmasq! +net-dns/dnsmasq +net-firewall/ebtables +sys-apps/gawk +genisoimage # NOPRIME +net-firewall/iptables +net-misc/iputils +kpartx # NOPRIME +app-emulation/kvm-kmod # NOPRIME gentoo users compile their own KVM modules +# qemu as fallback if kvm cannot be used +app-emulation/qemu # NOPRIME +app-emulation/libvirt # NOPRIME +dev-db/mysql +sys-block/parted +dev-python/m2crypto +dev-python/paste +dev-python/pastedeploy +dev-python/routes +dev-python/sqlalchemy +dev-python/tempita +dev-python/boto +dev-python/carrot +dev-python/cheetah +dev-python/eventlet +dev-python/feedparser +dev-python/greenlet +dev-python/iso8601 +dev-python/kombu +dev-python/lockfile +dev-python/lxml # needed for glance which is needed for nova --- this shouldn't be here +dev-python/mox +dev-python/mysql-python +dev-python/netaddr +dev-python/numpy # needed by websockify for spice console +dev-python/paramiko +dev-python/python-gflags +dev-python/sqlalchemy-migrate +dev-python/suds +dev-python/pyxattr # needed for glance which is needed for nova --- this shouldn't be here +net-misc/rabbitmq-server +net-misc/socat +dev-db/sqlite +app-admin/sudo +vlan # NOPRIME + +# FIXME: qpid is not part of gentoo, those names are tentative +dev-python/qpid # NOPRIME +qpidd # NOPRIME diff --git a/files/ebuilds/postgresql b/files/ebuilds/postgresql new file mode 100644 index 0000000000..1564bd5091 --- /dev/null +++ b/files/ebuilds/postgresql @@ -0,0 +1 @@ +dev-python/psycopg diff --git a/files/ebuilds/quantum b/files/ebuilds/quantum new file mode 100644 index 0000000000..e59e0e40ea --- /dev/null +++ b/files/ebuilds/quantum @@ -0,0 +1,27 @@ +# Note: we need to package dhcp_release in dnsmasq! +net-dns/dnsmasq +net-firewall/ebtables +net-firewall/iptables +net-misc/iputils +dev-db/mysql +dev-python/boto +dev-python/eventlet +dev-python/greenlet +dev-python/iso8601 +dev-python/kombu +dev-python/mysql-python +dev-python/netaddr +dev-python/paste +dev-python/pastedeploy +dev-python/pyudev +dev-python/routes +dev-python/sqlalchemy +dev-python/suds +net-misc/rabbitmq-server +dev-db/sqlite +app-admin/sudo +vlan # NOPRIME + +# FIXME: qpid is not part of gentoo, those names are tentative +dev-python/qpid # NOPRIME +qpidd # NOPRIME diff --git a/files/ebuilds/ryu b/files/ebuilds/ryu new file mode 100644 index 0000000000..3fa48873c5 --- /dev/null +++ b/files/ebuilds/ryu @@ -0,0 +1,5 @@ +dev-python/setuptools +dev-python/sphinx +dev-python/gevent +dev-python/netifaces +dev-python/python-gflags diff --git a/files/ebuilds/swift b/files/ebuilds/swift new file mode 100644 index 0000000000..c63fecaa6a --- /dev/null +++ b/files/ebuilds/swift @@ -0,0 +1,17 @@ +net-misc/curl +sys-devel/gcc +net-misc/memcached +dev-python/pastedeploy +dev-python/webob +dev-python/configobj +dev-python/coverage +dev-python/setuptools # instead of python-distribute; dist:sle11sp2 +dev-python/eventlet +dev-python/greenlet +dev-python/netifaces +dev-python/nose +dev-python/simplejson +dev-python/pyxattr +dev-db/sqlite +sys-fs/xfsprogs +sys-apps/xinetd diff --git a/files/ebuilds/sysstat b/files/ebuilds/sysstat new file mode 100644 index 0000000000..09822f213d --- /dev/null +++ b/files/ebuilds/sysstat @@ -0,0 +1 @@ +app-admin/sysstat diff --git a/files/gentoo_package.use b/files/gentoo_package.use new file mode 100644 index 0000000000..deec46489e --- /dev/null +++ b/files/gentoo_package.use @@ -0,0 +1,5 @@ +# devstack addition +app-emulation/libvirt python +dev-libs/libxml2 python +dev-lang/python sqlite +app-emulation/libvirt qemu virt-network diff --git a/functions b/functions index dfde7dc551..549070c463 100644 --- a/functions +++ b/functions @@ -194,6 +194,8 @@ function _get_package_dir() { pkg_dir=$FILES/rpms elif is_suse; then pkg_dir=$FILES/rpms-suse + elif is_gentoo; then + pkg_dir=$FILES/ebuilds else exit_distro_not_supported "list of packages" fi @@ -266,9 +268,8 @@ function get_packages() { fi fi done - for file in ${file_to_parse}; do - local fname=${package_dir}/${file} + local fname="${package_dir}/${file}" local OIFS line package distros distro [[ -e $fname ]] || continue @@ -386,6 +387,13 @@ GetOSVersion() { os_PACKAGE="deb" os_CODENAME=$(awk '/VERSION=/' /etc/os-release | sed 's/VERSION=//' | sed -r 's/\"|\(|\)//g' | awk '{print $2}') os_RELEASE=$(awk '/VERSION_ID=/' /etc/os-release | sed 's/VERSION_ID=//' | sed 's/\"//g') + elif [[ -r /etc/gentoo-release ]]; then + os_VENDOR=`cat /etc/gentoo-release | cut -d ' ' -f 1` + os_RELEASE=`cat /etc/gentoo-release | cut -d ' ' -f 5` + os_CODENAME="$os_VENDOR $os_RELEASE" #gentoo does not use a code name + os_UPDATE=`emerge --version | cut -d ' ' -f 2` #portage version + os_PACKAGE="ebuild" + fi export os_VENDOR os_RELEASE os_UPDATE os_PACKAGE os_CODENAME } @@ -449,6 +457,8 @@ function GetDistro() { elif [[ "$os_VENDOR" =~ (Red Hat) || "$os_VENDOR" =~ (CentOS) ]]; then # Drop the . release as we assume it's compatible DISTRO="rhel${os_RELEASE::1}" + elif [[ "$os_VENDOR" =~ (Gentoo) ]]; then + DISTRO="gentoo-${os_RELEASE}" else # Catch-all for now is Vendor + Release + Update DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE" @@ -490,6 +500,16 @@ function is_suse { [ "$os_VENDOR" = "openSUSE" ] || [ "$os_VENDOR" = "SUSE LINUX" ] } +# Determine if current distribution is an Gentoo-based distribution. +# is_gentoo +function is_gentoo { + if [[ -z "$os_PACKAGE" ]]; then + GetOSVersion + fi + + [ "$os_PACKAGE" = "ebuild" ] +} + # Exit after outputting a message about the distribution not being supported. # exit_distro_not_supported [optional-string-telling-what-is-missing] @@ -824,6 +844,8 @@ function install_package() { yum_install "$@" elif is_suse; then zypper_install "$@" + elif is_gentoo; then + emerge_install "$@" else exit_distro_not_supported "installing packages" fi @@ -839,6 +861,8 @@ function uninstall_package() { sudo yum remove -y "$@" elif is_suse; then sudo rpm -e "$@" + elif is_gentoo; then + sudo emerge -C "$@" else exit_distro_not_supported "uninstalling packages" fi @@ -860,6 +884,8 @@ function is_package_installed() { dpkg -l "$@" > /dev/null elif [[ "$os_PACKAGE" = "rpm" ]]; then rpm --quiet -q "$@" + elif [[ "$os_PACKAGE" = "ebuild" ]]; then + cat /var/db/pkg/*/$@*/PF else exit_distro_not_supported "finding if a package is installed" fi @@ -916,6 +942,8 @@ function pip_install { function restart_service() { if is_ubuntu; then sudo /usr/sbin/service $1 restart + elsif is_gentoo + sudo /etc/init.d/$1 restart else sudo /sbin/service $1 restart fi @@ -1103,6 +1131,8 @@ function start_service() { function stop_service() { if is_ubuntu; then sudo /usr/sbin/service $1 stop + elif is_gentoo; then + sudo /etc/init.d/$1 stop else sudo /sbin/service $1 stop fi @@ -1295,6 +1325,18 @@ function yum_install() { yum install -y "$@" } +# Wrapper for ``emerge`` to set proxy environment variables +# emerge_install package [package ...] +function emerge_install() { + local sudo="sudo" + [[ "$(id -u)" = "0" ]] && sudo="env" + $sudo http_proxy=$http_proxy https_proxy=$https_proxy \ + no_proxy=$no_proxy \ + emerge "$@" +} + + + # ping check # Uses globals ``ENABLED_SERVICES`` function ping_check() { diff --git a/lib/cinder b/lib/cinder index 6636397e18..97481675ad 100644 --- a/lib/cinder +++ b/lib/cinder @@ -421,7 +421,7 @@ function start_cinder() { elif is_fedora; then # bypass redirection to systemctl during restart sudo /sbin/service --skip-redirect tgtd restart - elif is_suse; then + elif is_suse || is_gentoo; then restart_service tgtd else # note for other distros: unstack.sh also uses the tgt/tgtd service diff --git a/lib/databases/mysql b/lib/databases/mysql index 211d797d2b..bdd8845f8e 100644 --- a/lib/databases/mysql +++ b/lib/databases/mysql @@ -25,7 +25,7 @@ function cleanup_database_mysql { return elif is_fedora; then MYSQL=mysqld - elif is_suse; then + elif is_suse || is_gentoo; then MYSQL=mysql else return @@ -43,7 +43,7 @@ function recreate_database_mysql { function configure_database_mysql { echo_summary "Configuring and starting MySQL" - if is_ubuntu; then + if is_ubuntu || is_gentoo; then MY_CONF=/etc/mysql/my.cnf MYSQL=mysql elif is_fedora; then @@ -132,6 +132,8 @@ EOF install_package mysql-server elif is_suse; then install_package mysql-community-server + elif is_gentoo; then + install_package dev-db/mysql else exit_distro_not_supported "mysql installation" fi diff --git a/lib/databases/postgresql b/lib/databases/postgresql index b173772170..1c9a1dc3b3 100644 --- a/lib/databases/postgresql +++ b/lib/databases/postgresql @@ -22,7 +22,7 @@ function cleanup_database_postgresql { # Get ruthless with mysql sudo aptitude purge -y ~npostgresql return - elif is_fedora; then + elif is_fedora || is_gentoo; then uninstall_package postgresql-server else return @@ -52,6 +52,8 @@ function configure_database_postgresql { PG_CONF=/var/lib/pgsql/data/postgresql.conf # initdb is called when postgresql is first started sudo [ -e $PG_HBA ] || start_service postgresql + elif is_gentoo; then + emerge --config dev-db/postgresql-server else exit_distro_not_supported "postgresql configuration" fi @@ -81,7 +83,7 @@ EOF fi if is_ubuntu; then install_package postgresql - elif is_fedora || is_suse; then + elif is_fedora || is_suse || is_gentoo; then install_package postgresql-server else exit_distro_not_supported "postgresql installation" diff --git a/lib/quantum_plugins/ovs_base b/lib/quantum_plugins/ovs_base index a5e03acd51..d103df6f18 100644 --- a/lib/quantum_plugins/ovs_base +++ b/lib/quantum_plugins/ovs_base @@ -39,7 +39,7 @@ function _quantum_ovs_base_install_agent_packages() { if is_ubuntu; then kernel_version=`cat /proc/version | cut -d " " -f3` install_package make fakeroot dkms openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version - elif is_fedora; then + elif is_fedora || is_gentoo ; then install_package openvswitch # Ensure that the service is started restart_service openvswitch diff --git a/lib/rpc_backend b/lib/rpc_backend index 4b04053bac..f94df0ed72 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -128,6 +128,8 @@ function install_rpc_backend() { install_package libzmq1 python-zmq redis-server elif is_suse; then install_package libzmq1 python-pyzmq redis + elif is_gentoo; then + install_package zeromq pyzmq redis else exit_distro_not_supported "zeromq installation" fi @@ -193,7 +195,7 @@ function qpid_is_supported() { # Qpid was introduced to Ubuntu in precise, disallow it on oneiric; it is # not in openSUSE either right now. - ( ! ([[ "$DISTRO" = "oneiric" ]] || is_suse) ) + ( ! ([[ "$DISTRO" = "oneiric" ]] || is_suse || is_gentoo) ) } diff --git a/stack.sh b/stack.sh index 1e61a3f19a..c7deb156d5 100755 --- a/stack.sh +++ b/stack.sh @@ -142,7 +142,7 @@ disable_negated_services # Warn users who aren't on an explicitly supported distro, but allow them to # override check and attempt installation with ``FORCE=yes ./stack`` -if [[ ! ${DISTRO} =~ (oneiric|precise|quantal|raring|saucy|7.0|wheezy|sid|testing|jessie|f16|f17|f18|opensuse-12.2|rhel6) ]]; then +if [[ ! ${DISTRO} =~ (oneiric|precise|quantal|raring|saucy|7.0|wheezy|sid|testing|jessie|f16|f17|f18|opensuse-12.2|rhel6|gentoo-1.12.14|gentoo-2.2) ]]; then echo "WARNING: this script has not been tested on $DISTRO" if [[ "$FORCE" != "yes" ]]; then die $LINENO "If you wish to run this script anyway run with FORCE=yes" @@ -652,7 +652,11 @@ TRACK_DEPENDS=${TRACK_DEPENDS:-False} # Install python packages into a virtualenv so that we can track them if [[ $TRACK_DEPENDS = True ]]; then echo_summary "Installing Python packages into a virtualenv $DEST/.venv" - install_package python-virtualenv + if is_gentoo; then + install_package virtualenv + else + install_package python-virtualenv + fi rm -rf $DEST/.venv virtualenv --system-site-packages $DEST/.venv @@ -708,7 +712,9 @@ if is_service_enabled g-api n-api; then configure_glance fi +echo "CHECANDO CINDER" if is_service_enabled cinder; then + echo "INSTALANDO CINDER" install_cinder configure_cinder fi diff --git a/tools/info.sh b/tools/info.sh index 14ab8f6306..283a76b60f 100755 --- a/tools/info.sh +++ b/tools/info.sh @@ -93,6 +93,8 @@ for p in $(get_packages $ENABLED_SERVICES); do ver=$(dpkg -s $p 2>/dev/null | grep '^Version: ' | cut -d' ' -f2) elif [[ "$os_PACKAGE" = "rpm" ]]; then ver=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" $p) + elif [[ "$os_PACKAGE" = "ebuild" ]]; then + ver=$(cat /var/db/pkg/*/$p*/PF | cut -d'-' -f 2) else exit_distro_not_supported "finding version of a package" fi diff --git a/tools/install_prereqs.sh b/tools/install_prereqs.sh index 68f11ce35e..0203e5aa23 100755 --- a/tools/install_prereqs.sh +++ b/tools/install_prereqs.sh @@ -50,11 +50,20 @@ fi # Make sure the proxy config is visible to sub-processes export_proxy_variables +#Add gentoo use flags +if is_gentoo; then + TEST_DEVSTACK=$(grep devstack /etc/portage/package.use || echo "0") + if [[ ! "$TEST_DEVSTACK" =~ "devstack" ]]; then + echo "Setting gentoo use flags $FILES/gentoo_package.use" + cat $FILES/gentoo_package.use >> /etc/portage/package.use + fi +fi # Install Packages # ================ # Install package requirements +testvar=$(get_packages $ENABLED_SERVICES) install_package $(get_packages $ENABLED_SERVICES) if [[ -n "$SYSLOG" && "$SYSLOG" != "False" ]]; then