Blame aeolus-configserver.spec

Joe VLcek 225df58
#
Joe VLcek 225df58
#   Copyright [2011] [Red Hat, Inc.]
Joe VLcek 225df58
#
Joe VLcek 225df58
#   Licensed under the Apache License, Version 2.0 (the "License");
Joe VLcek 225df58
#   you may not use this file except in compliance with the License.
Joe VLcek 225df58
#   You may obtain a copy of the License at
Joe VLcek 225df58
#
Joe VLcek 225df58
#   http://www.apache.org/licenses/LICENSE-2.0
Joe VLcek 225df58
#
Joe VLcek 225df58
#   Unless required by applicable law or agreed to in writing, software
Joe VLcek 225df58
#   distributed under the License is distributed on an "AS IS" BASIS,
Joe VLcek 225df58
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Joe VLcek 225df58
#   See the License for the specific language governing permissions and
Joe VLcek 225df58
#  limitations under the License.
Joe VLcek 225df58
#
Joe VLcek 225df58
Name:       aeolus-configserver
Joe VLcek 04b3116
Version:    0.5.1
Joe VLcek 04b3116
Release:    1%{?dist}
Joe VLcek 225df58
Summary:    The Aeolus Config Server
Joe VLcek 225df58
Joe VLcek 225df58
Group:      Applications/System
Joe VLcek 225df58
License:    ASL 2.0
Joe VLcek 225df58
URL:        http://aeolusproject.org
Joe VLcek 225df58
Source0:    http://joev.fedorapeople.org/configserver/aeolus-configserver-%{version}.tgz
Joe VLcek 225df58
2d42370
%global app_root %{_datadir}/%{name}
2d42370
%if 0%{?fedora} >= 17
2d42370
  %global ruby_abi 1.9.1
2d42370
%else
2d42370
  %global ruby_abi 1.8
2d42370
%endif
2d42370
2d42370
%{!?_unitdir: %define _unitdir /lib/systemd/system}
2d42370
2d42370
BuildRequires:   rubygems
2d42370
BuildRequires:   ruby(abi) = %{ruby_abi}
2d42370
2d42370
BuildRequires:   ruby-devel
Joe VLcek 225df58
BuildRequires:   ruby-devel
2d42370
BuildRequires:   rubygems
Joe VLcek 225df58
BuildRequires:   help2man
Joe VLcek 225df58
2d42370
2d42370
%if 0%{?fedora} >= 16
2d42370
# test target BuildRequires
2d42370
# Only run the automated test on Fedora 16 or greater because
2d42370
# not all the required packages are available otherwise.
2d42370
BuildRequires:   rubygem-test-spec rubygem-archive-tar-minitar
2d42370
BuildRequires:   rubygem-activesupport rubygem-nokogiri
2d42370
BuildRequires:   rubygem-oauth rubygem-rack
2d42370
BuildRequires:   rubygem-rack-test rubygem-rake
2d42370
BuildRequires:   rubygem-rspec rubygem-rspec-core
2d42370
BuildRequires:   rubygem-sinatra
2d42370
2d42370
%else
2d42370
Requires:        ruby-nokogiri
2d42370
%endif
2d42370
Joe VLcek 225df58
Requires:        httpd
Joe VLcek 225df58
Requires:        mod_ssl
Joe VLcek 225df58
Requires:        puppet
2d42370
2d42370
Requires:        rubygems
2d42370
2d42370
Requires:        ruby(abi) = %{ruby_abi}
2d42370
Requires:        rubygem(nokogiri)
2d42370
Joe VLcek 225df58
Requires:        rubygem(sinatra)
Joe VLcek 225df58
Requires:        rubygem(thin)
Joe VLcek 225df58
Requires:        rubygem(archive-tar-minitar)
Joe VLcek 225df58
Requires:        rubygem(activesupport)
Joe VLcek 225df58
Requires:        rubygem(oauth)
Joe VLcek 225df58
Requires(post):  chkconfig
Joe VLcek 225df58
Requires(preun): chkconfig
Joe VLcek 225df58
Requires(preun): initscripts
Joe VLcek 225df58
Joe VLcek 04b3116
%if 0%{?fedora} >= 17
Joe VLcek 04b3116
Requires(post):  systemd-units
Joe VLcek 04b3116
Requires(preun): systemd-units
Joe VLcek 04b3116
%endif
Joe VLcek 04b3116
Joe VLcek 225df58
BuildArch:      noarch
Joe VLcek 225df58
Joe VLcek 225df58
%description
Joe VLcek 225df58
The Aeolus Config Server, a service for storing and retrieving VM
Joe VLcek 225df58
configurations.
Joe VLcek 225df58
Joe VLcek 225df58
%prep
Joe VLcek 225df58
%setup -q
Joe VLcek 225df58
Joe VLcek 225df58
%build
Joe VLcek 225df58
Joe VLcek 225df58
%install
Joe VLcek 225df58
rm -rf %{buildroot}
Joe VLcek 225df58
Joe VLcek 225df58
##
Joe VLcek 225df58
# aeolus-configserver
Joe VLcek 225df58
##
Joe VLcek 225df58
mkdir -p %{buildroot}%{app_root}/configure
Joe VLcek 225df58
mkdir -p %{buildroot}%{_bindir}
Joe VLcek 225df58
mkdir -p %{buildroot}%{_initrddir}
Joe VLcek 225df58
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
Joe VLcek 225df58
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
Joe VLcek 225df58
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
Joe VLcek 225df58
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}/schema
Joe VLcek 225df58
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
Joe VLcek 225df58
mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
Joe VLcek 225df58
mkdir -p %{buildroot}%{_mandir}/man8
Joe VLcek 225df58
Joe VLcek 225df58
# copy over all of the src directory...
Joe VLcek 225df58
install -d %{buildroot}/%{app_root}/lib/model
Joe VLcek 225df58
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    src/config.ru \
Joe VLcek f673c52
    src/common_config.rb \
Joe VLcek 225df58
    src/configserver.rb %{buildroot}/%{app_root}
Joe VLcek 225df58
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    src/lib/application_helper.rb \
Joe VLcek 225df58
    src/lib/config_handler.rb \
2d42370
    src/lib/report_server.rb \
Joe VLcek 225df58
    src/lib/model.rb %{buildroot}/%{app_root}/lib
Joe VLcek 225df58
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    src/lib/model/base.rb \
Joe VLcek 225df58
    src/lib/model/consumer.rb \
Joe VLcek 225df58
    src/lib/model/deployable.rb \
2d42370
    src/lib/model/service.rb \
Joe VLcek 225df58
    src/lib/model/instance.rb %{buildroot}/%{app_root}/lib/model
Joe VLcek 225df58
Joe VLcek 225df58
# copy over init scripts and configs
2d42370
%if 0%{?rhel}
2d42370
  # install the sysv service script
2d42370
  mkdir -p %{buildroot}/%{_initrddir}
2d42370
  install -Dp -m755 conf/%{name}.sysv %{buildroot}/%{_initrddir}/%{name}
2d42370
%else
2d42370
  # install the systemd unit file
2d42370
  mkdir -p %{buildroot}/%{_unitdir}/
2d42370
  install -m644 conf/%{name}.service %{buildroot}/%{_unitdir}/
2d42370
  echo  %{buildroot}/%{_unitdir}/
2d42370
%endif
2d42370
Joe VLcek 225df58
install -m 0644 conf/%{name}.sysconf \
Joe VLcek 225df58
    %{buildroot}%{_sysconfdir}/sysconfig/%{name}
Joe VLcek 225df58
install -m 0644 conf/%{name}.logrotate \
Joe VLcek 225df58
    %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
Joe VLcek 225df58
Joe VLcek 225df58
# copy relaxNG schema files
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    schema/assembly.rng \
Joe VLcek 225df58
    schema/deployable.rng \
Joe VLcek 225df58
    schema/instance-config.rng \
Joe VLcek 225df58
    schema/template.rng %{buildroot}%{_localstatedir}/lib/%{name}/schema/
Joe VLcek 225df58
Joe VLcek 225df58
# copy over all puppet scripts and bin files
Joe VLcek 225df58
install -d %{buildroot}%{app_root}/configure/puppet/modules/apache/manifests
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    configure/puppet/modules/apache/manifests/init.pp \
Joe VLcek 225df58
    %{buildroot}%{app_root}/configure/puppet/modules/apache/manifests
Joe VLcek 225df58
Joe VLcek 225df58
install -d %{buildroot}%{app_root}/configure/puppet/modules/apache/templates
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    configure/puppet/modules/apache/templates/vhost443.erb \
Joe VLcek 225df58
    configure/puppet/modules/apache/templates/vhost80.erb \
Joe VLcek 225df58
    configure/puppet/modules/apache/templates/vhost.erb \
Joe VLcek 225df58
    %{buildroot}%{app_root}/configure/puppet/modules/apache/templates
Joe VLcek 225df58
Joe VLcek 225df58
install -d \
Joe VLcek 225df58
    %{buildroot}%{app_root}/configure/puppet/modules/configserver/manifests
Joe VLcek 225df58
install -m 0644 \
Joe VLcek 225df58
    configure/puppet/modules/configserver/manifests/init.pp \
Joe VLcek 225df58
    %{buildroot}%{app_root}/configure/puppet/modules/configserver/manifests
Joe VLcek 225df58
Joe VLcek 225df58
install configure/bin/config_httpd.sh \
Joe VLcek 225df58
    %{buildroot}%{_bindir}/aeolus-configserver-setup
Joe VLcek 225df58
Joe VLcek 04b3116
install conf/aeolus-configserver-thinwrapper \
Joe VLcek 04b3116
    %{buildroot}%{_bindir}/aeolus-configserver-thinwrapper
Joe VLcek 04b3116
Joe VLcek 225df58
# copy the generated man page from the buildroot
Joe VLcek 225df58
install -m 0644 aeolus-configserver-setup.8 %{buildroot}%{_mandir}/man8
Joe VLcek 225df58
Joe VLcek 225df58
%clean
Joe VLcek 225df58
rm -rf %{buildroot}
Joe VLcek 225df58
Joe VLcek 225df58
%pre
Joe VLcek 225df58
# Ensure the aeolus user/group is created (same IDs as in aeolus-conductor)
Joe VLcek 225df58
getent group aeolus >/dev/null || \
Joe VLcek 225df58
    groupadd -g 180 -r aeolus 2>/dev/null || :
Joe VLcek 225df58
getent passwd aeolus >/dev/null || \
Joe VLcek 225df58
    useradd -u 180 -g aeolus -c "aeolus" \
Joe VLcek 225df58
    -s /sbin/nologin -r -d /var/aeolus aeolus 2> /dev/null || :
Joe VLcek 225df58
Joe VLcek 225df58
%post
Joe VLcek 225df58
# Register the service
2d42370
%if 0%{?rhel}
2d42370
  chkconfig --add %{name}
2d42370
  chkconfig %{name} on
2d42370
  chkconfig httpd on
2d42370
%else
Joe VLcek 04b3116
  %if 0%{?fedora} <= 17
Joe VLcek 04b3116
      if [ $1 -eq 1]; then
Joe VLcek 04b3116
          systemctl enable %{name}.service > /dev/null 2>&1 || :
Joe VLcek 04b3116
      fi
Joe VLcek 04b3116
  %else
Joe VLcek 04b3116
      %systemd_post %{name}.service
Joe VLcek 04b3116
  %endif
2d42370
%endif
Joe VLcek 225df58
Joe VLcek 225df58
%preun
Joe VLcek 04b3116
# halt and unregister the service before package deletion
Joe VLcek 225df58
if [ $1 = 0 ]; then
2d42370
%if 0%{?rhel}
Joe VLcek 225df58
  service %{name} stop > /dev/null 2>&1
Joe VLcek 225df58
  chkconfig --del %{name}
2d42370
%else
Joe VLcek 04b3116
  %if 0%{?fedora} <= 17
Joe VLcek 04b3116
    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
Joe VLcek 04b3116
    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
Joe VLcek 04b3116
  %else
Joe VLcek 04b3116
    %systemd_preun %{name}.service
Joe VLcek 04b3116
  %endif
2d42370
%endif
Joe VLcek 225df58
fi
Joe VLcek 225df58
Joe VLcek 225df58
%files
Joe VLcek 225df58
%defattr(-,root,root,-)
Joe VLcek 225df58
%{app_root}
2d42370
%{app_root}/config.ru
2d42370
%{app_root}/common_config.rb
2d42370
%{app_root}/configserver.rb
2d42370
%{app_root}/configure
2d42370
%{app_root}/configure/puppet
2d42370
%{app_root}/configure/puppet/modules
2d42370
%{app_root}/configure/puppet/modules/apache
2d42370
%{app_root}/configure/puppet/modules/apache/manifests
2d42370
%{app_root}/configure/puppet/modules/apache/manifests/init.pp
2d42370
%{app_root}/configure/puppet/modules/apache/templates
2d42370
%{app_root}/configure/puppet/modules/apache/templates/vhost443.erb
2d42370
%{app_root}/configure/puppet/modules/apache/templates/vhost80.erb
2d42370
%{app_root}/configure/puppet/modules/apache/templates/vhost.erb
2d42370
%{app_root}/configure/puppet/modules/configserver
2d42370
%{app_root}/configure/puppet/modules/configserver/manifests
2d42370
%{app_root}/configure/puppet/modules/configserver/manifests/init.pp
2d42370
%{app_root}/lib
2d42370
%{app_root}/lib/application_helper.rb
2d42370
%{app_root}/lib/config_handler.rb
2d42370
%{app_root}/lib/model.rb
2d42370
%{app_root}/lib/report_server.rb
2d42370
%{app_root}/lib/model
2d42370
%{app_root}/lib/model/base.rb
2d42370
%{app_root}/lib/model/consumer.rb
2d42370
%{app_root}/lib/model/deployable.rb
2d42370
%{app_root}/lib/model/instance.rb
2d42370
%{app_root}/lib/model/service.rb
2d42370
2d42370
%{_bindir}/aeolus-configserver-setup
Joe VLcek 04b3116
%{_bindir}/aeolus-configserver-thinwrapper
Joe VLcek 225df58
%dir %{_sysconfdir}/%{name}
2d42370
2d42370
%if 0%{?rhel}
2d42370
  %{_initrddir}/%{name}
2d42370
%else
2d42370
  %{_unitdir}/%{name}.service
2d42370
%endif
2d42370
Joe VLcek 225df58
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
Joe VLcek 225df58
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
Joe VLcek 225df58
%attr(-, aeolus, aeolus) %{_localstatedir}/lib/%{name}
Joe VLcek 225df58
%ghost %attr(-, aeolus, aeolus) %{_localstatedir}/run/%{name}
Joe VLcek 225df58
%attr(-, aeolus, aeolus) %{_localstatedir}/log/%{name}
Joe VLcek 225df58
%{_mandir}/man8/aeolus-configserver-setup.8*
Joe VLcek 225df58
%doc COPYING
Joe VLcek 225df58
Joe VLcek 225df58
%changelog
Joe VLcek 04b3116
* Thu Sep 13 2012 Greg Blomquist <gblomqui@redhat.com> 0.5.0-0
Joe VLcek 04b3116
- https://bugzilla.redhat.com/show_bug.cgi?id=856650
Joe VLcek 04b3116
- https://bugzilla.redhat.com/show_bug.cgi?id=851247
Joe VLcek 04b3116
- https://bugzilla.redhat.com/show_bug.cgi?id=833660
2d42370
* Tue Mar 13 2012 Joe VLcek <jvlcek@redhat.com> 0.5.0-0
2d42370
- Convert init scripts to sysV and systemd
Joe VLcek 04b3116
- https://bugzilla.redhat.com/show_bug.cgi?id=833660
2d42370
* Mon Mar 05 2012 Dan Radez <dradez@redhat.com> 0.4.6-1
2d42370
- https://bugzilla.redhat.com/show_bug.cgi?id=798787
2d42370
- chkconfig on for http and configserver
2d42370
* Thu Feb 09 2012 Greg Blomquist <gblomqui@redhat.com> 0.4.6-0
2d42370
- https://bugzilla.redhat.com/show_bug.cgi?id=788996
2d42370
* Mon Jan 16 2012 Greg Blomquist <gblomqui@redhat.com> 0.4.5-2
2d42370
- https://bugzilla.redhat.com/show_bug.cgi?id=781459
2d42370
- https://bugzilla.redhat.com/show_bug.cgi?id=768433
2d42370
- https://bugzilla.redhat.com/show_bug.cgi?id=773036
2d42370
* Tue Jan 03 2012 Dan Radez <dradez@redhat.com> 0.4.5-1
2d42370
- https://bugzilla.redhat.com/show_bug.cgi?id=769656
Joe VLcek f673c52
* Fri Dec 16 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.4-2
Joe VLcek f673c52
- https://bugzilla.redhat.com/show_bug.cgi?id=760377
Joe VLcek f673c52
- https://bugzilla.redhat.com/show_bug.cgi?id=768425
Joe VLcek f673c52
* Mon Dec 12 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.3-2
Joe VLcek f673c52
- Fix 500 on audrey-agent HTTP PUT of partial params
Joe VLcek f673c52
- https://bugzilla.redhat.com/show_bug.cgi?id=766967
Joe VLcek f673c52
* Fri Dec 09 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.3-1
Joe VLcek f673c52
- Fix 500 on HTTP DELETE of deployment data
Joe VLcek f673c52
- (https://bugzilla.redhat.com/show_bug.cgi?id=766012)
Joe VLcek f673c52
* Tue Nov 29 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.2-2
Joe VLcek f673c52
- Allow deletion of deployment configs
Joe VLcek 225df58
* Tue Nov 29 2011 Joe VLcek <jvlcek@redhat.com> 0.4.1-4
Joe VLcek 225df58
- Use install -m in place of cp in spec file
Joe VLcek 225df58
* Mon Nov 28 2011 Joe VLcek <jvlcek@redhat.com> 0.4.1-3
Joe VLcek 225df58
- Removed rake build comment from spec
Joe VLcek 225df58
* Mon Nov 20 2011 Joe VLcek <jvlcek@redhat.com> 0.4.1-2
Joe VLcek 225df58
- Packaging for Fedora
Joe VLcek 225df58
* Mon Nov 14 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.1-1
Joe VLcek 225df58
- Enabling Config Server to process inline configuration files
Joe VLcek 225df58
* Mon Nov 14 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-4
Joe VLcek 225df58
- Allow httpd and config server to run with selinux enabled
Joe VLcek 225df58
- Configure ip tables to open port 443
Joe VLcek 225df58
* Fri Nov 04 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-3
Joe VLcek 225df58
- Adding new "auth" endpoint for testing oauth credentials
Joe VLcek 225df58
- Fixing audrey_data unsigned parameter name for oauth
Joe VLcek 225df58
* Thu Nov 03 2011 Greg Blomquist <gblomqui@redhat.com> 0.4.0-1
Joe VLcek 225df58
- Version bump to start being consistent with Audrey Client
Joe VLcek 225df58
* Tue Nov 01 2011 Greg Blomquist <gblomqui@redhat.com> 0.3.0-3
Joe VLcek 225df58
- Few small fixes for OAuth signature validation
Joe VLcek 225df58
* Wed Oct 26 2011 Greg Blomquist <gblomqui@redhat.com> 0.3.0-2
Joe VLcek 225df58
- Now using oauth for authentication
Joe VLcek 225df58
- Fix logging for production deployment
Joe VLcek 225df58
* Tue Oct 25 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.3-5
Joe VLcek 225df58
- Explicitly require mod_ssl for proxy package
Joe VLcek 225df58
* Wed Oct 05 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.3-4
Joe VLcek 225df58
- Fix rakefile to build on f16, and fixup extrarelease and dist tags in the version
Joe VLcek 225df58
* Wed Sep 07 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.3-3
Joe VLcek 225df58
- Fix service to return 202 when configs are not complete
Joe VLcek 225df58
* Thu Aug 18 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.3-2
Joe VLcek 225df58
- Fix syntax in spec
Joe VLcek 225df58
* Tue Aug 16 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.3-1
Joe VLcek 225df58
- Updated data format for Config Server -> Audrey client API
Joe VLcek 225df58
* Wed Jul 27 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.2-3
Joe VLcek 225df58
- Ability to read tarball from instance-config
Joe VLcek 225df58
- Added minitar dependency
Joe VLcek 225df58
* Tue Jul 12 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.1-5
Joe VLcek 225df58
- Adding ability to upload and download a tarball for instances
Joe VLcek 225df58
* Mon Jun 27 2011 Greg Blomquist <gblomqui@redhat.com> 0.2.0-1
Joe VLcek 225df58
- Add the "proxy" sub-package
Joe VLcek 225df58
* Thu May 26 2011 Greg Blomquist <gblomqui@redhat.com> 0.1.2-2
Joe VLcek 225df58
- Kludge release that allows guests to PUT to invalid UUIDs (RHEV-M)
Joe VLcek 225df58
* Mon May 09 2011 Greg Blomquist <gblomqui@redhat.com> 0.1.2-1
Joe VLcek 225df58
- Fixed POST bug that allowed POSTing no data
Joe VLcek 225df58
* Wed May 04 2011 Greg Blomquist <gblomqui@redhat.com> 0.1.1-3
Joe VLcek 225df58
- Fixed IP storage bugs
Joe VLcek 225df58
* Wed May 04 2011 Greg Blomquist <gblomqui@redhat.com> 0.1.1-2
Joe VLcek 225df58
- Removed arch requirement from rpm spec
Joe VLcek 225df58
* Wed May 04 2011 Greg Blomquist <gblomqui@redhat.com> 0.1.1-1
Joe VLcek 225df58
- Storing IP address of instances that check-in
Joe VLcek 225df58
* Fri Apr 09 2011 Greg Blomquist <gblomqui@redhat.com> 0.1.0-1
Joe VLcek 225df58
- Now supporting multi-instance configuration
Joe VLcek 225df58
* Thu Mar 24 2011 Greg Blomquist <gblmoqui@redhat.com> 0.0.2-2
Joe VLcek 225df58
- Added Nokogiri dependency
Joe VLcek 225df58
* Thu Mar 24 2011 Greg Blomquist <gblmoqui@redhat.com> 0.0.2-1
Joe VLcek 225df58
- Version bump for major functionality implementation
Joe VLcek 225df58
* Wed Mar 16 2011 Greg Blomquist <gblmoqui@redhat.com> 0.0.1-1
Joe VLcek 225df58
- Initial spec