Blame aeolus-audrey-agent.spec

Joe VLcek aa1f014
Joe VLcek 288ab11
#   Copyright [2011] [Red Hat, Inc.]
Joe VLcek 288ab11
#
Joe VLcek 288ab11
#   Licensed under the Apache License, Version 2.0 (the "License");
Joe VLcek 288ab11
#   you may not use this file except in compliance with the License.
Joe VLcek 288ab11
#   You may obtain a copy of the License at
Joe VLcek 288ab11
#
Joe VLcek 288ab11
#   http://www.apache.org/licenses/LICENSE-2.0
Joe VLcek 288ab11
#
Joe VLcek 288ab11
#   Unless required by applicable law or agreed to in writing, software
Joe VLcek 288ab11
#   distributed under the License is distributed on an "AS IS" BASIS,
Joe VLcek 288ab11
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Joe VLcek 288ab11
#   See the License for the specific language governing permissions and
Joe VLcek 288ab11
#  limitations under the License.
Joe VLcek 288ab11
#
85afbde
85afbde
%if 0%{?rhel} == 5
85afbde
# sitelib for noarch packages
85afbde
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
85afbde
%endif
85afbde
Joe VLcek 288ab11
Name:       aeolus-audrey-agent
85afbde
Version:    0.5.0
Joe VLcek aa1f014
Release:    0%{?dist}.20120725144606gitc8375fa
Joe VLcek 288ab11
Summary:    The Aeolus Audrey Startup Agent
Joe VLcek 288ab11
Joe VLcek 288ab11
Group:      Applications/System
Joe VLcek 288ab11
License:    ASL 2.0
Joe VLcek 288ab11
URL:        http://aeolusproject.org
85afbde
Source0:    https://github.com/aeolusproject/audrey/tarball/master/aeolus-audrey-agent-%{version}.tar.gz
Joe VLcek 288ab11
Joe VLcek 0a9e4ad
# All of these are required for building since during the build
Joe VLcek 0a9e4ad
# process "audrey --help" is executed to generate the man page.
Joe VLcek 288ab11
BuildRequires: help2man
Joe VLcek 0a9e4ad
BuildRequires: facter python-httplib2 python-oauth2
Joe VLcek 288ab11
Requires:   facter python-httplib2 python-oauth2
Joe VLcek 0a9e4ad
Requires:   python-argparse
85afbde
85afbde
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
Joe VLcek 0a9e4ad
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
85afbde
BuildRequires: python-argparse
85afbde
BuildRequires: python-setuptools
Joe VLcek 0a9e4ad
Requires:   python-argparse
Joe VLcek 0a9e4ad
Requires:   python-setuptools
85afbde
%else
85afbde
BuildRequires: systemd-units
Joe VLcek 288ab11
%endif
Joe VLcek 288ab11
Joe VLcek 288ab11
BuildArch:  noarch
Joe VLcek 288ab11
Joe VLcek 288ab11
%description
Joe VLcek 288ab11
The Aeolus Audrey Startup Agent, a script which runs on a booting
Joe VLcek 288ab11
cloud instance to retrieve configuration data from the Aeolus
Joe VLcek 288ab11
Config Server.
Joe VLcek 288ab11
Joe VLcek 288ab11
%prep
Joe VLcek 288ab11
%setup -q
Joe VLcek 288ab11
Joe VLcek 288ab11
%build
Joe VLcek 288ab11
make %{?_smp_mflags}
Joe VLcek 288ab11
Joe VLcek 288ab11
%install
Joe VLcek 288ab11
rm -rf %{buildroot}
85afbde
85afbde
# copy over the audrey agent bits
85afbde
mkdir -p %{buildroot}%{python_sitelib}/audrey
Joe VLcek 288ab11
mkdir -p %{buildroot}%{_bindir}
85afbde
install -m644 src/audrey/*py* %{buildroot}%{python_sitelib}/audrey
85afbde
install -m755 scripts/audrey %{buildroot}%{_bindir}/audrey
85afbde
85afbde
#install man files
Joe VLcek 288ab11
mkdir -p %{buildroot}%{_mandir}/man8
85afbde
install -m644 audrey.8 %{buildroot}%{_mandir}/man8
Joe VLcek 288ab11
85afbde
if [ 0%{?rhel} == 05 ] || [ 0%{?rhel} == 06 ]; then
85afbde
  # install the sysv service script
85afbde
  mkdir -p %{buildroot}/%{_initrddir}
Joe VLcek aa1f014
  install -Dp -m755 scripts/audrey.sysv %{buildroot}%{_initrddir}/ZZaudrey
85afbde
else
85afbde
  # install the systemd unit file
85afbde
  mkdir -p %{buildroot}/%{_unitdir}/
85afbde
  install -m644 scripts/audrey.service %{buildroot}/%{_unitdir}/
85afbde
fi
85afbde
Joe VLcek aa1f014
%pre
Joe VLcek aa1f014
# this removes the audrey service
Joe VLcek aa1f014
# in prep for the ZZaudrey service
Joe VLcek aa1f014
# part of fix for BZ816104
Joe VLcek aa1f014
if [ -e %{_initrddir}/audrey ]; then
Joe VLcek aa1f014
/sbin/chkconfig --del audrey
Joe VLcek aa1f014
fi
Joe VLcek aa1f014
85afbde
%post
85afbde
if [ 0%{?rhel} == 05 ] || [ 0%{?rhel} == 06 ]; then
Joe VLcek aa1f014
/sbin/chkconfig --add ZZaudrey
Joe VLcek aa1f014
/sbin/chkconfig ZZaudrey on
85afbde
else
85afbde
/bin/systemctl enable audrey.service > /dev/null
85afbde
fi
85afbde
85afbde
85afbde
%preun
85afbde
if [ "$1" = 0 ] ; then
85afbde
if [ 0%{?rhel} == 05 ] || [ 0%{?rhel} == 06 ]; then
Joe VLcek aa1f014
/sbin/chkconfig --del ZZaudrey
85afbde
else
85afbde
/bin/systemctl disable audrey.service > /dev/null
85afbde
fi
85afbde
fi
Joe VLcek 288ab11
Joe VLcek 288ab11
%files
85afbde
%defattr(-,root,root,-)
Joe VLcek 288ab11
%{_bindir}/audrey
85afbde
%{python_sitelib}/audrey/*
Joe VLcek 288ab11
%{_mandir}/man8/audrey.8*
85afbde
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
Joe VLcek aa1f014
%{_initrddir}/ZZaudrey
85afbde
%else
85afbde
%{_unitdir}/audrey.service
85afbde
%endif
Joe VLcek 288ab11
%doc COPYING
Joe VLcek 288ab11
Joe VLcek 288ab11
%changelog
Joe VLcek aa1f014
* Tue May 08 2012 Dan Radez <dradez@redhat.com> 0.4.6-1
Joe VLcek aa1f014
- fix for BZ816104
85afbde
* Fri Mar 16 2012 Joe VLcek <jvlcek@redhat.com> 0.4.4-4
85afbde
- Added auto cloud-info identification
85afbde
* Mon Mar 05 2012 Dan Radez <dradez@redhat.com> 0.4.4-3
85afbde
- https://bugzilla.redhat.com/show_bug.cgi?id=798787
85afbde
- chkconfig on for http and configserver
85afbde
* Wed Jan 25 2012 Dan Radez <dradez@redhat.com> 0.4.4-2
85afbde
- adding rc.local modifications
85afbde
- putting the agent files in site-packages now that it's split up
85afbde
- adding cloud-info file support for each provider
Joe VLcek 0a9e4ad
* Wed Dec 07 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-14
Joe VLcek 0a9e4ad
- Define BuildRoot to address RHEL5 rpmbuild incompatibility
Joe VLcek 0a9e4ad
* Tue Dec 06 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-13
Joe VLcek 0a9e4ad
- Made run with Python2.4 for RHEL5 compatibility
Joe VLcek 0a9e4ad
* Thu Nov 18 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-12
Joe VLcek 0a9e4ad
- Fixed Auto help file generation induced build failure
Joe VLcek 0a9e4ad
* Thu Nov 17 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-11
Joe VLcek 0a9e4ad
- Remove Auto help file generation as it is currently breakin the build
Joe VLcek 0a9e4ad
* Thu Nov 17 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-10
Joe VLcek 0a9e4ad
- Fix bz754769 fix user data parsing and log level
Joe VLcek 288ab11
* Tue Nov 09 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-9
Joe VLcek 288ab11
- Update the licensing information
Joe VLcek 288ab11
* Tue Nov 08 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-8
Joe VLcek 288ab11
- Add man page generation and address some packaging review feedback
Joe VLcek 288ab11
* Tue Nov 08 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-7
Joe VLcek 288ab11
- Fixing changelog history
Joe VLcek 288ab11
* Mon Nov 07 2011 Joe VLcek <jvlcek@redhat.com> 0.3.1-7
Joe VLcek 288ab11
- Address Packaging for Fedora review feedback
Joe VLcek 288ab11
* Fri Nov 05 2011 Joe VLcek <jvlcek@redhat.com> 0.3.1-6
Joe VLcek 288ab11
- Packaging for Fedora
Joe VLcek 288ab11
* Wed Nov 02 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-6
Joe VLcek 288ab11
- Handles base64 encoded and decoded data in user data
Joe VLcek 288ab11
* Wed Nov 02 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-3
Joe VLcek 288ab11
- Fix for audrey.log location
Joe VLcek 288ab11
* Thu Oct 27 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-2
Joe VLcek 288ab11
- Radez doubled unit test coverage
Joe VLcek 288ab11
* Wed Oct 26 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-1
Joe VLcek 288ab11
- Now using oauth to authenticate with Config Server
Joe VLcek 288ab11
- Parsing a new user data format that is versioned
Joe VLcek 288ab11
* Thu Oct 20 2011 Dan Radez <dradez@redhat.com> 0.3.1-3
Joe VLcek 288ab11
- adding requires for rpm installations
Joe VLcek 288ab11
* Tue Oct 11 2011 Joe VLcek <joev@redhat.com> 0.3.1-2
Joe VLcek 288ab11
- RHEVm user data injection base64 encoded.
Joe VLcek 288ab11
* Fri Sep 30 2011 Joe VLcek <joev@redhat.com> 0.3.1-1
Joe VLcek 288ab11
- RHEVm user data injection.
Joe VLcek 288ab11
* Wed May 18 2011 Joe VLcek <joev@redhat.com> 0.0.1-1
Joe VLcek 288ab11
- Initial build.