From 9c9b731958c39bb930a41a851f009eaf80c30702 Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Sat, 29 Jul 2017 17:35:25 +1000 Subject: [PATCH] Check-in of semi-working package. --- README.md | 23 ++++++ app-emulation/opennebula/Manifest | 1 + .../opennebula/files/opennebula-flow.init | 34 +++++++++ .../opennebula/files/opennebula-gate.init | 34 +++++++++ .../files/opennebula-sunstone-econe.init | 34 +++++++++ .../files/opennebula-sunstone-novnc.init | 34 +++++++++ .../opennebula/files/opennebula-sunstone.init | 31 ++++++++ .../opennebula/files/opennebula.init | 33 ++++++++ .../opennebula/opennebula-5.4.0.ebuild | 75 +++++++++++++++++++ metadata/layout.conf | 4 + profiles/categories | 1 + profiles/repo_name | 1 + 12 files changed, 305 insertions(+) create mode 100644 README.md create mode 100644 app-emulation/opennebula/Manifest create mode 100644 app-emulation/opennebula/files/opennebula-flow.init create mode 100644 app-emulation/opennebula/files/opennebula-gate.init create mode 100644 app-emulation/opennebula/files/opennebula-sunstone-econe.init create mode 100644 app-emulation/opennebula/files/opennebula-sunstone-novnc.init create mode 100644 app-emulation/opennebula/files/opennebula-sunstone.init create mode 100644 app-emulation/opennebula/files/opennebula.init create mode 100644 app-emulation/opennebula/opennebula-5.4.0.ebuild create mode 100644 metadata/layout.conf create mode 100644 profiles/categories create mode 100644 profiles/repo_name diff --git a/README.md b/README.md new file mode 100644 index 0000000..2fe5b78 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +Gentoo OpenNebula overlay +========================= + +The purpose of this repository is to provide the necessary packaging files for +installing the OpenNebula Enterprise Cloud software on a Gentoo Linux-based +host. + +Status +------ + +As of this time, the work contained herein is highly experimental and not at +all supported by myself or OpenNebula upstream. While some things may work, +the code is known to be broken on `musl`-based Gentoo systems and quite +possibly won't work in your environment. + +If it breaks, you get to keep the pieces. + +Usage +----- + +Clone the repository somewhere convenient, then add the cloned directory to +your `PORTDIR_OVERLAY` path. You should then be able to run +`emerge -a app-emulation/opennebula` to install OpenNebula on your system. diff --git a/app-emulation/opennebula/Manifest b/app-emulation/opennebula/Manifest new file mode 100644 index 0000000..f3561ed --- /dev/null +++ b/app-emulation/opennebula/Manifest @@ -0,0 +1 @@ +DIST opennebula-5.4.0.tar.gz 14626223 SHA256 a0419d624c40d2d72c75801a461f7a6d722acfa4555be1cb921122b3bfd0d4a8 SHA512 4d7d4f6c20a6185539a88006e4d15681d90cee45506d36017a538415a3b3cce809f02ff248013f9e2daa5f1d20afd308a0a014853b8462723ad6ba5acaa84626 WHIRLPOOL 1c9a5d1574a04369c2b3df80e00385045b3931153bab3a98a5f8e8082bf142fd0c95d41959ff50a681569c5ee6abd741d5d68fa9dfc2641403280c93502bce72 diff --git a/app-emulation/opennebula/files/opennebula-flow.init b/app-emulation/opennebula/files/opennebula-flow.init new file mode 100644 index 0000000..898ae91 --- /dev/null +++ b/app-emulation/opennebula/files/opennebula-flow.init @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +depend() { + need net + use opennebula +} + +# +# Function that starts the daemon/service +# +start() { + for d in /var/run/one /var/lock/one /var/log/one /var/lib/one + do + if [ ! -d ${d} ] + then + ebegin "Creating ${d}" + mkdir ${d} + eend $? + fi + chown -R oneadmin:oneadmin ${d} + done + ebegin "Starting OneFlow Service" + su oneadmin -s /bin/sh -c "/usr/bin/oneflow-server start" + eend $? +} + +# +# Function that stops the daemon/service +# +stop() { + ebegin "Stopping OneFlow Service" + su oneadmin -s /bin/sh -c "/usr/bin/oneflow-server stop" + eend $? +} diff --git a/app-emulation/opennebula/files/opennebula-gate.init b/app-emulation/opennebula/files/opennebula-gate.init new file mode 100644 index 0000000..390a8f5 --- /dev/null +++ b/app-emulation/opennebula/files/opennebula-gate.init @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +depend() { + need net + use opennebula +} + +# +# Function that starts the daemon/service +# +start() { + for d in /var/run/one /var/lock/one /var/log/one /var/lib/one + do + if [ ! -d ${d} ] + then + ebegin "Creating ${d}" + mkdir ${d} + eend $? + fi + chown -R oneadmin:oneadmin ${d} + done + ebegin "Starting OneGate Service" + su oneadmin -s /bin/sh -c "/usr/bin/onegate-server start" + eend $? +} + +# +# Function that stops the daemon/service +# +stop() { + ebegin "Stopping OneGate Service" + su oneadmin -s /bin/sh -c "/usr/bin/onegate-server stop" + eend $? +} diff --git a/app-emulation/opennebula/files/opennebula-sunstone-econe.init b/app-emulation/opennebula/files/opennebula-sunstone-econe.init new file mode 100644 index 0000000..8f43ed7 --- /dev/null +++ b/app-emulation/opennebula/files/opennebula-sunstone-econe.init @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +depend() { + need net + use opennebula +} + +# +# Function that starts the daemon/service +# +start() { + for d in /var/run/one /var/lock/one /var/log/one /var/lib/one + do + if [ ! -d ${d} ] + then + ebegin "Creating ${d}" + mkdir ${d} + eend $? + fi + chown -R oneadmin:oneadmin ${d} + done + ebegin "Starting OpenNebula ECONE Service" + su oneadmin -s /bin/sh -c "/usr/bin/econe-server start" + eend $? +} + +# +# Function that stops the daemon/service +# +stop() { + ebegin "Stopping OpenNebula ECONE Service" + su oneadmin -s /bin/sh -c "/usr/bin/econe-server stop" + eend $? +} diff --git a/app-emulation/opennebula/files/opennebula-sunstone-novnc.init b/app-emulation/opennebula/files/opennebula-sunstone-novnc.init new file mode 100644 index 0000000..2490bce --- /dev/null +++ b/app-emulation/opennebula/files/opennebula-sunstone-novnc.init @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +depend() { + need net + use opennebula +} + +# +# Function that starts the daemon/service +# +start() { + for d in /var/run/one /var/lock/one /var/log/one /var/lib/one + do + if [ ! -d ${d} ] + then + ebegin "Creating ${d}" + mkdir ${d} + eend $? + fi + chown -R oneadmin:oneadmin ${d} + done + ebegin "Starting OpenNebula NoVNC Server" + su oneadmin -s /bin/sh -c "/usr/bin/novnc-server start" + eend $? +} + +# +# Function that stops the daemon/service +# +stop() { + ebegin "Stopping OpenNebula NoVNC Server" + su oneadmin -s /bin/sh -c "/usr/bin/novnc-server stop" + eend $? +} diff --git a/app-emulation/opennebula/files/opennebula-sunstone.init b/app-emulation/opennebula/files/opennebula-sunstone.init new file mode 100644 index 0000000..575928e --- /dev/null +++ b/app-emulation/opennebula/files/opennebula-sunstone.init @@ -0,0 +1,31 @@ +#!/sbin/openrc-run + +depend() { + need net opennebula-sunstone-novnc + use opennebula +} + +# +# Function that starts the daemon/service +# +start() { + for d in /var/run/one /var/lock/one /var/log/one /var/lib/one + do + if [ ! -d ${d} ] + then + ebegin "Creating ${d}" + mkdir ${d} + eend $? + fi + chown -R oneadmin:oneadmin ${d} + done + ebegin "Starting OpenNebula Sunstone Web Interface" + su oneadmin -s /bin/sh -c "/usr/bin/sunstone-server start-sunstone" + eend $? +} + +stop() { + ebegin "Stopping OpenNebula Sunstone Web Interface" + su oneadmin -s /bin/sh -c "/usr/bin/sunstone-server stop-sunstone" + eend $? +} diff --git a/app-emulation/opennebula/files/opennebula.init b/app-emulation/opennebula/files/opennebula.init new file mode 100644 index 0000000..6ed6d5a --- /dev/null +++ b/app-emulation/opennebula/files/opennebula.init @@ -0,0 +1,33 @@ +#!/sbin/openrc-run + +depend() { + need net +} + +# +# Function that starts the daemon/service +# +start() { + for d in /var/run/one /var/lock/one /var/log/one /var/lib/one + do + if [ ! -d ${d} ] + then + ebegin "Creating ${d}" + mkdir ${d} + eend $? + fi + chown -R oneadmin:oneadmin ${d} + done + ebegin "Starting OpenNebula cloud" + su oneadmin -s /bin/sh -c '/usr/bin/one start' + eend $? +} + +# +# Function that stops the daemon/service +# +stop() { + ebegin "Stopping OpenNebula cloud" + su oneadmin -s /bin/sh -c '/usr/bin/one stop' + eend $? +} diff --git a/app-emulation/opennebula/opennebula-5.4.0.ebuild b/app-emulation/opennebula/opennebula-5.4.0.ebuild new file mode 100644 index 0000000..27623f0 --- /dev/null +++ b/app-emulation/opennebula/opennebula-5.4.0.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="OpenNebula Enterprise Cloud manager" +HOMEPAGE="https://opennebula.org" +SRC_URI="http://downloads.opennebula.org/packages/opennebula-${PV}/opennebula-${PV}.tar.gz" + +inherit scons-utils toolchain-funcs user + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="mysql" + +DEPEND="dev-lang/ruby + dev-db/sqlite + mysql? ( || ( dev-db/mariadb dev-db/mysql ) ) + dev-ruby/sqlite3 + dev-libs/xmlrpc-c[abyss] + dev-util/scons + dev-ruby/json + dev-ruby/sinatra + dev-ruby/uuidtools + dev-ruby/curb + dev-ruby/nokogiri" +RDEPEND="${DEPEND}" + +src_prepare() { + # Call this, or the setup will barf! + eapply_user + + # Patch the SUNSTONE_MINIFIED_DIRS variable, which is missing a + # $ sign + sed -i -e '/^SUNSTONE_MINIFIED_DIRS/ s/="SUNSTONE_LOCATION/="$SUNSTONE_LOCATION/g' \ + "${S}/install.sh" +} + +src_configure() { + MYSCONS=( + CC="$(tc-getCC)" + ) + if use mysql + then + MYSCONS[1]='mysql=yes' + fi +} + +src_compile() { + escons "${MYSCONS[@]}" +} + +src_install() { + cd "${S}" + unset ROOT + DESTDIR="${D}" ./install.sh -u oneadmin -g oneadmin || die + + # Install sunstone components, because the above script doesn't. + DESTDIR="${D}" ./install.sh -u oneadmin -g oneadmin -s -p || die + + # These directories should not be installed by us, so remove them + rm -fr "${D}/var/lock" "${D}/var/run" + + # Init scripts + for f in "${FILESDIR}"/*.init + do + newinitd "${f}" "$( basename "${f}" .init )" + done +} + +pkg_setup() { + enewgroup oneadmin + enewuser oneadmin -1 /bin/bash /var/lib/one oneadmin +} diff --git a/metadata/layout.conf b/metadata/layout.conf new file mode 100644 index 0000000..40ddc3e --- /dev/null +++ b/metadata/layout.conf @@ -0,0 +1,4 @@ +masters = gentoo +repo-name = sjlongland-opennebula +use-manifests = true +thin-manifests = true diff --git a/profiles/categories b/profiles/categories new file mode 100644 index 0000000..30fc903 --- /dev/null +++ b/profiles/categories @@ -0,0 +1 @@ +app-emulation diff --git a/profiles/repo_name b/profiles/repo_name new file mode 100644 index 0000000..61775d3 --- /dev/null +++ b/profiles/repo_name @@ -0,0 +1 @@ +sjlongland-opennebula