17
0

Accepting request 535524 from home:TheBlackCat:branches:devel:languages:python

- Implement single-spec version

OBS-URL: https://build.opensuse.org/request/show/535524
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bitstring?expand=0&rev=8
This commit is contained in:
Todd R
2017-10-26 02:48:00 +00:00
committed by Git OBS Bridge
parent 0a4cd263e7
commit dee6ebf808
2 changed files with 37 additions and 21 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Oct 18 16:42:21 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version
-------------------------------------------------------------------
Sun Jul 31 15:18:28 UTC 2016 - mardnh@gmx.de

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-bitstring
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,28 +16,34 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Test files missing
%bcond_with test
Name: python-bitstring
Version: 3.1.5
Release: 0
Url: http://python-bitstring.googlecode.com
Summary: Simple construction, analysis and modification of binary data
License: MIT
Group: Development/Libraries/Python
Group: Development/Languages/Python
Url: https://github.com/scott-griffiths/bitstring
Source: https://files.pythonhosted.org/packages/source/b/bitstring/bitstring-%{version}.zip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module pytest}
%endif
BuildArch: noarch
%python_subpackages
%description
bitstring is a pure Python module designed to help make
Bitstring is a pure Python module designed to help make
the creation and analysis of binary data as simple and natural as possible.
BitStrings can be constructed from integers (big and little endian), hex,
Bitstrings can be constructed from integers (big and little endian), hex,
octal, binary, strings or files. They can be sliced, joined, reversed,
inserted into, overwritten, etc. with simple functions or slice notation.
They can also be read from, searched and replaced, and navigated in,
@@ -45,21 +51,26 @@ similar to a file or stream.
%prep
%setup -q -n bitstring-%{version}
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' bitstring.py
# Fix wrong EOL encoding:
sed -i 's/\r$//' README.rst release_notes.txt
sed -i 's/\r$//' README.rst
sed -i '1{\@^#!/usr/bin/env python@d}' bitstring.py
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%files
%defattr(-,root,root)
%doc LICENSE README.rst release_notes.txt doc/*
%if %{with test}
%check
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
py.test-%{$python_bin_suffix}
}
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{python_sitelib}/*
%changelog