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

Implement single-spec version

OBS-URL: https://build.opensuse.org/request/show/486203
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-future?expand=0&rev=12
This commit is contained in:
Todd R 2017-04-06 16:24:43 +00:00 committed by Git OBS Bridge
parent b82d318638
commit 9ac719b9e3
2 changed files with 33 additions and 31 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Apr 6 16:24:20 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version
-------------------------------------------------------------------
Fri Nov 25 08:26:47 UTC 2016 - mimi.vx@gmail.com

View File

@ -1,7 +1,7 @@
#
# spec file for package python-future
#
# 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,6 +16,7 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-future
Version: 0.16.0
Release: 0
@ -23,59 +24,55 @@ Summary: Clean single-source support for Python 3 and 2
License: MIT
Group: Development/Languages/Python
Url: https://python-future.org
Source: https://pypi.python.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/f/future/future-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires(preun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
future: Easy, safe support for Python 2/3 compatibility
%python_subpackages
``future`` is the missing compatibility layer between Python 2 and Python
%description
Easy, safe support for Python 2/3 compatibility
future is the missing compatibility layer between Python 2 and Python
3. It allows you to use a single, clean Python 3.x-compatible codebase to
support both Python 2 and Python 3 with minimal overhead.
%prep
%setup -q -n future-%{version}
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
# Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for p in futurize pasteurize ; do
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
done
%python_clone -a %{buildroot}%{_bindir}/futurize
%python_clone -a %{buildroot}%{_bindir}/pasteurize
%{python_expand %fdupes %{buildroot}%{$python_sitearch} }
%fdupes %{buildroot}/%{python_sitelib}/*
%post
%_sbindir/update-alternatives \
--install %{_bindir}/futurize futurize %{_bindir}/futurize-%{py_ver} 30 \
--slave %{_bindir}/pasteurize pasteurize %{_bindir}/pasteurize-%{py_ver}
%{python_install_alternative futurize pasteurize}
%postun
if [ "$1" = 0 ] ; then
%_sbindir/update-alternatives --remove futurize %{_bindir}/futurize-%{py_ver}
fi
%preun
%python_uninstall_alternative futurize
%files
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%{python_sitelib}/*
%{_bindir}/futurize
%{_bindir}/pasteurize
%{_bindir}/futurize-%{py_ver}
%{_bindir}/pasteurize-%{py_ver}
%ghost %{_sysconfdir}/alternatives/futurize
%ghost %{_sysconfdir}/alternatives/pasteurize
%python_alternative %{_bindir}/futurize
%python_alternative %{_bindir}/pasteurize
%changelog