Blob Blame History Raw
# Some Openstack supporting packages from EPEL have been removed due to updated
# deps that override RHEL and, thus, violate EPEL rules.  We would like to 
# eventually support these features as part of an EL6 and EL7 set of factory
# plugin packages in RDO.  Until this is sorted out we must disable things when
# building on RHEL.
# TODO: If we end up building as part of RDO either remove this for RDO
# SPEC builds or find a way to detect an RDO build and automagically negate this
# UPDATE: F24 dropped the supporting modules we currently use
# TODO: Refresh/refactor OpenStack support to use newer module and then update below
%if 0%{?fedora} >= 24 || 0%{?rhel} >= 3
%define include_openstack 0
%define include_openstack 1

# For now, do not build this sub RPM - It has bitrotted and needs to be revisited
%define include_nova_image_builder 0

%global auto_register_macro_post() # create it if it doesn't already exist as a link \
# If it is an existing file other than a link, do nothing \
[ -L %{_sysconfdir}/imagefactory/plugins.d/ ] || \
[ -e %{_sysconfdir}/imagefactory/plugins.d/ ] || \
ln -s %{python3_sitelib}/imagefactory_plugins/%1/ %{_sysconfdir}/imagefactory/plugins.d/ \
exit 0 

%global auto_register_macro_postun() if [ "\$1" = "0" ]; then \
  # clean up the link if it exists - if it doesn't or if this is a regular file, do nothing \
  [ -L %{_sysconfdir}/imagefactory/plugins.d/ ] && rm -f  %{_sysconfdir}/imagefactory/plugins.d/ \
fi \
exit 0

Name: imagefactory-plugins
Version: 1.1.15
Release: 12%{?dist}
Summary: Default plugins for the Image Factory system image generation tool
License: ASL 2.0

Patch0: imagefactory-1.1.14-utf8-config-id.patch
Patch1: container-github-pr434.patch
Patch2: fix-armv7l.patch
Patch3: imagefactory-1.1.15-isalive.patch

BuildArch: noarch
BuildRequires: python3
BuildRequires: python3-setuptools
BuildRequires: python3-devel
Requires: imagefactory

# Obsolete the old EC2 plugins as they need python2 based euca2ools thats not in Fedora anymore.
Obsoletes: imagefactory-plugins-EC2 < 1.1.15-3
Obsoletes: imagefactory-plugins-EC2-jeos-images < 1.1.15-3

This is a placeholder top level package for a collection of plugins for the 
Image Factory cloud system image generation tool.

imagefactory allows the creation of system images for multiple virtualization
and cloud providers from a single template definition. See for more information.

%package ovfcommon
Summary: common utilities to manipulate ovf-related objects
Requires: oz >= 0.7.0
Requires: imagefactory-plugins

%description ovfcommon
This pseudo-plugin is used to provide common OVF functionality to other 

%package OVA
Summary: Cloud plugin for generating OVA archives
Requires: oz >= 0.7.0
Requires: imagefactory-plugins
Requires: imagefactory-plugins-ovfcommon
Requires: imagefactory-plugin-api = 1.0

%description OVA
This Cloud plugin allows users to specify a Base Image to generate an OVA
archive from.

%package IndirectionCloud
Summary: Cloud plugin for allowing images to modify other images
Requires: oz >= 0.12.0
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description IndirectionCloud
This Cloud plugin allows users to specify a Base Image to use to manipulate
another Base Image to generate a Target Image.

It was originally created to produce Live CDs and other live media using an
arbitrary  host OS and package selection for the actual media creation tools.

%package TinMan
Summary: OS plugin for Fedora
Requires: oz >= 0.12.0
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description TinMan
An OS plugin to support Fedora OSes

%if 0%{include_openstack}
%package OpenStack
Summary: Cloud plugin for OpenStack running on KVM
Requires: python3-glanceclient
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description OpenStack
A Cloud plugin to support OpenStack running on top of KVM.

%package Rackspace
Summary: Cloud plugin for Rackspace
Requires: python-novaclient
Requires: python-pyrax
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description Rackspace
A Cloud plugin to support Rackspace

%package Rackspace-JEOS-images
Summary: JEOS images for various OSes to support Rackspace snapshot builds
Requires: imagefactory-plugins-Rackspace

%description Rackspace-JEOS-images
These configuration files point to existing JEOS Image ID's on Rackspace that
can be used to do "snapshot" style builds.

%if 0%{include_nova_image_builder}
%package Nova
Summary: OS plugin that allows imagefactory to use Nova instances to build base images.
Requires: python3-novaclient
Requires: oz >= 0.12.0
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description Nova
An alternative to the TinMan plugin for creating base images using an OpenStack cloud.

%if 0%{?build_mock}
%package MockOS
Summary: Mock OS plugin
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description MockOS
This plugin mimcs some of the behaviour of the RPM based OS plugins without
actually doing a build.

For testing use only.

%package MockCloud
Summary: Mock Cloud plugin
Requires: imagefactory-plugins
Requires: imagefactory-plugin-api = 1.0

%description MockCloud
This plugin mimcs some of the behaviour of a real cloud plugin without needing
any real external infra.

For testing use only.


%package RHEVM
Summary: RHEVM Cloud plugin
Requires: imagefactory-plugins
Requires: imagefactory-plugins-ovfcommon
#Make optional for now to allow core coversion features to work
#Requires: ovirt-engine-sdk >= 3.1.0
Requires: qemu-img
Requires: imagefactory-plugin-api = 1.0

%description RHEVM
A plugin for RHEVM "clouds"

%package vSphere
Summary: vSphere Cloud plugin
Requires: imagefactory-plugins
#This has been made conditional in the plugin - will need to be replaced
#Requires: python-psphere
Requires: imagefactory-plugin-api = 1.0
Requires: qemu-img
Requires: python3-pyyaml

%description vSphere
A plugin for vSphere "clouds"

%package Docker
Summary: Cloud plugin for Docker
Requires: tar

%description Docker
A Cloud plugin to support Docker

%package HyperV
Summary: Cloud plugin for HyperV
Requires: qemu-img

%description HyperV
A Cloud plugin to support HyperV

%package GCE
Summary: Cloud plugin for GCE
Requires: qemu-img
Requires: tar

%description GCE
A Cloud plugin to support the Google Compute Engine

%setup -q -n imagefactory-imagefactory-%{version}-2
mv imagefactory_plugins ../
rm -rf *
mv ../imagefactory_plugins/* .
rmdir ../imagefactory_plugins/
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1



# TODO: Cleaner negative conditional
%if 0%{?build_mock}
rm -rf %{buildroot}%{python3_sitelib}/imagefactory_plugins/MockOS
rm -rf %{buildroot}%{python3_sitelib}/imagefactory_plugins/MockCloud

%if 0%{include_openstack}
rm -rf  %{buildroot}%{python3_sitelib}/imagefactory_plugins/OpenStack
rm -rf  %{buildroot}%{python3_sitelib}/imagefactory_plugins/Rackspace
rm -f  %{buildroot}%{_sysconfdir}/imagefactory/jeos_images/rackspace_fedora_jeos.conf
rm -f  %{buildroot}%{_sysconfdir}/imagefactory/jeos_images/rackspace_rhel_jeos.conf

%if 0%{include_nova_image_builder}
rm -rf  %{buildroot}%{python3_sitelib}/imagefactory_plugins/Nova

# delete old EC2 and EC2-json-images plugins
rm -rf %{buildroot}%{_sysconfdir}/imagefactory/jeos_images
rm -rf %{buildroot}%{_bindir}/create-ec2-factory-credentials
rm -rf %{buildroot}%{python3_sitelib}/imagefactory_plugins/EC2

%post OVA
%auto_register_macro_post OVA
%postun OVA
%auto_register_macro_postun OVA

%post IndirectionCloud
%auto_register_macro_post IndirectionCloud
%postun IndirectionCloud
%auto_register_macro_postun IndirectionCloud

%post TinMan
%auto_register_macro_post TinMan
%postun TinMan
%auto_register_macro_postun TinMan

%if 0%{include_openstack}
%post OpenStack
%auto_register_macro_post OpenStack
%postun OpenStack
%auto_register_macro_postun OpenStack

%post Rackspace
%auto_register_macro_post Rackspace
%postun Rackspace
%auto_register_macro_postun Rackspace

%if 0%{include_nova_image_builder}
%post Nova
%auto_register_macro_post Nova
%postun Nova
%auto_register_macro_postrun Nova

%post RHEVM
%auto_register_macro_post RHEVM
%postun RHEVM
%auto_register_macro_postun RHEVM

%if 0%{?build_mock}
%post MockOS
%auto_register_macro_post MockOS
%postun MockOS
%auto_register_macro_postun MockOS

%post MockCloud
%auto_register_macro_post MockCloud
%postun MockCloud
%auto_register_macro_postun MockCloud

%post vSphere
%auto_register_macro_post vSphere
%postun vSphere
%auto_register_macro_postun vSphere

%post Docker
%auto_register_macro_post Docker
%postun Docker
%auto_register_macro_postun Docker

%post HyperV
%auto_register_macro_post HyperV
%postun HyperV
%auto_register_macro_postun HyperV

%post GCE
%auto_register_macro_post GCE
%postun GCE
%auto_register_macro_postun GCE

%license COPYING
%dir %{python3_sitelib}/imagefactory_plugins

%files ovfcommon
%dir %{python3_sitelib}/imagefactory_plugins/ovfcommon

%files OVA
%dir %{python3_sitelib}/imagefactory_plugins/OVA

%files IndirectionCloud
%dir %{python3_sitelib}/imagefactory_plugins/IndirectionCloud

%files TinMan
%dir %{python3_sitelib}/imagefactory_plugins/TinMan

%if 0%{include_openstack}
%files OpenStack
%dir %{python3_sitelib}/imagefactory_plugins/OpenStack

%files Rackspace
%dir %{python3_sitelib}/imagefactory_plugins/Rackspace

%files Rackspace-JEOS-images

%if 0%{include_nova_image_builder}
%files Nova
%dir %{python3_sitelib}/imagefactory_plugins/Nova

%if 0%{?build_mock}
%files MockOS
%dir %{python3_sitelib}/imagefactory_plugins/MockOS

%files MockCloud
%dir %{python3_sitelib}/imagefactory_plugins/MockCloud

%files RHEVM
%dir %{python3_sitelib}/imagefactory_plugins/RHEVM

%files vSphere
%dir %{python3_sitelib}/imagefactory_plugins/vSphere

%files Docker
%dir %{python3_sitelib}/imagefactory_plugins/Docker

%files HyperV
%dir %{python3_sitelib}/imagefactory_plugins/HyperV

%files GCE
%dir %{python3_sitelib}/imagefactory_plugins/GCE

* Sun Dec 12 2021 Kevin Fenzi <> - 1.1.15-12
- Add patch for stray isAlive call.

* Thu Jul 22 2021 Fedora Release Engineering <> - 1.1.15-11
- Rebuilt for

* Fri Jun 04 2021 Python Maint <> - 1.1.15-10
- Rebuilt for Python 3.10

* Tue Jan 26 2021 Fedora Release Engineering <> - 1.1.15-9
- Rebuilt for

* Tue Oct 06 2020 Peter Robinson <> - 1.1.15-8
- Add armv7l arch mapping

* Sat Oct 03 2020 Peter Robinson <> - 1.1.15-7
- Minor build fixes

* Tue Jul 28 2020 Fedora Release Engineering <> - 1.1.15-6
- Rebuilt for

* Thu Apr 30 2020 Peter Robinson <> - 1.1.15-5
- Update container patch to latest rev

* Wed Mar 04 2020 Peter Robinson <> - 1.1.15-4
- fix for RHBZ#1793927

* Fri Feb 07 2020 Kevin Fenzi <> - 1.1.15-3
- Drop EC2 plugin as it uses euca2ools which is python2 and no longer in Fedora. Fixes bug #1762327

* Wed Jan 29 2020 Fedora Release Engineering <> - 1.1.15-2
- Rebuilt for

* Thu Jan 16 2020 Gwyn Ciesla <> - 1.1.15-1
- 1.1.15

* Sat Nov 02 2019 Kevin Fenzi <> - 1.1.14-2
- Upgrade to 1.1.14.
- Add patch for utf encoding in Docker plugin.

* Thu Jul 25 2019 Fedora Release Engineering <> - 1.1.13-0.20190528024256gita117084
- Rebuilt for

* Thu Aug 02 2018 Brendan Reilly <> 1.1.12-2
- supports OVAs with subdirectories

* Tue May 01 2018 Brendan Reilly <> - 1.1.12-1
- adding reference param section for new build for vsphere

* Tue Jan 16 2018 Brendan Reilly <> - 1.1.11-2
- Add vsphere_os_type for OVF build

* Tue Oct 25 2016 Geert Jansen <> - 1.1.9-3
- Fix packaging for GCE plugin.

* Wed Jun 15 2016 Ian McLeod <> - 1.1.9-2
- remove xattr saving in Docker tar file creation

* Tue May 31 2016 Ian McLeod <> - 1.1.9-1
- Upstream release 1.1.9
  - Add HyperV Vagrant support
  - enhance vSphere and VMWare Fusion support

* Thu Mar 24 2016 Ian McLeod <> - 1.1.8-4
- add new docker base image version options
- fix koji issue when ICICLE generation is disabled

* Thu Mar 17 2016 Ian McLeod <> - 1.1.8-3
- temporarily disable OpenShift and RAX for F24

* Wed Mar 16 2016 Ian McLeod <> - 1.1.8-2
- enable non-x86_64 Docker base image builds

* Wed Mar 16 2016 Ian McLeod <> - 1.1.8-1
- Upstream release 1.1.8
- systemd support
- docker base image updates
- significant EC2 updates for regions and instance types
- VMWare fusion vagrant box support

* Thu Feb 04 2016 Fedora Release Engineering <> - 1.1.7-3
- Rebuilt for

* Wed Jun 17 2015 Fedora Release Engineering <> - 1.1.7-2
- Rebuilt for

* Wed Jan 7 2015 Ian McLeod <> - 1.1.7-1
- Upstream release 1.1.7
- Vagrant box support added to OVA plugin

* Mon Nov 24 2014 Ian McLeod <> - 1.1.6-2
- Assorted fixes and features to enable rpm-ostree-toolbox integration

* Tue Oct 21 2014 Ian McLeod <> - 1.1.6-1
- Upstream 1.1.6 release

* Wed Jul 9 2014 Steve Loranz <> - 1.1.6
- Add Nova plugin

* Tue May 6 2014 Ian McLeod <> - 1.1.5-2
- Rebase with upstream
- Improved parameters parsing that couples with improved parameters CLI support in core imagefactory
- Add support for "offline" ICICLE generation in TinMan
- Rework IndirectionCloud to work with recent Oz releases

* Mon Sep 23 2013 Ian McLeod <> - 1.1.3-2
- Add abort() method to TinMan plugin

* Thu Aug 15 2013 Ian McLeod <> - 1.1.3
- Rebase with upstream