File python-dev.spec of Package python-dev

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


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without  test
Name:           python-dev
Version:        0.4.0
Release:        0
License:        SUSE-Public-Domain
Summary:        Libraries and tools for Python development
Url:            http://github.com/jwp/py-dev
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/d/dev/dev-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildArch:      noarch

%python_subpackages

%description
Dev is a collection of Python developer tools presented as a
modest alternative to the standard library's offering.

%prep
%setup -q -n dev-%{version}
# Add encoding
sed -i "1i # -*- coding: UTF-8 -*-" dev/__init__.py

%build
export LANG=en_US.UTF-8
%python_build

%install
export LANG=en_US.UTF-8
%python_install
%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/dev/documentation/sphinx/build.sh
chmod a+x %{buildroot}%{$python_sitelib}/dev/skeleton/documentation/sphinx/build.sh
%fdupes %{buildroot}%{$python_sitelib}
}

%if %{with test}
%check
export LANG=en_US.UTF-8
%python_exec -m unittest dev.test
%endif

%files %{python_files}
%defattr(-,root,root,-)
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by