# -------------------------------------------------------------------------- # # Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # # a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an "AS IS" BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # %define oneadmin_home /var/lib/one %define oneadmin_uid 9869 %define oneadmin_gid 9869 %define with_docker_machine 0%{?_with_docker_machine:1} %define with_provision 0%{?_with_provision:1} %define with_cli_extensions 0%{?_with_cli_extensions:1} %define realversion 5.6.2 #FIX: Problematic architecture dependent file in Sunstone noarch package: # src/sunstone/public/node_modules/node-sass/vendor/linux-x64-48/binding.node %define _binaries_in_noarch_packages_terminate_build 0 Name: opennebula Version: 5.6.2 Summary: Cloud computing solution for Data Center Virtualization Release: 1 License: Apache Group: System URL: http://opennebula.org Source0: opennebula-%{realversion}.tar.gz Source1: 50-org.libvirt.unix.manage-opennebula.pkla Source2: xmlrpc-c.tar.gz Source3: build_opennebula.sh Source4: xml_parse_huge.patch %if %{with_docker_machine} Source5: opennebula-docker-machine-%{version}.tar.gz %endif %if %{with_provision} Source6: opennebula-provision-%{version}.tar.gz %endif %if %{with_cli_extensions} Source7: opennebula-cli-extensions-%{version}.tar.gz %endif Patch0: proper_path_emulator.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root ################################################################################ # Build Requires ################################################################################ BuildRequires: gcc-c++ BuildRequires: libcurl-devel BuildRequires: libxml2-devel BuildRequires: xmlrpc-c-devel BuildRequires: openssl-devel BuildRequires: mysql-devel BuildRequires: sqlite-devel BuildRequires: openssh BuildRequires: pkgconfig BuildRequires: ruby BuildRequires: scons BuildRequires: sqlite-devel BuildRequires: xmlrpc-c BuildRequires: java-1.7.0-openjdk-devel BuildRequires: ws-commons-util BuildRequires: xmlrpc-common BuildRequires: xmlrpc-client BuildRequires: systemd-devel ################################################################################ # Requires ################################################################################ Requires: openssl Requires: openssh Requires: sqlite Requires: openssh-clients Requires: %{name}-common = %{version} Requires: %{name}-ruby = %{version} ################################################################################ # Main Package ################################################################################ Packager: OpenNebula Team %description OpenNebula.org is an open-source project aimed at building the industry standard open source cloud computing tool to manage the complexity and heterogeneity of distributed data center infrastructures. The OpenNebula.org Project is maintained and driven by the community. The OpenNebula.org community has thousands of users, contributors, and supporters, who interact through various online email lists, blogs and innovative projects to support each other. OpenNebula is free software released under the Apache License. This package provides the CLI interface. ################################################################################ # Package opennebula-server ################################################################################ %package server Summary: Provides the OpenNebula servers Group: System Requires: %{name} = %{version} Requires: openssh-server Requires: genisoimage Requires: qemu-img Requires: xmlrpc-c Requires: nfs-utils Requires: wget Requires: curl Requires: rsync Requires: iputils Obsoletes: %{name}-ozones #TODO: Requires http://rubygems.org/gems/net-ldap %description server This package provides the OpenNebula servers: oned (main daemon) and mm_sched (scheduler). ################################################################################ # Package common ################################################################################ %package common Summary: Provides the OpenNebula user Group: System BuildArch: noarch Requires: shadow-utils Requires: coreutils Requires: sudo Requires: glibc-common %description common This package creates the oneadmin user and group, with id/gid 9869. ################################################################################ # Package ruby ################################################################################ %package ruby Summary: Provides the OpenNebula Ruby libraries Group: System BuildArch: noarch Requires: ruby Requires: rubygems #Requires: rubygem-sqlite3-ruby Requires: rubygem-json #Requires: rubygem-rack #Requires: rubygem-sinatra #Requires: rubygem-thin #Requires: rubygem-uuidtools Requires: rubygem-nokogiri #Requires: rubygem-sequel #Requires: ruby-mysql # curb => For EC2 and OCCI uploads (OPTIONAL: falls back to multipart) # Missing gems # aws-sdk => EC2 hybrid driver (EPEL) # mysql => Required to handle MySQL DB upgrades (EPEL) # treetop => OneFlow (EPEL) # amazon-ec2 => used for ec2 server (expose OpenNebula with an EC2 interface) # net-ldap => Ldap authentication # parse-cron => OneFlow %description ruby Ruby interface for OpenNebula. ################################################################################ # Package sunstone ################################################################################ %package sunstone Summary: Browser based UI and public cloud interfaces. BuildArch: noarch Requires: %{name}-common = %{version} Requires: %{name}-ruby = %{version} Requires: python Requires: numpy %description sunstone Browser based UI for administrating a OpenNebula cloud. Also includes the public cloud interface econe-server (AWS cloud API). ################################################################################ # Package gate ################################################################################ %package gate Summary: Transfer information from Virtual Machines to OpenNebula BuildArch: noarch Requires: %{name}-common = %{version} Requires: %{name}-ruby = %{version} %description gate Transfer information from Virtual Machines to OpenNebula ################################################################################ # Package flow ################################################################################ %package flow Summary: Manage OpenNebula Services BuildArch: noarch Requires: %{name}-common = %{version} Requires: %{name}-ruby = %{version} %description flow Manage OpenNebula Services ################################################################################ # Package Docker Machine ONE driver ################################################################################ %if %{with_docker_machine} %package -n docker-machine-opennebula Summary: OpenNebula driver for Docker Machine %description -n docker-machine-opennebula OpenNebula driver for the Docker Macihne %endif ################################################################################ # Package provisioning tool ################################################################################ %if %{with_provision} %package provision Summary: OpenNebula host provisioning tool BuildArch: noarch #Requires: %{name} = %{version} #Requires: %{name}-common = %{version} #Requires: %{name}-server = %{version} #Requires: %{name}-ruby = %{version} Requires: %{name} >= 5.4.11, %{name} < 5.7.0 Requires: %{name}-common >= 5.4.11, %{name}-common < 5.7.0 Requires: %{name}-server >= 5.4.11, %{name}-server < 5.7.0 Requires: %{name}-ruby >= 5.4.11, %{name}-ruby < 5.7.0 %description provision OpenNebula host provisioning tool %endif ################################################################################ # Package CLI extensions ################################################################################ %if %{with_cli_extensions} %package cli-extensions Summary: OpenNebula enterprise CLI extensions BuildArch: noarch Requires: %{name} = %{version} Requires: %{name}-server = %{version} %description cli-extensions Enterprise CLI extensions for OpenNebula %endif ################################################################################ # Package java ################################################################################ %package java Summary: Java interface to OpenNebula Cloud API Group: System BuildArch: noarch Requires: ws-commons-util Requires: xmlrpc-common Requires: xmlrpc-client %description java Java interface to OpenNebula Cloud API. ################################################################################ # Package node-kvm ################################################################################ %package node-kvm Summary: Configures an OpenNebula node providing kvm Group: System Conflicts: %{name}-node-xen BuildArch: noarch Requires: ruby Requires: openssh-server Requires: openssh-clients Requires: rsync Requires: libvirt Requires: qemu-kvm Requires: qemu-img Requires: nfs-utils Requires: bridge-utils Requires: ipset Requires: pciutils Requires: cronie Requires: augeas # This package does not exist in CentOS 7 Requires: %{name}-common = %{version} %description node-kvm Configures an OpenNebula node providing kvm. ################################################################################ # Package node-xen ################################################################################ # %package node-xen # Summary: Configures an OpenNebula node providing xen # Group: System # Conflicts: %{name}-node-kvm # Requires: centos-release-xen # Requires: ruby # Requires: openssh-server # Requires: openssh-clients # Requires: xen # Requires: nfs-utils # Requires: bridge-utils # Requires: %{name}-common = %{version} # # %description node-xen # Configures an OpenNebula node providing xen. ################################################################################ # Build and install ################################################################################ %prep %setup -q -n opennebula-%{realversion} %if %{with_docker_machine} %setup -T -D -a 5 %endif %if %{with_provision} %setup -T -D -a 6 %endif %if %{with_cli_extensions} %setup -T -D -a 7 %endif %patch0 -p1 %build # Uncompress xmlrpc-c and copy build_opennebula.sh ( cd .. tar xzvf %{SOURCE2} cp %{SOURCE3} %{SOURCE4} . ) # Compile OpenNebula # scons -j2 mysql=yes new_xmlrpc=yes ../build_opennebula.sh systemd=yes cd src/oca/java ./build.sh -d %install export DESTDIR=%{buildroot} ./install.sh %if %{with_docker_machine} ./install.sh -e %endif %if %{with_provision} ( cd provision ./install.sh ) %endif %if %{with_cli_extensions} ( cd cli-extensions ./install.sh ) %endif # Init scripts install -p -D -m 644 share/pkgs/CentOS7/opennebula.service %{buildroot}/lib/systemd/system/opennebula.service install -p -D -m 644 share/pkgs/CentOS7/opennebula-scheduler.service %{buildroot}/lib/systemd/system/opennebula-scheduler.service install -p -D -m 644 share/pkgs/CentOS7/opennebula-sunstone.service %{buildroot}/lib/systemd/system/opennebula-sunstone.service install -p -D -m 644 share/pkgs/CentOS7/opennebula-gate.service %{buildroot}/lib/systemd/system/opennebula-gate.service install -p -D -m 644 share/pkgs/CentOS7/opennebula-econe.service %{buildroot}/lib/systemd/system/opennebula-econe.service install -p -D -m 644 share/pkgs/CentOS7/opennebula-flow.service %{buildroot}/lib/systemd/system/opennebula-flow.service install -p -D -m 644 share/pkgs/CentOS7/opennebula-novnc.service %{buildroot}/lib/systemd/system/opennebula-novnc.service install -p -D -m 644 share/pkgs/CentOS7/opennebula.conf %{buildroot}/lib/tmpfiles.d/opennebula.conf install -p -D -m 644 share/pkgs/CentOS7/opennebula.conf %{buildroot}/lib/tmpfiles.d/opennebula-sunstone.conf install -p -D -m 644 share/pkgs/CentOS7/opennebula.conf %{buildroot}/lib/tmpfiles.d/opennebula-gate.conf install -p -D -m 644 share/pkgs/CentOS7/opennebula.conf %{buildroot}/lib/tmpfiles.d/opennebula-flow.conf install -p -D -m 644 share/pkgs/CentOS7/opennebula-node.conf %{buildroot}/lib/tmpfiles.d/opennebula-node.conf install -p -D -m 644 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla # sudoers %{__mkdir} -p %{buildroot}%{_sysconfdir}/sudoers.d install -p -D -m 440 share/pkgs/CentOS/opennebula.sudoers %{buildroot}%{_sysconfdir}/sudoers.d/opennebula # logrotate %{__mkdir} -p %{buildroot}%{_sysconfdir}/logrotate.d install -p -D -m 644 share/pkgs/logrotate/opennebula %{buildroot}%{_sysconfdir}/logrotate.d/opennebula install -p -D -m 644 share/pkgs/logrotate/opennebula-econe %{buildroot}%{_sysconfdir}/logrotate.d/opennebula-econe install -p -D -m 644 share/pkgs/logrotate/opennebula-flow %{buildroot}%{_sysconfdir}/logrotate.d/opennebula-flow install -p -D -m 644 share/pkgs/logrotate/opennebula-gate %{buildroot}%{_sysconfdir}/logrotate.d/opennebula-gate install -p -D -m 644 share/pkgs/logrotate/opennebula-novnc %{buildroot}%{_sysconfdir}/logrotate.d/opennebula-novnc install -p -D -m 644 share/pkgs/logrotate/opennebula-scheduler %{buildroot}%{_sysconfdir}/logrotate.d/opennebula-scheduler install -p -D -m 644 share/pkgs/logrotate/opennebula-sunstone %{buildroot}%{_sysconfdir}/logrotate.d/opennebula-sunstone # Java install -p -D -m 644 src/oca/java/jar/org.opennebula.client.jar %{buildroot}%{_javadir}/org.opennebula.client.jar # sysctl install -p -D -m 644 share/etc/sysctl.d/bridge-nf-call.conf %{buildroot}%{_sysconfdir}/sysctl.d/bridge-nf-call.conf # cron install -p -D -m 644 share/etc/cron.d/opennebula-node %{buildroot}%{_sysconfdir}/cron.d/opennebula-node # Gemfile install -p -D -m 644 share/install_gems/CentOS7/Gemfile.lock %{buildroot}/usr/share/one/Gemfile.lock %clean %{__rm} -rf %{buildroot} ################################################################################ # common - scripts ################################################################################ %pre common getent group oneadmin >/dev/null || groupadd -r -g %{oneadmin_gid} oneadmin if getent passwd oneadmin >/dev/null; then /usr/sbin/usermod -a -G oneadmin oneadmin > /dev/null else mkdir %{oneadmin_home} cp /etc/skel/.bash* %{oneadmin_home} chown -R %{oneadmin_uid}:%{oneadmin_gid} %{oneadmin_home} chcon -t user_home_dir_t %{oneadmin_home} /usr/sbin/useradd -r -m -d %{oneadmin_home} \ -u %{oneadmin_uid} -g %{oneadmin_gid} \ -s /bin/bash oneadmin 2> /dev/null fi if ! getent group disk | grep '\boneadmin\b' &>/dev/null; then usermod -a -G disk oneadmin fi ################################################################################ # server - scripts ################################################################################ %pre server # Upgrade - Stop the service if [ $1 = 2 ]; then /sbin/service opennebula stop >/dev/null || : fi if [ -d /var/lib/one/remotes/ ]; then cp -a /var/lib/one/remotes/ /var/lib/one/remotes.$(date +'%Y-%m-%d_%H:%M:%%S') fi %post server if [ $1 = 1 ]; then /sbin/chkconfig --add opennebula >/dev/null if [ ! -e %{oneadmin_home}/.one/one_auth ]; then PASSWORD=$(echo $RANDOM$(date '+%s')|md5sum|cut -d' ' -f1) mkdir -p %{oneadmin_home}/.one echo oneadmin:$PASSWORD > %{oneadmin_home}/.one/one_auth /bin/chown -R oneadmin:oneadmin %{oneadmin_home}/.one fi if [ ! -d "%{oneadmin_home}/.ssh" ]; then su oneadmin -c "ssh-keygen -N '' -t rsa -f %{oneadmin_home}/.ssh/id_rsa" cp -p %{oneadmin_home}/.ssh/id_rsa.pub %{oneadmin_home}/.ssh/authorized_keys /bin/chmod 600 %{oneadmin_home}/.ssh/authorized_keys fi fi %preun server if [ $1 = 0 ]; then /sbin/service opennebula stop >/dev/null || : /sbin/chkconfig --del opennebula >/dev/null || : fi ################################################################################ # node-kvm - scripts ################################################################################ %post node-kvm # Install if [ -e /etc/libvirt/qemu.conf ]; then cp -f /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.$(date +'%Y-%m-%d') fi if [ -e /etc/libvirt/libvirtd.conf ]; then cp -f /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.$(date +'%Y-%m-%d') fi AUGTOOL=$(augtool -A 2>/dev/null < /dev/null) [ -n "$PID" ] && kill $PID 2> /dev/null || : fi ################################################################################ # provision - scripts ################################################################################ %if %{with_provision} %post provision if [ $1 = 1 ]; then if [ ! -d "%{oneadmin_home}/.ssh/ddc/" ]; then su oneadmin -c "mkdir %{oneadmin_home}/.ssh/ddc/" su oneadmin -c "ssh-keygen -N '' -t rsa -f %{oneadmin_home}/.ssh/ddc/id_rsa" fi fi %endif ################################################################################ # node-xen - scripts ################################################################################ # %post node-xen # if [ $1 = 1 ]; then # /usr/bin/grub-bootxen.sh # fi ################################################################################ # sunstone - scripts ################################################################################ %pre sunstone if [ $1 = 2 ]; then /sbin/service opennebula-sunstone stop >/dev/null || : /sbin/service opennebula-novnc stop >/dev/null || : fi %post sunstone if [ $1 = 1 ]; then /sbin/chkconfig --add opennebula-sunstone >/dev/null || : fi %preun sunstone if [ $1 = 0 ]; then /sbin/service opennebula-sunstone stop >/dev/null || : /sbin/chkconfig --del opennebula-sunstone >/dev/null || : /sbin/service opennebula-novnc stop >/dev/null || : /sbin/chkconfig --del opennebula-novnc >/dev/null || : fi ################################################################################ # ruby - scripts ################################################################################ %post ruby cat < - 5.6.2-1 - Upgrade to 5.6.2 * Sat Jul 14 2018 Edouard Bourguignon - 5.6.0-0.1.20180714git7cf10a6 - Upgrade to git master * Sun Jul 08 2018 Edouard Bourguignon - 5.6.0-0.1 - Upgrade to 5.6-beta1 * Sat Jul 07 2018 Edouard Bourguignon - 5.5.90-1 - Upgrade to 5.5.90 * Sat Jul 07 2018 Edouard Bourguignon - 5.5.80-1 - Upgrade to 5.5.80 * Mon May 05 2014 Jaime Melis - 4.6.0-0.1 - New upstream release - Apply a few fixes to the package scripts, so they don't fail on upgrade. * Mon Feb 24 2014 Jaime Melis - 4.4.1-0.1 - New upstream release - Disable the node-xen package - Remove ozones package * Fri Jan 31 2014 Jaime Melis - 4.4.0-0.3 - Enable the node-xen package * Wed Dec 04 2013 Jaime Melis - 4.4.0-0.2 - Refres patches - Add init scripts * Wed Oct 09 2013 Jaime Melis - 4.4.0-0.1 - New upstream release - Remove Ganglia * Thu Sep 12 2013 Jaime Melis - 4.2.0-0.6 - Add opennebula.sudoers file - Refresh enable_xen patch again - Disable xen for the time being * Wed Sep 11 2013 Jaime Melis - 4.2.0-0.4 - Fix xen dependencies - Refresh enable_xen patch * Tue Sep 10 2013 Jaime Melis - 4.2.0-0.3 - Add 99-execute-scripts to the context package * Mon Sep 09 2013 Jaime Melis - 4.2.0-0.2 - scons uses the old_xmlrpc dynamically linked libs * Fri Jul 26 2013 Jaime Melis - 4.2.0-0.1 - New upstream version 4.2.0 - New packages: opennebula-gate and opennebula-flow - Fix dependencies * Fri Jul 12 2013 Jaime Melis - 4.1.0-0.2 - Add oneflow - Fix deps * Mon Jul 08 2013 Jaime Melis - 4.1.0-0.1 - New package for onegate - Include rbvmomi * Fri May 17 2013 Jaime Melis - 4.0.1-0.1 - new upstream release OpenNebula 4.0.1 - context files are available in the source tree - novnc is included in the distribution * Wed Apr 24 2013 Jaime Melis - 3.9.90-0.2 - new upstream release OpenNebula 4.0 RC2 - fix oZones permission issues - new Sunstone conf files - new context files * Sat Apr 06 2013 Jaime Melis - 3.9.80-0.4 - Update upstream tarball - fix novnc patch * Fri Apr 05 2013 Jaime Melis - 3.9.80-0.3 - remove install_novnc.sh from the packages * Wed Apr 03 2013 Jaime Melis - 3.9.80-0.2 - package novnc - enable xen4 by default - add node-xen package * Wed Mar 13 2013 Jaime Melis - 3.9.80-0.1 - Prepare file schema for a new upstream release - Create a new oZones package - Move OCCI and econe to the sunstone package * Mon Dec 03 2012 Jaime Melis - 3.8.1-2.6 - Fix bug in the polkit installation - Fix another bug in the polkit installation - Usermod expects the groupname for the -G parameter * Mon Nov 19 2012 Jaime Melis - 3.8.1-2.3 - Fix some node-kvm issues * Wed Oct 31 2012 Jaime Melis - 3.8.1-2.2 - Improve context scripts for DNS and SSH keys * Fri Oct 26 2012 Jaime Melis - 3.8.1-2.1 - The Sunstone package doesn't have all the required files - Fix all the init.d files (upstream #1289) - Additional required files by Sunstone - New upstream release: 3.8.1 - Properly remove the fix-inits patch - Add a DNS and SSH_PUBLIC_KEY scripts for the context package - Fix bug where the 00-network was being overwritten * Thu Oct 25 2012 Jaime Melis - 3.8.0-3.2 - Proper permissions for the 00-network script in the context package - Create the /var/{run,lock,log}/one for the sunstone package - Fix the sunstone-server script - Proper permissions for /etc/one in all the packages * Wed Oct 24 2012 Jaime Melis - 3.8.0-3 - Update copyright - Add section comments - New package layout - Add the context package * Tue Oct 23 2012 Karanbir Singh - 3.8.0-1 - Rebase to 3.8.0 now that its released * Mon Oct 22 2012 Karanbir Singh - 3.7.85-1.0.1 - Bump Release - Rebuild cleanly * Tue Oct 16 2012 Jaime Melis - 3.7.85-1.0 - Prepare the package for the next upstream tar that already provides sunstone and occi daemons. * Fri Oct 5 2012 Jaime Melis - 3.7.80-1.8 - New package: opennebula-node-kvm - Update missing requirements (ssh, nfs) - Update README with new shared storage workflow - Fix uid/gid for oneadmin - Rename init.d scripts to: opennebula and opennebula-sunstone - New patch for faster monitorization time - New patch for proper qemu-kvm path in nodes - Add %preun and %post actions for the sunstone package * Thu Oct 4 2012 Karanbir Singh - 3.7.80-1.7 - Roll back to beta build ID * Wed Oct 3 2012 Karanbir Singh - 3.8.0-1.3 - Import from upstream - Move spec name to match package - Move the oneadmin password gen to %post so everyone gets a unique value - Add some more macros into placeholders - trim down the pre script and move to %files - ensure we have the same path everywhere - add wget as a dependency - make permissions more secure