Modernize spec

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
epel8
Igor Gnatenko 8 years ago
parent 945debdbc7
commit 7a35717911

1
.gitignore vendored

@ -1,2 +1,3 @@
/service_identity-14.0.0.tar.gz /service_identity-14.0.0.tar.gz
/service_identity-16.0.0.tar.gz /service_identity-16.0.0.tar.gz
/service-identity-16.0.0.tar.gz

@ -1,148 +1,128 @@
%if 0%{?fedora} %bcond_without check
%global with_python3 1
%global modname service-identity
%global srcname service_identity
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif %endif
Name: python-service-identity Name: python-%{modname}
Version: 16.0.0 Version: 16.0.0
Release: 4%{?dist} Release: 5%{?dist}
Summary: Service identity verification for pyOpenSSL Summary: Service identity verification for pyOpenSSL
License: MIT License: MIT
URL: https://github.com/pyca/service_identity URL: https://github.com/pyca/service_identity
Source0: https://pypi.io/packages/source/s/service_identity/service_identity-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
%global _description \
Service Identity Verification for pyOpenSSL.\
\
TL;DR: Use this package if you use pyOpenSSL and dont want to be MITMed.\
\
service_identity aspires to give you all the tools you need for verifying\
whether a certificate is valid for the intended purposes.\
\
In the simplest case, this means host name verification. However,\
service_identity implements RFC 6125 fully and plans to add other\
relevant RFCs too.
%description %{_description}
%package -n python2-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python2-setuptools
%if 0%{?fedora} > 20 %if %{with check}
# Fedora 20 doesn't have a new enough version of pytest, BuildRequires: python2-pytest
# so skip running the tests there. BuildRequires: python2-attrs
# For tests BuildRequires: python2-pyasn1
BuildRequires: pytest >= 2.5 BuildRequires: python2-pyasn1-modules
BuildRequires: python-attrs BuildRequires: python2-pyOpenSSL
BuildRequires: python-pyasn1 BuildRequires: python2-idna
BuildRequires: python-pyasn1-modules %endif
BuildRequires: pyOpenSSL >= 0.12 Requires: python2-attrs
BuildRequires: python-idna Requires: python2-pyasn1
%endif # fedora > 20 Requires: python2-pyasn1-modules
Requires: python2-pyOpenSSL
%if 0%{?with_python3} Recommends: python2-idna
%description -n python2-%{modname} %{_description}
Python 2 version.
%if %{with python3}
%package -n python3-%{modname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%if 0%{?fedora} > 20 %if %{with check}
# For tests BuildRequires: python3-pytest
BuildRequires: python3-pytest >= 2.5
BuildRequires: python3-attrs BuildRequires: python3-attrs
BuildRequires: python3-pyasn1 BuildRequires: python3-pyasn1
BuildRequires: python3-pyasn1-modules BuildRequires: python3-pyasn1-modules
BuildRequires: python3-pyOpenSSL >= 0.12 BuildRequires: python3-pyOpenSSL
BuildRequires: python3-idna BuildRequires: python3-idna
%endif # fedora > 20 %endif
%endif # with_python3
Requires: python-attrs
Requires: python-pyasn1
Requires: python-pyasn1-modules
Requires: pyOpenSSL >= 0.12
Requires: python-idna
%if 0%{?with_python3}
%package -n python3-service-identity
Summary: Logging as Storytelling
Requires: python3-six
Requires: python3-attrs Requires: python3-attrs
Requires: python3-pyasn1 Requires: python3-pyasn1
Requires: python3-pyasn1-modules Requires: python3-pyasn1-modules
Requires: python3-pyOpenSSL >= 0.12 Requires: python3-pyOpenSSL
Requires: python3-idna Recommends: python3-idna
%endif # with_python3
%description %description -n python3-%{modname} %{_description}
Service Identity Verification for pyOpenSSL
TL;DR: Use this package if you use pyOpenSSL and dont want to be MITMed. Python 3 version.
%endif
service_identity aspires to give you all the tools you need for verifying
whether a certificate is valid for the intended purposes.
In the simplest case, this means host name verification. However,
service_identity implements RFC 6125 fully and plans to add other relevant RFCs
too.
%if 0%{?with_python3}
%description -n python3-service-identity
Service Identity Verification for pyOpenSSL
TL;DR: Use this package if you use pyOpenSSL and dont want to be MITMed.
service_identity aspires to give you all the tools you need for verifying
whether a certificate is valid for the intended purposes.
In the simplest case, this means host name verification. However,
service_identity implements RFC 6125 fully and plans to add other relevant RFCs
too.
%endif # with_python3
%prep %prep
%setup -q -n service_identity-%{version} %autosetup -n %{srcname}-%{version}
# Remove bundled egg-info
rm -rf service_identity.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build %build
%{__python2} setup.py build %py2_build
%if %{with python3}
%if 0%{?with_python3} %py3_build
pushd %{py3dir} %endif
%{__python3} setup.py build
popd
%endif # with_python3
%if 0%{?fedora} > 20
%check
# https://bitbucket.org/hpk42/pytest/issue/539/pytest-doctest-modules-fails-if-python
echo "collect_ignore = ['build']" >> conftest.py
PYTHONPATH="%{buildroot}/%{python2_sitelib}" py.test --doctest-modules --doctest-glob='*.rst'
%if 0%{?with_python3}
pushd %{py3dir}
# https://bitbucket.org/hpk42/pytest/issue/539/pytest-doctest-modules-fails-if-python
echo "collect_ignore = ['build']" >> conftest.py
PYTHONPATH="%{buildroot}/%{python3_sitelib}" py.test-3 --doctest-modules --doctest-glob='*.rst'
popd
%endif # with_python3
%endif # fedora > 20
%install %install
%if 0%{?with_python3} %py2_install
pushd %{py3dir} %if %{with python3}
%{__python3} setup.py install --skip-build --root %{buildroot} %py3_install
popd %endif
%endif # with_python3
%{__python2} setup.py install --skip-build --root %{buildroot}
%files %if %{with check}
%doc README.rst LICENSE %check
%{python2_sitelib}/service_identity PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} -v
%{python2_sitelib}/service_identity-%{version}-py%{python2_version}.egg-info %if %{with python3}
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v
%endif
%endif
%if 0%{?with_python3} %files -n python2-%{modname}
%files -n python3-service-identity %license LICENSE
%doc README.rst LICENSE %doc README.rst
%{python3_sitelib}/service_identity %{python2_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/service_identity-%{version}-py%{python3_version}.egg-info %{python2_sitelib}/%{srcname}/
%endif # with_python3
%if %{with python3}
%files -n python3-%{modname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/
%endif
%changelog %changelog
* Mon Dec 19 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 16.0.0-5
- Modernize spec
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 16.0.0-4 * Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 16.0.0-4
- Enable tests - Enable tests

@ -1 +1 @@
d52392597b9c44a740abf322bfdb21e6 service_identity-16.0.0.tar.gz SHA512 (service-identity-16.0.0.tar.gz) = d85ae7a699577dc00e32f376768f3089f0cf332ae54d89ea689618aea3a6557b2cb7029380ecac65d49028b895b59bb80b54c2783cef9a95f3d55308e6c5e899

Loading…
Cancel
Save