From cefd52311e358bff58929d9e49afff79698b84bd Mon Sep 17 00:00:00 2001 From: Mohamed El Morabity Date: Wed, 21 Nov 2018 21:10:27 +0100 Subject: [PATCH 1/2] First import --- .gitignore | 1 + python-azure-devtools.spec | 120 +++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 122 insertions(+) create mode 100644 .gitignore create mode 100644 python-azure-devtools.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1341cf4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/azure-devtools-1.0.0.tar.gz diff --git a/python-azure-devtools.spec b/python-azure-devtools.spec new file mode 100644 index 0000000..b7854ba --- /dev/null +++ b/python-azure-devtools.spec @@ -0,0 +1,120 @@ +%global srcname azure-devtools +%global common_description This package contains tools to aid in developing Python-based Azure code. + +%global _with_python2 0%{?rhel} || 0%{?fedora} <= 29 +%global py2_prefix %{?rhel:python}%{?fedora:python2} +# Some Python 3 libraries required by azure-devtools are not available in EL +%global _with_python3 0%{?fedora} + +Name: python-%{srcname} +Version: 1.0.0 +Release: 2%{?dist} +Summary: Devtools for Azure SDK and CLI for Python + +License: MIT +URL: https://github.com/Azure/azure-python-devtools +Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz + +%if 0%{?_with_python2} +BuildRequires: %{py2_prefix}-devel +BuildRequires: %{py2_prefix}-setuptools +# Needed for tests +BuildRequires: %{py2_prefix}-configargparse +BuildRequires: %{py2_prefix}-six +BuildRequires: %{py2_prefix}-vcrpy +%endif +%if 0%{?_with_python3} +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +# Needed for tests +BuildRequires: python%{python3_pkgversion}-configargparse +BuildRequires: python%{python3_pkgversion}-six +BuildRequires: python%{python3_pkgversion}-vcrpy +%endif +BuildArch: noarch + +%description +%{common_description} + + +%if 0%{?_with_python2} +%package -n python2-%{srcname} +Summary: %{summary} +Requires: %{py2_prefix}-configargparse +Requires: %{py2_prefix}-six +Requires: %{py2_prefix}-vcrpy +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +%{common_description} +%endif + + +%if 0%{?_with_python3} +%package -n python%{python3_pkgversion}-%{srcname} +Summary: %{summary} +Requires: python%{python3_pkgversion}-configargparse +Requires: python%{python3_pkgversion}-six +Requires: python%{python3_pkgversion}-vcrpy +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} + +%description -n python%{python3_pkgversion}-%{srcname} +%{common_description} +%endif + + +%prep +%autosetup -n azure-python-devtools-%{version} + + +%build +%if 0%{?_with_python2} +%py2_build +%endif +%if 0%{?_with_python3} +%py3_build +%endif + + +%install +%if 0%{?_with_python2} +%py2_install +%endif +%if 0%{?_with_python3} +%py3_install +%endif + + +%check +%if 0%{?_with_python2} +%{__python2} -m unittest discover -s src/ +%endif +%if 0%{?_with_python3} +%{__python3} -m unittest discover -s src/ +%endif + + +%if 0%{?_with_python2} +%files -n python2-%{srcname} +%doc README.rst doc/ +%license LICENSE +%{python2_sitelib}/azure_devtools/ +%{python2_sitelib}/azure_devtools-*.egg-info/ +%endif + + +%if 0%{?_with_python3} +%files -n python%{python3_pkgversion}-%{srcname} +%doc README.rst doc/ +%license LICENSE +%{python3_sitelib}/azure_devtools/ +%{python3_sitelib}/azure_devtools-*.egg-info/ +%endif + + +%changelog +* Tue Nov 20 2018 Mohamed El Morabity - 1.0.0-2 +- Don't glob everything under the Python sitelib directory + +* Sat Nov 03 2018 Mohamed El Morabity - 1.0.0-1 +- Initial RPM release diff --git a/sources b/sources new file mode 100644 index 0000000..0625b2b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (azure-devtools-1.0.0.tar.gz) = aed2687f439d76faf88312b65ad8d8ba8c9c248267102dafff3052e97ff4bf9c0d2cfb9f96ce63885aac54f03ec1aa17c856f1f71d4d14e85a7d8302931e9baf From 23a368025419db241e46e66b77a9c05b9f1a11a0 Mon Sep 17 00:00:00 2001 From: Mohamed El Morabity Date: Wed, 21 Nov 2018 21:32:30 +0100 Subject: [PATCH 2/2] Fix dependency on python-vcrpy for Fedora <= 27 --- python-azure-devtools.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python-azure-devtools.spec b/python-azure-devtools.spec index b7854ba..ebcb5cd 100644 --- a/python-azure-devtools.spec +++ b/python-azure-devtools.spec @@ -8,7 +8,7 @@ Name: python-%{srcname} Version: 1.0.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Devtools for Azure SDK and CLI for Python License: MIT @@ -21,8 +21,12 @@ BuildRequires: %{py2_prefix}-setuptools # Needed for tests BuildRequires: %{py2_prefix}-configargparse BuildRequires: %{py2_prefix}-six +%if 0%{?fedora} <= 27 +BuildRequires: python-vcrpy +%else BuildRequires: %{py2_prefix}-vcrpy %endif +%endif %if 0%{?_with_python3} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -42,7 +46,11 @@ BuildArch: noarch Summary: %{summary} Requires: %{py2_prefix}-configargparse Requires: %{py2_prefix}-six +%if 0%{?fedora} <= 27 +Requires: python-vcrpy +%else Requires: %{py2_prefix}-vcrpy +%endif %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} @@ -113,6 +121,9 @@ Requires: python%{python3_pkgversion}-vcrpy %changelog +* Wed Nov 21 2018 Mohamed El Morabity - 1.0.0-3 +- Fix dependency on python-vcrpy for Fedora <= 27 + * Tue Nov 20 2018 Mohamed El Morabity - 1.0.0-2 - Don't glob everything under the Python sitelib directory