File openstack-heat.spec of Package openstack-heat
#
# spec file for package openstack-heat
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define component heat
%define groupname %{component}
%define username %{component}
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
%define version_unconverted 2014.2.4.dev50
Name: openstack-%{component}
Version: 2014.2.4.juno
Release: 0
Summary: Openstack Orchestration (Heat)
License: Apache-2.0
Group: System/Management
Url: https://launchpad.net/heat
Source: http://tarballs.openstack.org/heat/heat-stable-juno.tar.gz
Source1: %{name}.init
Source2: %{name}.logrotate
Patch0: remove-qpid-requirement.patch
Patch2: increase_kombu_greenlet_versions.patch
%if 0%{?suse_version} > 1230
Source10: %name.conf
BuildRequires: systemd
%endif
Source99: rpmlintrc
BuildRequires: crudini
BuildRequires: fdupes
BuildRequires: openstack-suse-macros
BuildRequires: python-Paste
BuildRequires: python-PasteDeploy >= 1.5.0
BuildRequires: python-Routes >= 1.12.3
BuildRequires: python-WebOb >= 1.2.3
BuildRequires: python-devel
BuildRequires: python-eventlet >= 0.13.0
BuildRequires: python-iso8601 >= 0.1.8
BuildRequires: python-lxml >= 2.3
BuildRequires: python-oslo.config >= 1.2.0
BuildRequires: python-oslo.utils
BuildRequires: python-pbr >= 0.5.21
# Documentation requirements:
BuildRequires: python-Babel >= 1.3
BuildRequires: python-Sphinx >= 1.1.2
BuildRequires: python-oslo.i18n
BuildRequires: python-oslosphinx
Requires: logrotate
Requires: openstack-heat-templates
Requires: python >= 2.6.8
Requires: python-heat = %{version}
Requires(pre): pwdutils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
Heat is a service to orchestrate multiple composite cloud applications using
templates, through both an OpenStack-native ReST API and a
CloudFormation-compatible Query API.
%package -n python-heat
Summary: Openstack Orchestration (Heat) - Python module
Group: Development/Languages/Python
Requires: python >= 2.6.8
Requires: python-Babel >= 1.3
Requires: python-PasteDeploy >= 1.5.0
Requires: python-PyYAML >= 3.1.0
Requires: python-Routes >= 1.12.3
Requires: python-SQLAlchemy >= 0.8.4
Requires: python-WebOb >= 1.2.3
Requires: python-argparse
Requires: python-ceilometerclient >= 1.0.6
Requires: python-cinderclient >= 1.1.0
Requires: python-eventlet >= 0.15.1
Requires: python-greenlet >= 0.3.2
Requires: python-heatclient >= 0.2.9
Requires: python-httplib2 >= 0.7.5
Requires: python-iso8601 >= 0.1.9
Requires: python-keystoneclient >= 0.10.0
Requires: python-keystonemiddleware >= 1.0.0
Requires: python-kombu >= 2.5.0
Requires: python-lockfile >= 0.8
Requires: python-lxml >= 2.3
Requires: python-netaddr >= 0.7.12
Requires: python-neutronclient >= 2.3.6
Requires: python-novaclient >= 2.18.0
Requires: python-oslo.config >= 1.4.0
Requires: python-oslo.db >= 1.0.0
Requires: python-oslo.i18n >= 1.3.0
Requires: python-oslo.messaging >= 1.4.0
Requires: python-oslo.serialization >= 1.0.0
Requires: python-oslo.utils >= 1.4.0
Requires: python-pbr >= 0.6
Requires: python-posix_ipc
Requires: python-psycopg2
Requires: python-pycrypto >= 2.6
Requires: python-requests >= 2.1.0
Requires: python-saharaclient >= 0.7.3
Requires: python-six >= 1.7.0
Requires: python-sqlalchemy-migrate >= 0.9.1
Requires: python-stevedore >= 1.0.0
Requires: python-swiftclient >= 2.2.0
Requires: python-troveclient >= 1.0.4
%description -n python-heat
This package contains the core Python module of OpenStack Heat.
%package api
Summary: OpenStack Orchestration (Heat) - API
Group: System/Management
Requires: %{name} = %{version}
%description api
This package contains the OpenStack Heat API.
%package api-cfn
Summary: OpenStack Orchestration (Heat) - CloudFormation API
Group: System/Management
Requires: %{name} = %{version}
%description api-cfn
This package contains the OpenStack Heat CloudFormation API.
%package api-cloudwatch
Summary: OpenStack Orchestration (Heat) - CloudWatch API
Group: System/Management
Requires: %{name} = %{version}
%description api-cloudwatch
This package contains the OpenStack Heat CloudWatch API.
%package engine
Summary: OpenStack Orchestration (Heat) - Engine
Group: System/Management
Requires: %{name} = %{version}
%description engine
This package contains the OpenStack Heat Engine.
%package plugin-heat_docker
Summary: OpenStack Orchestration (Heat) - Support for Docker
Group: System/Management
Requires: %{name} = %{version}
Requires: %{name}-engine
Requires: python-docker-py >= 0.2.2
%description plugin-heat_docker
This plugin enables using Docker containers as resources in a Heat template.
%package test
Summary: Openstack Orchestration (Heat) - Testsuite
Group: Development/Languages/Python
Requires: %{name} = %{version}
Requires: openstack-%{component}-api-cloudwatch
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
Requires: python-discover
%endif
Requires: python-glanceclient >= 0.14.0
Requires: python-mock >= 1.0
Requires: python-mox >= 0.5.3
Requires: python-oslotest >= 1.1.0
Requires: python-testrepository >= 0.0.18
Requires: python-testscenarios >= 0.4
Requires: python-testtools >= 0.9.34
%description test
This package contains testsuite files for %{name}.
%prep
%setup -q -n %{component}-%{version_unconverted}
%patch0
%patch2
%openstack_cleanup_prep
#NOTE(saschpe): Kill heat Sphinx extension, we're only building manpages:
sed -i -e "s|'heat.doc.resources'||" -e "s|'ext.resources'||" doc/source/conf.py
fgrep -q '#!/usr/bin' heat/cloudinit/loguserdata.py || {
echo "Somebody removes shebangs again :-( Fix the stupid script!"
exit 1
}
%build
python setup.py build
python setup.py build_sphinx -b man
pushd contrib/heat_docker
OSLO_PACKAGE_VERSION=%{version} python setup.py build
popd
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
pushd contrib/heat_docker
OSLO_PACKAGE_VERSION=%{version} python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# no need for the egg-info file
rm -r %{buildroot}%{python_sitelib}/heat_contrib_docker-*.egg-info
popd
### directories
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{component}
install -d -m 750 %{buildroot}%{_localstatedir}/{cache,log}/%{component}
install -d -m 700 %{buildroot}%{_rundir}/%{component}
%if 0%{?suse_version} > 1230
install -D -m 644 %{SOURCE10} %{buildroot}/%_tmpfilesdir/%name.conf
%endif
### configuration files
install -d -m 755 %{buildroot}%{_sysconfdir}/%{component}/
mv etc/heat/heat.conf{.sample,}
install -p -m 644 etc/heat/*.{conf,json,ini} %{buildroot}%{_sysconfdir}/%{component}/
install -d -m 755 %{buildroot}%{_sysconfdir}/%{component}/{environment.d,templates}
install -p -m 644 etc/heat/environment.d/*.yaml %{buildroot}%{_sysconfdir}/%{component}/environment.d
install -p -m 644 etc/heat/templates/*.yaml %{buildroot}%{_sysconfdir}/%{component}/templates
crudini --set %{buildroot}/etc/%{component}/heat.conf DEFAULT verbose True
crudini --set %{buildroot}/etc/%{component}/heat.conf DEFAULT log_dir /var/log/heat
crudini --set %{buildroot}/etc/%{component}/heat.conf database connection 'sqlite:///var/lib/heat/heat.db'
crudini --set %{buildroot}/etc/%{component}/heat.conf DEFAULT lock_path %{_rundir}/%{component}
crudini --set %{buildroot}/etc/%{component}/heat.conf keystone_authtoken signing_dir /var/cache/%component/keystone-signing
crudini --set %{buildroot}/etc/%{component}/heat.conf keystone_authtoken admin_tenant_name '%%SERVICE_TENANT_NAME%%'
crudini --set %{buildroot}/etc/%{component}/heat.conf keystone_authtoken admin_user heat
crudini --set %{buildroot}/etc/%{component}/heat.conf keystone_authtoken admin_password '%%SERVICE_PASSWORD%%'
### bash-completion/logrotate/etc.
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
### init scripts
mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_initddir}
for i in api api-cfn api-cloudwatch engine ; do
install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/%{name}-$i
sed -i -e "s/__NAME__/$i/g" %{buildroot}%{_initddir}/%{name}-$i
ln -s ../..%{_initddir}/%{name}-$i %{buildroot}%{_sbindir}/rc%{name}-$i
done
### documentation
install -d %{buildroot}%{_mandir}/man1
install -m 644 doc/build/man/*.1 %{buildroot}%{_mandir}/man1
### test subpackage
%openstack_test_package_install
%fdupes %{buildroot}%{_localstatedir}/lib/%{name}-test
### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%pre
%openstack_pre_user_group_create %{username} %{groupname}
%post api
%{fillup_and_insserv -f %{name}-api}
%preun api
%stop_on_removal %{name}-api
%postun api
%restart_on_update %{name}-api
%insserv_cleanup
%post api-cfn
%{fillup_and_insserv -f %{name}-api-cfn}
%preun api-cfn
%stop_on_removal %{name}-api-cfn
%postun api-cfn
%restart_on_update %{name}-api-cfn
%insserv_cleanup
%post api-cloudwatch
%{fillup_and_insserv -f %{name}-api-cloudwatch}
%preun api-cloudwatch
%stop_on_removal %{name}-api-cloudwatch
%postun api-cloudwatch
%restart_on_update %{name}-api-cloudwatch
%insserv_cleanup
%post engine
%{fillup_and_insserv -f %{name}-engine}
%preun engine
%stop_on_removal %{name}-engine
%postun engine
%restart_on_update %{name}-engine
%insserv_cleanup
%files
%defattr(-,root,root)
%doc LICENSE README.rst
%dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/lib/%{component}
%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/cache/%{component}
%dir %attr(0750, %{username}, %{groupname}) %{_localstatedir}/log/%{component}
%if 0%{?suse_version} > 1230
%_tmpfilesdir/%name.conf
%else
%dir %attr(0700, %{username}, %{groupname}) %{_rundir}/%{component}
%endif
%dir %{_sysconfdir}/%{component}
%config %{_sysconfdir}/%{component}/policy.json
%config %{_sysconfdir}/%{component}/environment.d
%config %{_sysconfdir}/%{component}/templates
%config(noreplace) %attr(0640, root, %{groupname}) %{_sysconfdir}/%{component}/heat.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config %attr(0640, root, %{groupname}) %{_sysconfdir}/%{component}/api-paste.ini
%{_bindir}/heat-db-setup
%{_bindir}/heat-manage
%{_bindir}/heat-keystone-setup
%{_bindir}/heat-keystone-setup-domain
%{_bindir}/cinder-keystone-setup
%{_mandir}/man1/%{component}-manage.1%{?ext_man}
%{_mandir}/man1/%{component}-db-setup.1%{?ext_man}
%{_mandir}/man1/%{component}-keystone-setup.1%{?ext_man}
%{_mandir}/man1/%{component}-keystone-setup-domain.1%{?ext_man}
%files -n python-%{component}
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/%{component}-*.egg-info
%files api
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-api
%{_sbindir}/rc%{name}-api
%{_bindir}/heat-api
%{_mandir}/man1/%{component}-api.1%{?ext_man}
%files api-cfn
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-api-cfn
%{_sbindir}/rc%{name}-api-cfn
%{_bindir}/heat-api-cfn
%{_mandir}/man1/%{component}-api-cfn.1%{?ext_man}
%files api-cloudwatch
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-api-cloudwatch
%{_sbindir}/rc%{name}-api-cloudwatch
%{_bindir}/heat-api-cloudwatch
%{_mandir}/man1/%{component}-api-cloudwatch.1%{?ext_man}
%files engine
%defattr(-,root,root,-)
%doc LICENSE
%{_initddir}/%{name}-engine
%{_sbindir}/rc%{name}-engine
%{_bindir}/heat-engine
%dir %{_prefix}/lib/heat/
%{_mandir}/man1/%{component}-engine.1%{?ext_man}
%files plugin-heat_docker
%defattr(-,root,root,-)
%{_prefix}/lib/heat/docker/
%files test
%defattr(-,root,root)
%{_localstatedir}/lib/%{name}-test/
%changelog