Blob Blame History Raw
%global srcname pyasn1
%global modules_version 0.2.7
%global sum ASN.1 tools for Python
%global sum_modules Modules for pyasn1
%global pkgdesc \
This is an implementation of ASN.1 types and codecs in the Python \
programming language.
%global pkgdesc_modules \
ASN.1 types modules for python-pyasn1.


Name:           python3-%{srcname}
Version:        0.4.7
Release:        1%{?dist}
Summary:        %{sum}
License:        BSD
Group:          System Environment/Libraries
Source0:        https://github.com/etingof/pyasn1/archive/v%{version}.tar.gz
Source1:        https://github.com/etingof/pyasn1-modules/archive/v%{modules_version}.tar.gz
URL:            https://github.com/etingof/pyasn1
BuildArch:      noarch
BuildRequires:  python-srpm-macros
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
%if 0%{?with_python3_other}
BuildRequires:  python%{python3_other_pkgversion}-devel
BuildRequires:  python%{python3_other_pkgversion}-setuptools
%endif

%description %{pkgdesc}


%if %{python3_pkgversion} != 3
%package -n python%{python3_pkgversion}-%{srcname}
Summary:    %{sum} %{python3_pkgversion}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

%description -n python%{python3_pkgversion}-%{srcname} %{pkgdesc}
%endif

%package -n python%{python3_pkgversion}-%{srcname}-modules
Summary:    %{sum_modules}
Requires:   python%{python3_pkgversion}-%{srcname} >= %{version}-%{release}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}-modules}

%description -n python%{python3_pkgversion}-%{srcname}-modules %{pkgdesc_modules}


%if 0%{?with_python3_other}
%package -n python%{python3_other_pkgversion}-%{srcname}
Summary:    %{sum} %{python3_other_pkgversion}
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}

%description -n python%{python3_other_pkgversion}-%{srcname} %{pkgdesc}

%package -n python%{python3_other_pkgversion}-%{srcname}-modules
Summary:    %{sum_modules}
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}-modules}

%description -n python%{python3_other_pkgversion}-%{srcname}-modules %{pkgdesc_modules}
%endif


%prep
%setup -n %{srcname}-%{version} -q -b1

%build
%py3_build
pushd ../pyasn1-modules-%{modules_version}
%py3_build
popd

%if 0%{?with_python3_other}
%py3_other_build
pushd ../pyasn1-modules-%{modules_version}
%py3_other_build
popd
%endif


%install
%py3_install
pushd ../pyasn1-modules-%{modules_version}
%py3_install
popd

%if 0%{?with_python3_other}
%py3_other_install
pushd ../pyasn1-modules-%{modules_version}
%py3_other_install
popd
%endif


%check
# PYTHONPATH is required because the the tests expect python3-pyasn1
# to be installed.
PYTHONPATH="$RPM_BUILD_ROOT%{python3_sitelib}:$PYTHONPATH" %{__python3} setup.py test
%if 0%{?with_python3_other}
PYTHONPATH="$RPM_BUILD_ROOT%{python3_other_sitelib}:$PYTHONPATH" %{__python3_other} setup.py test
%endif


%files -n python%{python3_pkgversion}-%{srcname}
%doc README.md docs
%license LICENSE.rst
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-*.egg-info/

%files -n python%{python3_pkgversion}-%{srcname}-modules
%doc README.md
%license LICENSE.rst
%{python3_sitelib}/%{srcname}_modules/
%{python3_sitelib}/%{srcname}_modules-%{modules_version}-*.egg-info/

%if 0%{?with_python3_other}
%files -n python%{python3_other_pkgversion}-%{srcname}
%doc README.md docs
%license LICENSE.rst
%{python3_other_sitelib}/%{srcname}
%{python3_other_sitelib}/%{srcname}-%{version}-*.egg-info/

%files -n python%{python3_other_pkgversion}-%{srcname}-modules
%doc README.md
%license LICENSE.rst
%{python3_other_sitelib}/%{srcname}_modules/
%{python3_other_sitelib}/%{srcname}_modules-%{modules_version}-*.egg-info/
%endif


%changelog
* Mon Oct 28 2019 Avram Lubkin <aviso@rokhopper.net> - 0.4.7
- Updated to 0.4.7

* Thu Mar 07 2019 Troy Dawson <tdawson@redhat.com> - 0.1.9-2
- Rebuilt to change main python from 3.4 to 3.6

* Wed Aug 16 2017 Aurelien Bompard <abompard@fedoraproject.org> - 0.1.9-1
- Build for Python3-only on EPEL from the Fedora spec.
  http://fedoraproject.org/wiki/PackagingDrafts:Python3EPEL
- Modernize the spec a bit (macros)