[openstack-savanna/el6] Intermediate version, builds and runs +pbr -pycrypto +sysv
matt
matt at fedoraproject.org
Thu Sep 12 18:58:48 UTC 2013
commit 59f541f7f4c3b0838a3de01f4fc27a73cc4793f0
Author: Matthew Farrellee <matt at redhat.com>
Date: Tue Aug 13 14:28:00 2013 -0400
Intermediate version, builds and runs +pbr -pycrypto +sysv
openstack-savanna-api.init | 102 ++++++++++++++++++++++++++++++++++++++++++++
openstack-savanna.spec | 45 +++++++++++++------
2 files changed, 133 insertions(+), 14 deletions(-)
---
diff --git a/openstack-savanna-api.init b/openstack-savanna-api.init
new file mode 100644
index 0000000..17500ed
--- /dev/null
+++ b/openstack-savanna-api.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-savanna-api OpenStack Savanna API Server
+#
+# chkconfig: - 98 02
+# description: Savanna provides the ability to elastically manage Apache \
+# Hadoop clusters on OpenStack.
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Savanna API Server
+# Description: Savanna provides the ability to elastically manage Apache \
+# Hadoop clusters on OpenStack.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+prog=openstack-savanna-api
+exec="/usr/bin/savanna-api"
+config="/etc/savanna/savanna.conf"
+pidfile="/var/run/savanna/savanna-api.pid"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+ [ -x $exec ] || exit 5
+ [ -f $config ] || exit 6
+ echo -n $"Starting $prog: "
+ daemon --user savanna --pidfile $pidfile "$exec --config-file $config &>/dev/null & echo \$! > $pidfile"
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p $pidfile $prog
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+force_reload() {
+ restart
+}
+
+rh_status() {
+ status -p $pidfile $prog
+}
+
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+ rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ reload)
+ rh_status_q || exit 7
+ $1
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ status)
+ rh_status
+ ;;
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 2
+esac
+exit $?
diff --git a/openstack-savanna.spec b/openstack-savanna.spec
index 72f7d85..70d955a 100644
--- a/openstack-savanna.spec
+++ b/openstack-savanna.spec
@@ -1,16 +1,17 @@
Name: openstack-savanna
-Version: 0.2
-Release: 2%{?dist}
+Version: 0.2.a19.gda41501
+Release: 1%{?dist}
Summary: Apache Hadoop cluster management on OpenStack
License: ASL 2.0
URL: https://launchpad.net/savanna
Source0: http://tarballs.openstack.org/savanna/savanna-%{version}.tar.gz
-Source1: openstack-savanna-api.service
+Source1: openstack-savanna-api.init
BuildArch: noarch
+BuildRequires: python-pbr
BuildRequires: python2-devel
BuildRequires: python-setuptools
-BuildRequires: python-sphinx
+BuildRequires: python-sphinx10
BuildRequires: python-sphinxcontrib-httpdomain
# Needed by check
#BuildRequires: python-unittest2
@@ -26,11 +27,11 @@ Requires: python-eventlet
Requires: python-flask
Requires: python-keystoneclient
Requires: python-cinderclient
-Requires: python-jsonschema
+Requires: python-jsonschema >= 1.3.0
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
+Requires(post): chkconfig
+Requires(preun): initscripts
+Requires(postun): chkconfig
Requires(pre): shadow-utils
@@ -49,14 +50,15 @@ rm -f tools/pip-requires
export PYTHONPATH=$PWD:${PYTHONPATH}
# Note: json warnings likely resolved w/ pygments 1.5 (not yet in Fedora)
-sphinx-build doc/source html
+sphinx-1.0-build doc/source html
rm -rf html/.{doctrees,buildinfo}
%install
%{__python} setup.py install --skip-build --root %{buildroot}
-install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/openstack-savanna-api.service
+install -d -m 755 %{buildroot}%{_localstatedir}/run/savanna
+install -p -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/openstack-savanna-api
HOME=%{_sharedstatedir}/savanna
install -d -m 700 %{buildroot}$HOME
@@ -92,25 +94,32 @@ exit 0
# TODO: if db file then savanna-db-manage update head
# TODO: savanna-db-manage should read /etc/savanna/savanna.conf by default
# https://bugs.launchpad.net/savanna/+bug/1202227
-%systemd_post openstack-savanna-api.service
+/sbin/chkconfig --add openstack-savanna-api
%preun
-%systemd_preun openstack-savanna-api.service
+if [ $1 -eq 0 ] ; then
+ /sbin/service openstack-savanna-api stop >/dev/null 2>&1
+ /sbin/chkconfig --del openstack-savanna-api
+fi
%postun
-%systemd_postun_with_restart openstack-savanna-api.service
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /sbin/service openstack-savanna-api condrestart > /dev/null 2>&1 || :
+fi
%files
%doc html README.rst LICENSE
+%dir %attr(0755, savanna, root) %{_localstatedir}/run/savanna
%dir %{_sysconfdir}/savanna
# Note: this file is not readable because it holds auth credentials
%config(noreplace) %attr(-, root, savanna) %{_sysconfdir}/savanna/savanna.conf
%{_bindir}/savanna-api
%{_bindir}/savanna-db-manage
-%{_unitdir}/openstack-savanna-api.service
+%{_initrddir}/openstack-savanna-api
%dir %attr(-, savanna, savanna) %{_sharedstatedir}/savanna
# Note: permissions on savanna's home are intentially 0700
%dir %{_datadir}/savanna
@@ -121,6 +130,14 @@ exit 0
%changelog
+* Mon Aug 28 2013 Matthew Farrellee <matt at redhat> - 0.2.a19.gda41501-1
+- Update to build and run post pbr addition and pycrypto removal
+
+* Mon Aug 12 2013 Matthew Farrellee <matt at redhat> - 0.2-3
+- Updates to build on EL6,
+- Use SysV init instead of systemd, copied from openstack-nova-api.init
+- Use python-sphinx10, it has sphinx.ext.viewcode
+
* Fri Aug 09 2013 Matthew Farrellee <matt at redhat> - 0.2-2
- Updates from package review BZ986615
More information about the scm-commits
mailing list