diff --git a/.gitignore b/.gitignore index e69de29..5aef90d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +*~ +*.rpm +*.tar* +*.zip +results_*/ +/binstruct-1.0.1.zip diff --git a/python-binstruct.spec b/python-binstruct.spec new file mode 100644 index 0000000..ea3352e --- /dev/null +++ b/python-binstruct.spec @@ -0,0 +1,112 @@ +%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+ +URL: https://pypi.python.org/pypi/%{pypi_name} +Source0: https://files.pythonhosted.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.zip + +BuildArch: noarch + +BuildRequires: dos2unix + +%description +%{global_desc} + + +%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} +%{global_desc} + + +%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} +%{global_desc} +%endif # with python3 + + +%prep +%autosetup -n %{pypi_name}-%{version} +%{_bindir}/find . -type f -print0 | \ + %{_bindir}/xargs -0 --max-args=1 %{_bindir}/dos2unix -ascii -k -s + + +%build +%py2_build +%if %{with python3} +%py3_build +%endif # with python3 + + +%install +%py2_install +%if %{with python3} +%py3_install +%endif # with python3 + + +%check +%{_bindir}/nosetests-%{python2_version} -vv +%if %{with python3} +%{_bindir}/nosetests-%{python3_version} -vv +%endif + + +%files -n python2-%{pypi_name} +%license LICENSE.txt +%doc PKG-INFO README.rst +%{python2_sitelib}/%{pypi_name}.py* +%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info + +%if %{with python3} +%files -n python3-%{pypi_name} +%license LICENSE.txt +%doc PKG-INFO README.rst +%{python3_sitelib}/%{pypi_name}.py +%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/__pycache__/%{pypi_name}.cpython-%{python3_version_nodots}*.pyc +%endif # with python3 + + +%changelog +* 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) diff --git a/sources b/sources index e69de29..a19d791 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +066a5f55c2f406050aead269ce064355 binstruct-1.0.1.zip