Adding rpm packaging for heat packages

This commit is contained in:
Chris Alfonso 2012-03-21 07:44:44 -04:00
parent 68d8778cca
commit 33c4b5f762
6 changed files with 296 additions and 3 deletions

View File

@ -1,8 +1,11 @@
include HACKING.rst
include LICENSE
include README.rst
include MANIFEST.in pylintrc
include openstack-common.conf
include babel.cfg
graft templates
include heat/jeos/F16-x86_64-gold-jeos.tdl
graft etc
graft docs
graft var

84
Makefile Normal file
View File

@ -0,0 +1,84 @@
#!/usr/bin/make
NAME = "heat"
ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
MANPAGES := docs/man/man1/heat.1
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
RPMVERSION := $(shell awk '/Version/{print $$2; exit}' < heat.spec | cut -d "%" -f1)
RPMRELEASE := $(shell awk '/Release/{print $$2; exit}' < heat.spec | cut -d "%" -f1)
RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)"
all: clean python
docs: $(MANPAGES)
%.1: %.1.asciidoc
$(ASCII2MAN)
%.5: %.5.asciidoc
$(ASCII2MAN)
pep8:
@echo "#############################################"
@echo "# Running PEP8 Compliance Tests"
@echo "#############################################"
pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225 lib/ bin/
clean:
@echo "Cleaning up distutils stuff"
-rm -rf build
-rm -rf dist
@echo "Cleaning up byte compiled python stuff"
find . -regex ".*\.py[co]$$" -delete
@echo "Cleaning up editor backup files"
find . -type f \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*.swp" \) -delete
@echo "Cleaning up asciidoc to man transformations and results"
find ./docs/man -type f -name "*.xml" -delete
@echo "Cleaning up output from test runs"
-rm -rf test/test_data
@echo "Cleaning up RPM building stuff"
-rm -rf MANIFEST rpm-build
python:
python setup.py build
install:
python setup.py install
sdist: clean
python ./setup.py sdist
rpmcommon: sdist
@mkdir -p rpm-build
@cp dist/*.gz rpm-build/
srpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir %{_topdir}" \
--define "_sourcedir %{_topdir}" \
-bs heat.spec
@echo "#############################################"
@echo "heat SRPM is built:"
@echo " rpm-build/$(RPMNVR).src.rpm"
@echo "#############################################"
rpm: rpmcommon
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %{_topdir}" \
--define "_srcrpmdir %{_topdir}" \
--define "_specdir %{_topdir}" \
--define "_sourcedir %{_topdir}" \
-ba heat.spec
@echo "#############################################"
@echo "heat RPM is built:"
@echo " rpm-build/noarch/$(RPMNVR).noarch.rpm"
@echo "#############################################"
.PHONEY: docs manual clean pep8
vpath %.asciidoc docs/man/man1

58
docs/man/man1/heat.1 Normal file
View File

@ -0,0 +1,58 @@
'\" t
.\" Title: heat
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 03/31/2012
.\" Manual: System administration commands
.\" Source: Heat 0.0.1
.\" Language: English
.\"
.TH "HEAT" "1" "03/31/2012" "HEAT 0\&.0\&.1" "System administration commands"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
heat \- run a command somewhere else
.SH "SYNOPSIS"
.sp
heat <command>
.SH "DESCRIPTION"
.sp
\fBHeat\fR is a tool to orchestrate the setup of multiple cloud applications\&.
.SH "ARGUMENTS"
.PP
\fBcommand\fR
.RS 4
heat command\&.
.RE
.SH "OPTIONS"
.PP
\fB\-t\fR, \fB\-\-template\fR
.RS 4
The template to use set up a stack\&.
.RE
.PP
\fB\-f\fR, \fB\-\-forks\fR
.RS 4
Level of parallelism\&. Specify as an integer, the default is 5\&.
.RE
.SH "INVENTORY"
.sp
Heat orchestrates the setup of multiple cloud applications\&.
.SH "AUTHOR"
.sp
Heat was originally written by Angus Salkeld\&. See the AUTHORS file for a complete list of contributors\&.
.SH "COPYRIGHT"
.sp
Copyright \(co 2012, Red Hat Inc
.sp
Ansible is released under the terms of the ASL 2 License\&.
.sp
Extensive documentation as well as IRC and mailing list info is available on the heat home page: https://heat\&-project\&.org/

146
heat.spec Normal file
View File

@ -0,0 +1,146 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Name: heat
Summary: The Heat project
Version: 0.0.1
Release: 1
License: ASL 2.0
Prefix: %{_prefix}
Group: System Environment/Base
URL: http://www.heat-project.org
Source0: http://heat-project.org/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz
Requires: pacemaker-cloud
BuildArch: noarch
BuildRequires: python-glance
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%prep
%setup -q -n %{name}-%{version}
%build
python setup.py build
%install
python setup.py install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
mkdir -p $RPM_BUILD_ROOT/var/log/heat/
mkdir -p $RPM_BUILD_ROOT/etc/heat/
cp etc/* $RPM_BUILD_ROOT/etc/heat/
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
cp -v docs/man/man1/heat.1 $RPM_BUILD_ROOT/%{_mandir}/man1/
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/heat/tests
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/heat-0.0.1-py2.7.egg-info
%clean
rm -rf $RPM_BUILD_ROOT
%description
Heat provides a programmable interface to orchestrate the setup of multiple cloud applications
%package api
License: ASL 2.0
Summary: External API for the Heat project
Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
%description api
This package contains the external api for the Heat project
%package common
License: ASL 2.0
Summary: Common utilities for the Heat project
Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
%description common
This package contains the common utilities for the Heat project
%package engine
License: ASL 2.0
Summary: Engine for the Heat project
Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
%description engine
This package contains the engine and internal API for the Heat project
%package jeos
License: ASL 2.0
Summary: JEOS configuration files for the Heat project
Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
%description jeos
This package contains the Just Enough OS configuration files supported by the Heat project
%package openstack
License: ASL 2.0
Summary: OpenStack integration for the Heat project
Group: System Environment/Base
Requires: %{name} = %{version}-%{release}
%description openstack
This package contains the OpenStack integration for the Heat project
%files
%doc README.rst PKG-INFO
%defattr(-,root,root,-)
%{_mandir}/man1/*.gz
%{_bindir}/heat
%{python_sitelib}/heat/__init__.*
%{python_sitelib}/heat/client.*
%{python_sitelib}/heat/cloudformations.*
%{python_sitelib}/heat/vcsversion.*
%{python_sitelib}/heat/version.*
%config(noreplace) /etc/heat
%files api
%defattr(-,root,root,-)
%{_bindir}/heat-api
%{python_sitelib}/heat/api/__init__.*
%{python_sitelib}/heat/api/versions.*
%{python_sitelib}/heat/api/middleware/__init__.*
%{python_sitelib}/heat/api/middleware/version_negotiation.*
%{python_sitelib}/heat/api/middleware/context.*
%{python_sitelib}/heat/api/v1/__init__.*
%{python_sitelib}/heat/api/v1/stacks.*
%{_localstatedir}/log/heat/api.log
%files common
%defattr(-,root,root,-)
%{python_sitelib}/heat/common/auth.*
%{python_sitelib}/heat/common/client.*
%{python_sitelib}/heat/common/config.*
%{python_sitelib}/heat/common/context.*
%{python_sitelib}/heat/common/crypt.*
%{python_sitelib}/heat/common/exception.*
%{python_sitelib}/heat/common/__init__.*
%{python_sitelib}/heat/common/policy.*
%{python_sitelib}/heat/common/utils.*
%{python_sitelib}/heat/common/wsgi.*
%files engine
%defattr(-,root,root,-)
%{_bindir}/heat-engine
%{python_sitelib}/heat/engine/capelistener.*
%{python_sitelib}/heat/engine/client.*
%{python_sitelib}/heat/engine/__init__.*
%{python_sitelib}/heat/engine/json2capexml.*
%{python_sitelib}/heat/engine/systemctl.*
%{python_sitelib}/heat/engine/api/__init__.*
%{python_sitelib}/heat/engine/api/v1/__init__.*
%{python_sitelib}/heat/engine/api/v1/stacks.*
%{_localstatedir}/log/heat/engine.log
%files jeos
%defattr(-,root,root,-)
%{python_sitelib}/heat/jeos/F16-x86_64-gold-jeos.tdl
%files openstack
%defattr(-,root,root,-)
%{python_sitelib}/heat/openstack/__init__.*
%{python_sitelib}/heat/openstack/common/cfg.*
%{python_sitelib}/heat/openstack/common/__init__.*

View File

@ -20,8 +20,8 @@ except ImportError:
'revision_id': 'LOCALREVISION',
'revno': 0}
GLANCE_VERSION = ['2012', '1', None]
YEAR, COUNT, REVSISION = GLANCE_VERSION
GLANCE_VERSION = ['0.0', '1']
COUNT, REVSISION = GLANCE_VERSION
FINAL = False # This becomes true at Release Candidate time

View File

@ -93,5 +93,7 @@ setup(
data_files=[('/etc/heat', ['etc/heat-api.conf',
'etc/heat-api-paste.ini',
'etc/heat-engine.conf',
'etc/heat-engine-paste.ini'])],
'etc/heat-engine-paste.ini']),
('/var/log/heat', ['var/log/heat/api.log',
'var/log/heat/engine.log'])],
py_modules=[])