4aeecc3
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7
aa3f12a
%global use_systemd 1
aa3f12a
%else
aa3f12a
%global use_systemd 0
aa3f12a
# This is, of course, not set in older RPMs and is needed below
aa3f12a
%global _unitdir /usr/lib/systemd/system
aa3f12a
%endif
aa3f12a
ed18ac1
Summary: System image generation tool
Chris Lalancette 6eeed10
Name: imagefactory
4aeecc3
Version: 1.1.9
aa3f12a
Release: 1%{?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
4aeecc3
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
Chris Lalancette 6eeed10
Requires: python-libguestfs
Chris Lalancette 6eeed10
Requires: python-zope-interface
Chris Lalancette 6eeed10
Requires: libxml2-python
Chris Lalancette 6eeed10
Requires: python-httplib2
Chris Lalancette 6eeed10
Requires: python-argparse
352ac4a
Requires: python-paste-deploy
352ac4a
Requires: python-oauth2
aa3f12a
Requires: python-urlgrabber
aa3f12a
Requires: oz
aa3f12a
aa3f12a
%if %{use_systemd}
aa3f12a
Requires(post): systemd
aa3f12a
Requires(preun): systemd
aa3f12a
Requires(postun): systemd
aa3f12a
BuildRequires: systemd-units
aa3f12a
%else
ed18ac1
Requires(post): chkconfig
ed18ac1
Requires(preun): chkconfig
ed18ac1
# This is for /sbin/service
ed18ac1
Requires(preun): initscripts
aa3f12a
%endif
aa3f12a
aa3f12a
b16bdd3
BuildRequires: python2
Chris Lalancette 6eeed10
BuildRequires: python-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 
4aeecc3
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
aa3f12a
# setup.py installs both of these which I suppose is OK
aa3f12a
# delete the one we don't want here
aa3f12a
%if %{use_systemd}
aa3f12a
rm -f %{buildroot}/%{_initddir}/imagefactoryd
aa3f12a
%else
aa3f12a
rm -f %{buildroot}/%{_unitdir}/imagefactoryd.service
aa3f12a
%endif
aa3f12a
aa3f12a
%if %{use_systemd}
aa3f12a
aa3f12a
%post
aa3f12a
%systemd_post imagefactoryd.service
aa3f12a
aa3f12a
%preun
aa3f12a
%systemd_preun imagefactoryd.service
aa3f12a
aa3f12a
%postun
aa3f12a
%systemd_postun imagefactoryd.service
aa3f12a
aa3f12a
%else
aa3f12a
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
aa3f12a
%endif
aa3f12a
Chris Lalancette 6eeed10
%files
ed18ac1
%doc COPYING
aa3f12a
%if %{use_systemd}
aa3f12a
%{_unitdir}/imagefactoryd.service
aa3f12a
%else
b16bdd3
%{_initddir}/imagefactoryd
aa3f12a
%endif
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
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
4aeecc3
* Tue May 31 2016 Ian McLeod <imcleod@redhat.com> - 1.1.9-1
4aeecc3
- Upstream release 1.1.9
4aeecc3
  - Add HyperV Vagrant support
4aeecc3
  - enhance vSphere and VMWare Fusion support
4aeecc3
4aeecc3
* Thu Mar 17 2016 Ian McLeod <imcleod@redhat.com> - 1.1.8-2
4aeecc3
- fix RHEL7 conditional for systemd unit file content
4aeecc3
aa3f12a
* Wed Mar 16 2016 Ian McLeod <imcleod@redhat.com> - 1.1.8-1
aa3f12a
- Upstream release 1.1.8
aa3f12a
- systemd support
aa3f12a
- docker base image updates
aa3f12a
- significant EC2 updates for regions and instance types
aa3f12a
- VMWare fusion vagrant box support
f727106
4aeecc3
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.7-3
4aeecc3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
4aeecc3
4aeecc3
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-2
4aeecc3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
4aeecc3
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.