33800b8
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
6bbf519
%global use_systemd 1
6bbf519
%else
6bbf519
%global use_systemd 0
6bbf519
# This is, of course, not set in older RPMs and is needed below
6bbf519
%global _unitdir /usr/lib/systemd/system
6bbf519
%endif
6bbf519
ed18ac1
Summary: System image generation tool
Chris Lalancette 6eeed10
Name: imagefactory
33800b8
Version: 1.1.9
7b7c8de
Release: 5%{?dist}
b16bdd3
Source0: http://repos.fedorapeople.org/repos/aeolus/imagefactory/%{version}/tarball/%{name}-%{version}.tar.gz
ed18ac1
License: ASL 2.0
ed18ac1
Group: Applications/System
33800b8
URL: https://github.com/redhat-imaging/imagefactory
Chris Lalancette 6eeed10
BuildArch: noarch
18abde4
%if 0%{?rhel} == 6
18abde4
ExcludeArch: i386 ppc64
18abde4
%endif
Chris Lalancette 6eeed10
Requires: python-pycurl
59afa4e
Requires: python2-libguestfs
59afa4e
Requires: python2-zope-interface
Chris Lalancette 6eeed10
Requires: libxml2-python
Chris Lalancette 6eeed10
Requires: python-httplib2
352ac4a
Requires: python-paste-deploy
59afa4e
Requires: python2-oauth2
59afa4e
Requires: python2-urlgrabber
6bbf519
Requires: oz
6bbf519
6bbf519
%if %{use_systemd}
6bbf519
Requires(post): systemd
6bbf519
Requires(preun): systemd
6bbf519
Requires(postun): systemd
6bbf519
BuildRequires: systemd-units
6bbf519
%else
ed18ac1
Requires(post): chkconfig
ed18ac1
Requires(preun): chkconfig
ed18ac1
# This is for /sbin/service
ed18ac1
Requires(preun): initscripts
6bbf519
%endif
6bbf519
6bbf519
b16bdd3
BuildRequires: python2
59afa4e
BuildRequires: python2-setuptools
b16bdd3
# TODO: Any changes to the _internal_ API must increment this version or, in 
b16bdd3
#       the case of backwards compatible changes, add a new version (RPM 
b16bdd3
#       allows multiple version "=" lines for the same package or 
b16bdd3
#       pseudo-package name)
b16bdd3
Provides: imagefactory-plugin-api = 1.0
Chris Lalancette 6eeed10
Chris Lalancette 6eeed10
%description
d26b748
imagefactory allows the creation of system images for multiple virtualization
d26b748
and cloud providers from a single template definition. See 
33800b8
https://github.com/redhat-imaging/imagefactory for more information.
Chris Lalancette 6eeed10
Chris Lalancette 6eeed10
%prep
ed18ac1
%setup -q
Chris Lalancette 6eeed10
Chris Lalancette 6eeed10
%build
352ac4a
python setup.py build
Chris Lalancette 6eeed10
Chris Lalancette 6eeed10
%install
ed18ac1
python setup.py install -O1 --root=%{buildroot} --skip-build
ed18ac1
b16bdd3
%{__install} -d %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
b16bdd3
%{__install} -d %{buildroot}/%{_localstatedir}/lib/imagefactory/images
b16bdd3
%{__install} -d %{buildroot}/%{_sysconfdir}/imagefactory/plugins.d
b16bdd3
%{__install} -d %{buildroot}/%{_sysconfdir}/logrotate.d
Chris Lalancette 6eeed10
ed18ac1
sed -i '/\/usr\/bin\/env python/d' %{buildroot}/%{python_sitelib}/imgfac/*.py
ed18ac1
b16bdd3
%{__install} -m0600 conf/sysconfig/imagefactoryd %{buildroot}/%{_sysconfdir}/sysconfig/imagefactoryd
b16bdd3
%{__install} -m0600 conf/logrotate.d/imagefactoryd %{buildroot}/%{_sysconfdir}/logrotate.d/imagefactoryd
ed18ac1
6bbf519
# setup.py installs both of these which I suppose is OK
6bbf519
# delete the one we don't want here
6bbf519
%if %{use_systemd}
6bbf519
rm -f %{buildroot}/%{_initddir}/imagefactoryd
6bbf519
%else
6bbf519
rm -f %{buildroot}/%{_unitdir}/imagefactoryd.service
6bbf519
%endif
6bbf519
6bbf519
%if %{use_systemd}
6bbf519
6bbf519
%post
6bbf519
%systemd_post imagefactoryd.service
6bbf519
6bbf519
%preun
6bbf519
%systemd_preun imagefactoryd.service
6bbf519
6bbf519
%postun
6bbf519
%systemd_postun imagefactoryd.service
6bbf519
6bbf519
%else
6bbf519
ed18ac1
%post
b16bdd3
/sbin/chkconfig --add imagefactoryd
ed18ac1
ed18ac1
%preun
ed18ac1
if [ $1 = 0 ] ; then
b16bdd3
    /sbin/service imagefactoryd stop >/dev/null 2>&1
b16bdd3
    /sbin/chkconfig --del imagefactoryd
ed18ac1
fi
Chris Lalancette 6eeed10
6bbf519
%endif
6bbf519
Chris Lalancette 6eeed10
%files
8ebd292
%license COPYING
6bbf519
%if %{use_systemd}
6bbf519
%{_unitdir}/imagefactoryd.service
6bbf519
%else
b16bdd3
%{_initddir}/imagefactoryd
6bbf519
%endif
8ebd292
%dir %{_sysconfdir}/imagefactory
352ac4a
%config(noreplace) %{_sysconfdir}/imagefactory/imagefactory.conf
b16bdd3
%config(noreplace) %{_sysconfdir}/sysconfig/imagefactoryd
b16bdd3
%config(noreplace) %{_sysconfdir}/logrotate.d/imagefactoryd
Chris Lalancette 6eeed10
%dir %attr(0755, root, root) %{_sysconfdir}/pki/imagefactory/
352ac4a
%dir %attr(0755, root, root) %{_sysconfdir}/imagefactory/jeos_images/
b16bdd3
%dir %attr(0755, root, root) %{_sysconfdir}/imagefactory/plugins.d/
352ac4a
%dir %attr(0755, root, root) %{_localstatedir}/lib/imagefactory/images
ed18ac1
%config %{_sysconfdir}/pki/imagefactory/cert-ec2.pem
8ebd292
%dir %{python_sitelib}/imgfac
b16bdd3
%{python_sitelib}/imgfac/*.py*
b16bdd3
%{python_sitelib}/imgfac/rest
b16bdd3
%{python_sitelib}/imgfac/picklingtools
Chris Lalancette 6eeed10
%{python_sitelib}/imagefactory-*.egg-info
352ac4a
%{_bindir}/imagefactory
b16bdd3
%{_bindir}/imagefactoryd
ed18ac1
Chris Lalancette 6eeed10
%changelog
7b7c8de
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.9-5
7b7c8de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7b7c8de
59afa4e
* Tue Nov 29 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.1.9-4
59afa4e
- Remove runtime requirement of python-argparse
59afa4e
59afa4e
* Fri Nov 4 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.9-3
8ebd292
- Resolve ownership of directories
8ebd292
dd1e36b
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.9-2
dd1e36b
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
dd1e36b
33800b8
* Tue May 31 2016 Ian McLeod <imcleod@redhat.com> - 1.1.9-1
33800b8
- Upstream release 1.1.9
33800b8
  - Add HyperV Vagrant support
33800b8
  - enhance vSphere and VMWare Fusion support
33800b8
33800b8
* Thu Mar 17 2016 Ian McLeod <imcleod@redhat.com> - 1.1.8-2
33800b8
- fix RHEL7 conditional for systemd unit file content
33800b8
6bbf519
* Wed Mar 16 2016 Ian McLeod <imcleod@redhat.com> - 1.1.8-1
6bbf519
- Upstream release 1.1.8
6bbf519
- systemd support
6bbf519
- docker base image updates
6bbf519
- significant EC2 updates for regions and instance types
6bbf519
- VMWare fusion vagrant box support
f727106
33800b8
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.7-3
33800b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
33800b8
33800b8
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-2
33800b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
33800b8
c830bca
* Wed Jan 7 2015 Ian McLeod <imcleod@redhat.com> - 1.1.7-1
c830bca
- Upstream release 1.1.7
c830bca
- Vagrant box support added to OVA plugin
c830bca
89b8833
* Mon Nov 24 2014 Ian McLeod <imcleod@redhat.com> - 1.1.6-2
89b8833
- Assorted fixes and features to enable rpm-ostree-toolbox integration
89b8833
18abde4
* Tue Oct 21 2014 Ian McLeod <imcleod@redhat.com> -1.1.6-1
18abde4
- Upstream 1.1.6 release
18abde4
18abde4
* Tue May 6 2014 Ian McLeod <imcleod@redhat.com> - 1.1.5-1
18abde4
- Rebase with upstream
18abde4
- Improved CLI parameter passing support
8e31502
9be453e
* Thu Jan 30 2014 Steve Loranz <sloranz@redhat.com> - 1.1.3-1
9be453e
- Remove references to man directories. Documentation will be hosted @ imgfac.org.
9be453e
b16bdd3
* Thu Aug 15 2013 Ian McLeod <imcleod@redhat.com> - 1.1.3
b16bdd3
- Rebase with upstream
824e23f
352ac4a
* Thu Sep 15 2011 Ian McLeod <imcleod@redhat.com> - 0.6.1
352ac4a
- Update Oz requirement to 0.7.0 or later for new target-specific package config
ed18ac1
- Update SPEC file to restart service after an install
Chris Lalancette 6eeed10
352ac4a
* Mon Apr 04 2011 Chris Lalancette <clalance@redhat.com> - 0.1.6-1
352ac4a
- Initial spec file.