Blob Blame History Raw
#
#   Copyright [2011] [Red Hat, Inc.]
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#  limitations under the License.
#

%if 0%{?rhel} == 5
# sitelib for noarch packages
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif

Name:       aeolus-audrey-agent
Version:    0.5.0
Release:    1%{?dist}.20120504194102git64749bf
Summary:    The Aeolus Audrey Startup Agent

Group:      Applications/System
License:    ASL 2.0
URL:        http://aeolusproject.org
Source0:    https://github.com/aeolusproject/audrey/tarball/master/aeolus-audrey-agent-%{version}.tar.gz

# All of these are required for building since during the build
# process "audrey --help" is executed to generate the man page.
BuildRequires: help2man
BuildRequires: facter python-httplib2 python-oauth2
Requires:   facter python-httplib2 python-oauth2
Requires:   python-argparse

%if 0%{?rhel} == 5 || 0%{?rhel} == 6
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: python-argparse
BuildRequires: python-setuptools
Requires:   python-argparse
Requires:   python-setuptools
%else
BuildRequires: systemd-units
%endif

BuildArch:  noarch

%description
The Aeolus Audrey Startup Agent, a script which runs on a booting
cloud instance to retrieve configuration data from the Aeolus
Config Server.

%prep
%setup -q

%build
make %{?_smp_mflags}

%install
rm -rf %{buildroot}

# copy over the audrey agent bits
mkdir -p %{buildroot}%{python_sitelib}/audrey
mkdir -p %{buildroot}%{_bindir}
install -m644 src/audrey/*py* %{buildroot}%{python_sitelib}/audrey
install -m755 scripts/audrey %{buildroot}%{_bindir}/audrey

#install man files
mkdir -p %{buildroot}%{_mandir}/man8
install -m644 audrey.8 %{buildroot}%{_mandir}/man8

if [ 0%{?rhel} == 05 ] || [ 0%{?rhel} == 06 ]; then
  # install the sysv service script
  mkdir -p %{buildroot}/%{_initrddir}
  install -Dp -m755 scripts/audrey.sysv %{buildroot}%{_initrddir}/audrey
else
  # install the systemd unit file
  mkdir -p %{buildroot}/%{_unitdir}/
  install -m644 scripts/audrey.service %{buildroot}/%{_unitdir}/
fi

%post
if [ 0%{?rhel} == 05 ] || [ 0%{?rhel} == 06 ]; then
/sbin/chkconfig --add audrey
/sbin/chkconfig audrey on
else
/bin/systemctl enable audrey.service > /dev/null
fi


%preun
if [ "$1" = 0 ] ; then
if [ 0%{?rhel} == 05 ] || [ 0%{?rhel} == 06 ]; then
/sbin/chkconfig --del audrey
else
/bin/systemctl disable audrey.service > /dev/null
fi
fi

%files
%defattr(-,root,root,-)
%{_bindir}/audrey
%{python_sitelib}/audrey/*
%{_mandir}/man8/audrey.8*
%if 0%{?rhel} == 5 || 0%{?rhel} == 6
%{_initrddir}/audrey
%else
%{_unitdir}/audrey.service
%endif
%doc COPYING

%changelog
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-1.20120504194102git64749bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Mar 16 2012 Joe VLcek <jvlcek@redhat.com> 0.4.4-4
- Added auto cloud-info identification
* Mon Mar 05 2012 Dan Radez <dradez@redhat.com> 0.4.4-3
- https://bugzilla.redhat.com/show_bug.cgi?id=798787
- chkconfig on for http and configserver
* Wed Jan 25 2012 Dan Radez <dradez@redhat.com> 0.4.4-2
- adding rc.local modifications
- putting the agent files in site-packages now that it's split up
- adding cloud-info file support for each provider
* Wed Dec 07 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-14
- Define BuildRoot to address RHEL5 rpmbuild incompatibility
* Tue Dec 06 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-13
- Made run with Python2.4 for RHEL5 compatibility
* Thu Nov 18 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-12
- Fixed Auto help file generation induced build failure
* Thu Nov 17 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-11
- Remove Auto help file generation as it is currently breakin the build
* Thu Nov 17 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-10
- Fix bz754769 fix user data parsing and log level
* Tue Nov 09 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-9
- Update the licensing information
* Tue Nov 08 2011 Joe VLcek <jvlcek@redhat.com> 0.4.0-8
- Add man page generation and address some packaging review feedback
* Tue Nov 08 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-7
- Fixing changelog history
* Mon Nov 07 2011 Joe VLcek <jvlcek@redhat.com> 0.3.1-7
- Address Packaging for Fedora review feedback
* Fri Nov 05 2011 Joe VLcek <jvlcek@redhat.com> 0.3.1-6
- Packaging for Fedora
* Wed Nov 02 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-6
- Handles base64 encoded and decoded data in user data
* Wed Nov 02 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-3
- Fix for audrey.log location
* Thu Oct 27 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-2
- Radez doubled unit test coverage
* Wed Oct 26 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-1
- Now using oauth to authenticate with Config Server
- Parsing a new user data format that is versioned
* Thu Oct 20 2011 Dan Radez <dradez@redhat.com> 0.3.1-3
- adding requires for rpm installations
* Tue Oct 11 2011 Joe VLcek <joev@redhat.com> 0.3.1-2
- RHEVm user data injection base64 encoded.
* Fri Sep 30 2011 Joe VLcek <joev@redhat.com> 0.3.1-1
- RHEVm user data injection.
* Wed May 18 2011 Joe VLcek <joev@redhat.com> 0.0.1-1
- Initial build.