Skip to content

Instantly share code, notes, and snippets.

@sshnaidm
Last active August 6, 2020 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshnaidm/981ddcccfa83c233d591fbe057becd5c to your computer and use it in GitHub Desktop.
Save sshnaidm/981ddcccfa83c233d591fbe057becd5c to your computer and use it in GitHub Desktop.
RPM spec for openstack ansible collection
# Macros for py2/py3 compatibility
%if 0%{?fedora} || 0%{?rhel} > 7
%global pyver %{python3_pkgversion}
%else
%global pyver 2
%endif
%global pyver_install %{expand:%{py%{pyver}_install}}
%global pyver_build %{expand:%{py%{pyver}_build}}
%global pyver_sitelib %{expand:%{python%{pyver}_sitelib}}
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Name: ansible-collections-openstack
Version: XXX
Release: XXX
Summary: Openstack Ansible collections
License: GPL-3.0-or-later
URL: https://opendev.org/openstack/ansible-collections-openstack
Source0: https://galaxy.ansible.com/download/openstack-cloud-%{version}.tar.gz
BuildArch: noarch
BuildRequires: git
BuildRequires: python%{pyver}-pbr
Requires: ansible >= 2.8.0
Requires: python%{pyver}-openstacksdk >= 0.12.0
%description
Openstack Ansible collections
%prep
%autosetup -n ansible-collections-openstack.cloud-%{upstream_version}
%build
%{pyver_build}
%install
export PBR_VERSION=%{version}
export SKIP_PIP_INSTALL=1
%{pyver_install}
%files
%doc README.md
%license COPYING
%{pyver_sitelib}/ansible_collections_openstack.cloud-*.egg-info
%{_datadir}/ansible/collections/ansible_collections/openstack/cloud/
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment