File python-sh.spec of Package python-sh

#
# spec file for package python-sh
#
# 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/
#


Name:           python-sh
Version:        1.11
Release:        0
Summary:        Python subprocess interface
License:        MIT
Group:          Development/Languages/Python
Url:            https://github.com/amoffat/sh
Source:         https://pypi.python.org/packages/source/s/sh/sh-%{version}.tar.gz
# PATCH-FIX-UPSTREAM test-coding-fix.patch -- Use utf-8 coding
Patch0:         test-coding-fix.patch
# PATCH-FIX-OPENSUSE test-multiple-pipes-fix.patch -- Partially disable test case
Patch1:         test-multiple-pipes-fix.patch
# PATCH-FIX-OPENSUSE test-huge-piped-data-fix.patch -- Partially disable test case
Patch2:         test-huge-piped-data-fix.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%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
%endif
BuildRequires:  python-setuptools

%description
sh (previously pbs) is a full-fledged subprocess
replacement for Python 2.6 - 3.2 that allows you to call
any program as if it were a function:

    from sh import ifconfig
    print ifconfig("eth0")

sh is not a collection of system commands implemented in
Python.

%prep
%setup -q -n sh-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
python setup.py build

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

%check
python test.py

%files
%defattr(-,root,root)
%doc AUTHORS.md CHANGELOG.md LICENSE.txt README.md
%{python_sitelib}/sh.py
%{python_sitelib}/sh.pyc
%{python_sitelib}/sh-%{version}-*.egg-info

%changelog
openSUSE Build Service is sponsored by