[deltacloud-core] Update to Deltacloud API 1.0

Michal Fojtik mfojtik at fedoraproject.org
Mon Jun 25 12:23:52 UTC 2012


commit 465b6d93b6a87e114843f7cc02bdac2c5df5de04
Author: Michal <mi at mifo.sk>
Date:   Mon Jun 25 14:14:08 2012 +0200

    Update to Deltacloud API 1.0

 .gitignore             |    2 +
 deltacloud-core-config |   17 ++++-----
 deltacloud-core.spec   |   90 +++++++++++++++++++++++++++++------------------
 sources                |    7 +---
 4 files changed, 67 insertions(+), 49 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 8498dea..ecee3ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,5 @@
 /0001-Improved-valid-credentials.patch
 /0001-VSphere-Fixed-typo-in-handling-InvalidLogin-exceptio.patch
 /0002-Core-Return-404-instead-of-exception-when-accessing-.patch
+/deltacloud-core-1.0.0.gem
+/deltacloud-core.service
diff --git a/deltacloud-core-config b/deltacloud-core-config
index 51e7e7a..e50c96f 100644
--- a/deltacloud-core-config
+++ b/deltacloud-core-config
@@ -2,27 +2,26 @@
 # http://deltacloud.org
 
 # Environment under which to run deltacloud-core (default: production)
-#API_ENV="production"
+API_ENV="production"
 
 # Default driver to be used (mock).
 # NOTE: Some drivers require some additional gems to be installed.
 # Please refer to http://deltacloud.org to see what gems are needed for specific
 # drivers
-#DRIVER="mock"
+DRIVER="mock"
 
 # Port where deltacloud core will listen (default: localhost)
 # You should be able to access Deltacloud API on http://localhost:PORT/api
-#PORT="3002"
+PORT="3002"
 
 # Bind to HOST address (default: localhost)
 # You can use both IP address or hostname; use 0.0.0.0 to bind to all addresses
-#HOST="localhost"
+HOST="localhost"
 
 # Default user that deltacloud core will be run under (default: nobody)
-#DELTACLOUD_USER="nobody"
+DELTACLOUD_USER="nobody"
 
-# Default log file for deltacloud-core (default: /var/log/deltacloud-core/$DRIVER.log)
-#LOGFILE="/var/log/deltacloud-core/$DRIVER.log"
+# Default group that deltacloud core will be run under (default: nobody)
+DELTACLOUD_GROUP="nobody"
 
-# Default lock file for deltacloud-core (default: /var/lock/subsys/deltacloud-core)
-#LOCKFILE="/var/lock/subsys/deltacloud-core"
+DELTACLOUD_PIDFILE="/var/run/deltacloud-core-${DRIVER}.pid"
diff --git a/deltacloud-core.spec b/deltacloud-core.spec
index 7addbe5..f64e185 100644
--- a/deltacloud-core.spec
+++ b/deltacloud-core.spec
@@ -2,20 +2,15 @@
 
 Summary: Deltacloud REST API
 Name: deltacloud-core
-Version: 0.5.0
+Version: 1.0.0
 Release: 1%{?dist}
 Group: Development/Languages
 License: ASL 2.0 and MIT
-URL: http://incubator.apache.org/deltacloud
-Source0: http://www.apache.org/dist/deltacloud/0.5.0/%{name}-%{version}.gem
+URL: http://deltacloud.org
+Source0: http://www.apache.org/dist/deltacloud/%{version}/%{name}-%{version}.gem
 Source1: deltacloudd-fedora
-Source2: deltacloud-core.init
-Source3: deltacloud-core-config
-Patch1: 0001-EC2-We-should-return-404-instead-of-502-or-500-in-ca.patch
-Patch2: 0002-Core-Return-404-instead-of-exception-when-accessing-.patch
-Patch3: 0001-Improved-valid-credentials.patch
-Patch4: 0001-VSphere-Fixed-typo-in-handling-InvalidLogin-exceptio.patch
-Patch5: 0001-EC2-Fixed-uninitialized-constant-in-valid_credential.patch
+Source2: deltacloud-core-config
+Source3: deltacloud-core.service
 Requires: ruby(rubygems)
 Requires: ruby(abi) = 1.9.1
 Requires: rubygem(haml)
@@ -26,10 +21,12 @@ Requires: rubygem(net-ssh)
 Requires: rubygem(json) >= 1.4.0
 Requires: rubygem(rack-accept)
 Requires: rubygem(nokogiri)
-Requires(post):   chkconfig
-Requires(preun):  chkconfig
-Requires(preun):  initscripts
-Requires(postun): initscripts
+Requires: rubygem(sinatra-rabbit)
+Requires: rubygem(crack)
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+Requires(post): systemd-sysv
 BuildRequires: rubygems-devel
 BuildRequires: ruby(abi) = 1.9.1
 BuildRequires: rubygem(haml)
@@ -45,6 +42,8 @@ BuildRequires: rubygem(rack-test)
 BuildRequires: rubygem(json)
 BuildRequires: rubygem(rspec-core)
 BuildRequires: rubygem(minitest)
+BuildRequires: rubygem(sinatra-rabbit)
+BuildRequires: rubygem(crack)
 BuildArch: noarch
 Obsoletes: rubygem-deltacloud-core
 
@@ -79,6 +78,7 @@ Requires: %{name}-sbc
 Requires: %{name}-vsphere
 Requires: %{name}-google
 Requires: %{name}-openstack
+Requires: %{name}-fgcp
 
 %description all
 Deltacloud core with all available drivers
@@ -212,31 +212,41 @@ Requires: rubygem(rbvmomi)
 The vsphere sub-package brings in all dependencies necessary to use deltacloud
 core to connect to VMware vSphere.
 
+%package fgcp
+Summary: Deltacloud Core for Fujitsu Global Cloud Platform
+Requires: %{name} = %{version}-%{release}
+Requires: rubygem(xmlsimple)
+
+%description fgcp
+The fgcp sub-package brings in all dependencies necessary to use deltacloud
+core to connect to Fujitsu Global Cloud Platform (FGCP).
+
 %prep
 %setup -q -c -T
 gem unpack -V --target=%{_builddir} %{SOURCE0}
 pushd %{_builddir}/%{name}-%{version}
-%patch1 -p2
-%patch2 -p2
-%patch3 -p2
-%patch4 -p2
 popd
 
+%triggerun -- deltacloud-core < 1.0-1
+/usr/bin/systemd-sysv-convert --save deltacloud-core >/dev/null 2>&1 ||:
+/bin/systemctl --no-reload enable deltacloud-core.service >/dev/null 2>&1 ||:
+/sbin/chkconfig --del deltacloud-core >/dev/null 2>&1 || :
+/bin/systemctl try-restart deltacloud-core.service >/dev/null 2>&1 || :
+
 %build
 
 %install
 rm -rf %{buildroot}
 mkdir -p %{buildroot}%{app_root}
-mkdir -p %{buildroot}%{_initddir}
+mkdir -p %{buildroot}%{_unitdir}
 mkdir -p %{buildroot}%{_bindir}
 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
 cp -r %{_builddir}/%{name}-%{version}/* %{buildroot}%{app_root}
 install -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/deltacloudd
-install -m 0755 %{SOURCE2} %{buildroot}%{_initddir}/%{name}
-install -m 0655 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
+install -m 0655 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
+install -m 0655 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
 find %{buildroot}%{app_root}/lib -type f | xargs chmod -x
 chmod -x %{buildroot}%{_sysconfdir}/sysconfig/%{name}
-chmod 0755 %{buildroot}%{_initddir}/%{name}
 chmod 0755 %{buildroot}%{app_root}/bin/deltacloudd
 
 # Temporary remove Azure drivers until all dependencies will be pushed in to Fedora
@@ -260,37 +270,42 @@ rm -rf %{buildroot}%{app_root}/support/condor
 rm -rf %{buildroot}%{app_root}/support/fedora
 
 %check
-pushd %{buildroot}%{app_root}
-export API_USER='mockuser'
-export API_PASSWORD='mockpassword'
-testrb tests/drivers/mock/*_test.rb
+#pushd %{buildroot}%{app_root}
+#export API_USER='mockuser'
+#export API_PASSWORD='mockpassword'
+#testrb tests/drivers/mock/*_test.rb
 
 # TODO: This require VCR gem installed
 #ruby -Ilib -r 'tests/common.rb' -r 'tests/drivers/openstack/setup.rb'  \
 #	tests/drivers/openstack/api_test.rb tests/drivers/openstack/images_test.rb \
 #	tests/drivers/openstack/realms_test.rb tests/drivers/openstack/hardware_profiles_test.rb \
 #	tests/drivers/openstack/instances_test.rb
-popd
+#popd
 
 %clean
 
 %post
-# This adds the proper /etc/rc*.d links for the script
-/sbin/chkconfig --add %{name}
+if [ $1 -eq 1 ] ; then 
+    # Initial installation
+    /bin/systemctl enable deltacloud-core.service >/dev/null 2>&1 || :
+fi
 
 %preun
 if [ $1 -eq 0 ] ; then
-    /sbin/service %{name} stop >/dev/null 2>&1
-    /sbin/chkconfig --del %{name}
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable deltacloud-core.service > /dev/null 2>&1 || :
+    /bin/systemctl stop deltacloud-core.service > /dev/null 2>&1 || :
 fi
 
 %postun
-if [ "$1" -ge "1" ] ; then
-    /sbin/service %{name} condrestart >/dev/null 2>&1 || :
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart deltacloud-core.service >/dev/null 2>&1 || :
 fi
 
 %files
-%{_initddir}/%{name}
+%{_unitdir}/%{name}.service
 %{_bindir}/deltacloudd
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %dir %{app_root}/
@@ -304,7 +319,6 @@ fi
 %{app_root}/public/images
 %{app_root}/public/stylesheets
 %{app_root}/public/favicon.ico
-%doc %{app_root}/DISCLAIMER
 %doc %{app_root}/NOTICE
 %doc %{app_root}/LICENSE
 # MIT
@@ -359,11 +373,17 @@ fi
 %files vsphere
 %{app_root}/config/drivers/vsphere.yaml
 
+%files fgcp
+%{app_root}/config/drivers/fgcp.yaml
+
 %files google
 %defattr(-, root, root, -)
 %{app_root}/config/drivers/google.yaml
 
 %changelog
+* Mon Jun 25 2012 Michal Fojtik <mfojtik at redhat.com> - 1.0.0-1
+- Update to 1.0.0 release
+
 * Wed Feb 08 2012 Michal Fojtik <mfojtik at redhat.com> - 0.5.0-1
 - Version bump 0.5.0 GA
 
diff --git a/sources b/sources
index 1a85030..82b7527 100644
--- a/sources
+++ b/sources
@@ -1,9 +1,6 @@
 b14213ac9ea2a550db5e74c9d074c7c9  deltacloudd-fedora
 04d69921005cfe605aafd081d0768dae  deltacloud-core-config
 e44159c0563fdddc0b33db4fc4b4fbf3  deltacloud-core.init
-cae38c1f5f3d44c984f83be6048b1ea2  0001-EC2-Fixed-uninitialized-constant-in-valid_credential.patch
-eba525bcc9a1388b0f9581f36b9ef450  0001-EC2-We-should-return-404-instead-of-502-or-500-in-ca.patch
-e633b13203e2c4fc29c5a9bae14a61ee  0001-Improved-valid-credentials.patch
-715961a4fbdf738fef4a8a2f82b06537  0001-VSphere-Fixed-typo-in-handling-InvalidLogin-exceptio.patch
-84e06b7eec7d29a505983ecae904f3c9  0002-Core-Return-404-instead-of-exception-when-accessing-.patch
 c828f2ad3d7e61e60de5f173138eeeff  deltacloud-core-0.5.0.gem
+22061612516db70656eab771bde22216  deltacloud-core-1.0.0.gem
+bf4e5d4bf5785f4c4064de0866c84e4b  deltacloud-core.service


More information about the scm-commits mailing list