Added barbican-api rpm packaging.

Change-Id: I758880bc71648c1179c2249aa49e5772ae34702b
This commit is contained in:
Douglas Mendizabal 2013-07-07 22:50:10 -05:00
parent 2424670f2b
commit 0517c90a68
6 changed files with 104 additions and 3 deletions

View File

@ -7,5 +7,10 @@ include LICENSE
include setup.cfg include setup.cfg
include babel.cfg tox.ini include babel.cfg tox.ini
include barbican/tests/api/resources_test.py include barbican/tests/api/resources_test.py
include barbican/model/migration/README
include barbican/model/migration/alembic.ini
include barbican/model/migration/alembic_migrations/script.py.mako
include barbican/model/migration/alembic_migrations/versions/*.py
include barbican/model/migration/alembic_migrations/versions/README
graft tools graft tools
graft etc graft etc

View File

@ -1,3 +1,6 @@
# logrotate.d configuration
# Used in deb build. Keep in sync with etc/logrotate.d/barbican-api
/var/log/barbican/barbican-api.log { /var/log/barbican/barbican-api.log {
daily daily
missingok missingok

View File

@ -1,10 +1,10 @@
# Barbican script # Barbican upstart script
# Used in deb build. Keep in sync with etc/init/barbican-api.conf
description "Barbican Key Management APIs" description "Barbican Key Management APIs"
start on runlevel [2345] start on runlevel [2345]
stop on runlevel [06] stop on runlevel [06]
script script
uwsgi --master --die-on-term --emperor /etc/barbican/vassals --logto /var/log/barbican/uwsgi.log uwsgi --master --die-on-term --emperor /etc/barbican/vassals --logto /var/log/barbican/barbican-api.log
end script end script

View File

@ -0,0 +1,10 @@
# Barbican upstart script
# Used in rpm build. Keep in sync with debian/barbican-api.upstart
description "Barbican Key Management APIs"
start on runlevel [2345]
stop on runlevel [06]
script
uwsgi --master --die-on-term --emperor /etc/barbican/vassals --logto /var/log/barbican/barbican-api.log
end script

View File

@ -0,0 +1,10 @@
# logrotate.d configuration
# Used in rpm build. Keep in sync with debian/barbican-api.logrotate
/var/log/barbican/barbican-api.log {
daily
missingok
compress
delaycompress
notifempty
}

View File

@ -0,0 +1,73 @@
%define version 0.1.66dev
%define release 1
Summary: Common files for Barbican Key Manager
Name: barbican-common
Version: %{version}
Release: %{release}
Source0: barbican-%{version}.tar.gz
Vendor: Rackspace, Inc.
Packager: Douglas Mendizabal <douglas.mendizabal@rackspace.com>
Url: http://github.com/cloudkeep/barbican
License: Apache License (2.0)
Group: Python WSGI Application
BuildRoot: %{_tmppath}/barbican-%{version}-%{release}-buildroot
BuildArch: noarch
Requires(pre): shadow-utils
%description
Common files for Barbican Key Management API (barbican-api) and
Barbican Worker (barbican-worker)
%prep
%setup -n barbican-%{version} -q
%build
python setup.py build
%install
python setup.py install -O1 --root $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/barbican/vassals
mkdir -p $RPM_BUILD_ROOT/etc/init
mkdir -p $RPM_BUILD_ROOT/var/l{ib,og}/barbican
install etc/barbican/policy.json $RPM_BUILD_ROOT/etc/barbican
install etc/init/barbican-api.conf $RPM_BUILD_ROOT/etc/init
install -D etc/barbican/barbican* $RPM_BUILD_ROOT/etc/barbican
install -D etc/barbican/vassals/*.ini $RPM_BUILD_ROOT/etc/barbican/vassals
touch $RPM_BUILD_ROOT/var/log/barbican/barbican-api.log
# install log rotation
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m644 etc/logrotate.d/barbican-api $RPM_BUILD_ROOT/etc/logrotate.d/barbican-api
%pre
# Add the 'barbican' user
getent group barbican >/dev/null || groupadd -r barbican
getent passwd barbican >/dev/null || \
useradd -r -g barbican -d /var/lib/barbican -s /sbin/nologin \
-c "Barbican Key Manager user account." barbican
exit 0
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,barbican,barbican)
%{python_sitelib}/*
%dir /var/lib/barbican
# API package
%package -n barbican-api
Summary: Barbican Key Manager API daemon
Requires: barbican-common
%description -n barbican-api
Barbican Key Manager API daemon
%files -n barbican-api
%defattr(-,root,root)
%verify(not md5 size mtime) %attr(0750, barbican,root) /var/log/barbican/barbican-api.log
/etc/logrotate.d/barbican-api
%attr(0755,root,root) /usr/bin/barbican-all
%config(noreplace) /etc/init/barbican-api.conf
%config(noreplace) /etc/barbican/*