Blob Blame Raw
%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without python3
%else  # 0#{?fedora} || 0#{?rhel} >= 8
%bcond_with python3
%endif # 0#{?fedora} || 0#{?rhel} >= 8

%global pypi_name binstruct
%global global_desc							\
The binstruct library allows you to access binary data using a		\
predefined structure.  The binary data can be provided in any form	\
that allows an indexed access to single bytes.  This could for example	\
be a memory-mapped file.  The data structure itself is defined in way	\
similar to Django database table definitions by declaring a new class	\
with its fields.

Name:		python-%{pypi_name}
Version:	1.0.1
Release:	1%{?dist}
Summary:	Library for read/write access of binary data via structures

License:	GPLv3+

BuildArch:	noarch

BuildRequires:	dos2unix


%package -n python2-%{pypi_name}
Summary:	%{summary}

BuildRequires:	python2-devel
BuildRequires:	python2-nose
BuildRequires:	python2-pytest
BuildRequires:	python2-setuptools

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}

%if %{with python3}
%package -n python3-%{pypi_name}
Summary:	%{summary}

BuildRequires:	python3-devel
BuildRequires:	python3-nose
BuildRequires:	python3-pytest
BuildRequires:	python3-setuptools

%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
%endif # with python3

%autosetup -n %{pypi_name}-%{version}
%{_bindir}/find . -type f -print0 |					\
	%{_bindir}/xargs -0 --max-args=1 %{_bindir}/dos2unix -ascii -k -s

%if %{with python3}
%endif # with python3

%if %{with python3}
%endif # with python3

%{_bindir}/nosetests-%{python2_version} -vv
%if %{with python3}
%{_bindir}/nosetests-%{python3_version} -vv

%files -n python2-%{pypi_name}
%license LICENSE.txt

%if %{with python3}
%files -n python3-%{pypi_name}
%license LICENSE.txt
%endif # with python3

* Mon Oct 24 2016 Björn Esser <> - 1.0.1-1
- Initial import (rhbz 1387835)

* Sat Oct 22 2016 Björn Esser <> - 1.0.1-0.1
- Initial package (rhbz 1387835)