Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

# A lot of inconsistency here :)
%global modname virtualenv-clone
%global undername virtualenv_clone
%global srcname clonevirtualenv

Name:             python-virtualenv-clone
Version:          0.2.6
Release:          10%{?dist}
Summary:          Script to clone virtualenvs

Group:            Development/Libraries
License:          MIT
URL:              http://pypi.python.org/pypi/virtualenv-clone
Source0:          http://pypi.python.org/packages/source/v/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:        noarch

BuildRequires:    python2-devel
BuildRequires:    python2-virtualenv

%if 0%{?with_python3}
BuildRequires:    python3-devel
BuildRequires:    python3-virtualenv
%endif

%description
A script for cloning a non-relocatable virtualenv.

Virtualenv provides a way to make virtualenv's relocatable which could then
be copied as we wanted. However making a virtualenv relocatable this way
breaks the no-site-packages isolation of the virtualenv as well as other
aspects that come with relative paths and '/usr/bin/env' shebangs that may
be undesirable.

Also, the .pth and .egg-link rewriting doesn't seem to work as intended.
This attempts to overcome these issues and provide a way to easily clone an
existing virtualenv.

%package -n python2-virtualenv-clone
Summary:          Script to clone virtualenvs
Group:            Development/Libraries
%{?python_provide:%python_provide python2-%{modname}}

Requires:         python2-virtualenv

%description -n python2-virtualenv-clone
A script for cloning a non-relocatable virtualenv.

Virtualenv provides a way to make virtualenv's relocatable which could then
be copied as we wanted. However making a virtualenv relocatable this way
breaks the no-site-packages isolation of the virtualenv as well as other
aspects that come with relative paths and '/usr/bin/env' shebangs that may
be undesirable.

Also, the .pth and .egg-link rewriting doesn't seem to work as intended.
This attempts to overcome these issues and provide a way to easily clone an
existing virtualenv.

%if 0%{?with_python3}
%package -n python3-virtualenv-clone
Summary:          Script to clone virtualenvs
Group:            Development/Libraries
%{?python_provide:%python_provide python3-%{modname}}

Requires:         python3-virtualenv

%description -n python3-virtualenv-clone
virtualenv cloning script.

A script for cloning a non-relocatable virtualenv.

Virtualenv provides a way to make virtualenv's relocatable which could then
be copied as we wanted. However making a virtualenv relocatable this way
breaks the no-site-packages isolation of the virtualenv as well as other
aspects that come with relative paths and '/usr/bin/env' shebangs that may
be undesirable.

Also, the .pth and .egg-link rewriting doesn't seem to work as intended.
This attempts to overcome these issues and provide a way to easily clone an
existing virtualenv.
%endif

%prep
%setup -q -n %{modname}-%{version}

%build
%if 0%{?with_python3}
%py3_build
%endif
%py2_build

%install
%if 0%{?with_python3}
%py3_install
mv %{buildroot}/%{_bindir}/virtualenv-clone %{buildroot}/%{_bindir}/virtualenv-clone-%{python3_version}
ln -s %{_bindir}/virtualenv-clone-%{python3_version} %{buildroot}/%{_bindir}/virtualenv-clone-3
%endif

%py2_install
mv %{buildroot}/%{_bindir}/virtualenv-clone %{buildroot}/%{_bindir}/virtualenv-clone-2.7
ln -s %{_bindir}/virtualenv-clone-2.7 %{buildroot}/%{_bindir}/virtualenv-clone-2
ln -s %{_bindir}/virtualenv-clone-2 %{buildroot}/%{_bindir}/virtualenv-clone

%files -n python2-%{modname}
%doc README
%{python2_sitelib}/%{srcname}.*
%{python2_sitelib}/%{undername}-%{version}*
%{_bindir}/virtualenv-clone
%{_bindir}/virtualenv-clone-2
%{_bindir}/virtualenv-clone-2.7

%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README
%{python3_sitelib}/%{srcname}.*
%{python3_sitelib}/%{undername}-%{version}-*
%{python3_sitelib}/__pycache__/*%{srcname}*
%{_bindir}/virtualenv-clone-3
%{_bindir}/virtualenv-clone-3.*
%endif

%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.2.6-10
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jan 31 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.2.6-8
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.2.6-5
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.6-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jan 28 2016 Ralph Bean <rbean@redhat.com> - 0.2.6-2
- Enable the python3 subpackage.
- Create a separate python2 subpackage and modernize macros.

* Mon Jun 29 2015 Ralph Bean <rbean@redhat.com> - 0.2.6-1
- new version

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed Jul 11 2012 Ralph Bean <rbean@redhat.com> - 0.2.4-1
- initial package for Fedora