File python-pip2pi.spec of Package python-pip2pi
#
# spec file for package python-pip2pi
#
# Copyright (c) 2019 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-%{**}}
Name: python-pip2pi
Version: 0.8.0
Release: 0
License: BSD-2-Clause
Summary: PyPI-compatible package repository from pip requirements
Url: https://github.com/wolever/pip2pi
Group: Development/Languages/Python
Source: https://github.com/wolever/pip2pi/archive/v%{version}.tar.gz#/pip2pi/pip2pi-%{version}.tar.gz
Patch0: https://patch-diff.githubusercontent.com/raw/wolever/pip2pi/pull/95.patch
Patch1: https://patch-diff.githubusercontent.com/raw/wolever/pip2pi/pull/85.patch
BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module pip >= 1.1}
BuildRequires: %{python_module pytest}
# /SECTION
BuildRequires: fdupes
Requires: python-pip >= 1.1
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
pip2pi builds a PyPI-compatible package repository from pip requirements.
%prep
%setup -q -n pip2pi-%{version}
%autopatch -p1
%build
%python_build
%check
cd tests
%python_exec ./test.py
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pip2pi
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative pip2pi
%postun
%python_uninstall_alternative pip2pi
%files %{python_files}
%doc README.rst
%python_alternative %{_bindir}/dir2pi
%python_alternative %{_bindir}/pip2pi
%python_alternative %{_bindir}/pip2tgz
%{python_sitelib}/*
%changelog