File python-pylzma.spec of Package python-pylzma

#
# spec file for package python-pylzma
#
# Copyright (c) 2015 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define oname   pylzma
%define module  py7zlib

Name:           python-pylzma
Version:        0.4.8
Release:        0
Summary:        Python bindings for the LZMA compression library
License:        LGPL-2.1
Group:          Development/Languages/Python
Url:            http://www.joachim-bauch.de/projects/pylzma/
Source0:        https://pypi.python.org/packages/source/p/%{oname}/%{oname}-%{version}.tar.gz
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
BuildRequires:  python-devel
BuildRequires:  python-setuptools
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
PyLZMA provides a platform independent way to read and write data
that has been compressed or can be decompressed by the LZMA library.

%prep
%setup -q -n %{oname}-%{version}

# Remove Shebang
sed -i '1d' %{module}.py

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%if 0%{?suse_version}
    %fdupes -s %{buildroot}%{_prefix}
%endif

%files
%defattr(-,root,root)
%doc doc/* LICENSE README.md
%{python_sitearch}/%{module}.py*
%{python_sitearch}/%{oname}.so
%{python_sitearch}/%{oname}-%{version}-py%{py_ver}.egg-info

%changelog
openSUSE Build Service is sponsored by