14
0

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

Implement single-spec version

OBS-URL: https://build.opensuse.org/request/show/489350
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-virtualenv-clone?expand=0&rev=10
This commit is contained in:
Todd R
2017-04-19 15:45:19 +00:00
committed by Git OBS Bridge
parent 917c18b2a5
commit df300122f5
2 changed files with 24 additions and 26 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Apr 19 15:38:16 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version.
-------------------------------------------------------------------
Mon Feb 29 12:14:12 UTC 2016 - someuniquename@gmail.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-virtualenv-clone
#
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX Products 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-virtualenv-clone
Version: 0.2.6
Release: 0
@@ -23,18 +24,17 @@ Summary: Script to clone virtualenvs
License: MIT
Group: Development/Languages/Python
Url: http://github.com/edwardgeorge/virtualenv-clone
Source: virtualenv-clone-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-setuptools
Source: https://files.pythonhosted.org/packages/source/v/virtualenv-clone/virtualenv-clone-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
Recommends: python-virtualenv
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires(post): update-alternatives
Requires(preun): update-alternatives
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
%python_subpackages
%description
virtualenv cloning script.
@@ -73,32 +73,25 @@ It performs the following:
%setup -q -n virtualenv-clone-%{version}
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
# setup up update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
touch %{buildroot}%{_sysconfdir}/alternatives/virtualenv-clone
mv %{buildroot}%{_bindir}/virtualenv-clone %{buildroot}%{_bindir}/virtualenv-clone-%{py_ver}
ln -sf %{_sysconfdir}/alternatives/virtualenv-clone %{buildroot}/%{_bindir}/virtualenv-clone
%python_clone -a %{buildroot}%{_bindir}/virtualenv-clone
%post
update-alternatives \
--install %{_bindir}/virtualenv-clone virtualenv-clone %{_bindir}/virtualenv-clone-%{py_ver} 30
%python_install_alternative virtualenv-clone
%postun
if [ $1 -eq 0 ] ; then
update-alternatives --remove virtualenv-clone %{_bindir}/virtualenv-clone-%{py_ver}
fi
%preun
%python_uninstall_alternative virtualenv-clone
%files
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README
%{_bindir}/virtualenv-clone
%{_bindir}/virtualenv-clone-%{py_ver}
%ghost %{_sysconfdir}/alternatives/virtualenv-clone
%python_alternative %{_bindir}/virtualenv-clone
%{python_sitelib}/*
%changelog