%global pypi_name asn1 %global src_name python-asn1 %global debug_package %{nil} Name: python-%{pypi_name} Version: 2.6.0 Release: 1%{dist} Summary: Simple ASN.1 encoder and decoder for Python License: MIT URL: https://github.com/andrivet/python-asn1 Source: https://github.com/andrivet/python-asn1/releases/%{src_name}-%{version}.tar.gz ExclusiveArch: noarch i586 x86_64 aarch64 BuildRequires: python3-devel BuildRequires: sed BuildRequires: python3-pytest BuildRequires: python3-sphinx BuildRequires: python3-sphinx-rtd-theme %global _description %{expand: Python-ASN1 is a simple ASN.1 encoder and decoder for Python with support for BER (parser) and DER (parser and generator) encoding (except indefinite lengths).} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %package doc Summary: Documentation for %{name} %description doc This package contains additional documentation and examples for %{name}. %prep %autosetup -p1 -n %{src_name}-%{version} # Drop unnecessary dependency sed -i '/enum-compat/d' requirements.txt sed -i 's/install_requires = .*/install_requires = []/' setup.py # Fix permissions chmod -x examples/dump.py %build %py3_build # generate html docs PYTHONPATH="${PWD}" sphinx-build-3 docs html rm -r html/.{doctrees,buildinfo} %install %py3_install %check %pytest tests %files -n python3-%{pypi_name} %license LICENSE %doc AUTHORS.rst CHANGELOG.rst README.rst %{python_sitelib}/ %files doc %license LICENSE %doc examples html