Blob Blame History Raw
%global desc IPython features (tab completion, syntax highlighting, better tracebacks,\
better introspection) right in pdb.
%global srcname ipdb
%global sum IPython enabled Python debugger


Name:           python-ipdb
Version:        0.11
Release:        3%{?dist}
BuildArch:      noarch

License:        BSD
Summary:        IPython enabled Python debugger
Group:          Development/Debuggers
URL:            https://github.com/gotcha/%{srcname}/
Source0:        https://github.com/gotcha/%{srcname}/archive/%{version}.tar.gz

BuildRequires:  (python2-ipython >= 5.0.0 with python2-ipython < 6)
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python3-devel
BuildRequires:  python3-ipython
BuildRequires:  python3-setuptools


%description
%{desc}


%package -n python2-%{srcname}
Summary:        %{sum}

Requires:  (python2-ipython >= 5.0.0 with python2-ipython < 6)
%{?python_provide:%python_provide python2-%{srcname}}


%description -n python2-%{srcname}
%{desc}


%package -n python3-%{srcname}
Summary:        IPython enabled Python debugger

Requires:       python3-ipython
%{?python_provide:%python_provide python3-%{srcname}}


%description -n python3-ipdb
%{desc}


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

rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'

find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'


%build
%{__python2} setup.py build

pushd %{py3dir}
%{__python3} setup.py build
popd


%install
# Must do the python3 install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
mv %{buildroot}%{_bindir}/%{srcname}3 %{buildroot}%{_bindir}/%{srcname}-%{python3_version}
ln -s %{srcname}-%{python3_version} %{buildroot}%{_bindir}/%{srcname}-3
%{__python2} setup.py install --skip-build --root %{buildroot}
mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python2_version}
ln -s %{srcname}-%{python2_version} %{buildroot}%{_bindir}/%{srcname}
ln -s %{srcname}-%{python2_version} %{buildroot}%{_bindir}/%{srcname}-2


%check
%{__python2} setup.py test

pushd %{py3dir}
%{__python3} setup.py test
popd


%files -n python2-%{srcname}
%doc HISTORY.txt README.rst
%license COPYING.txt
%{python2_sitelib}/ipdb/
%{python2_sitelib}/ipdb-%{version}*.egg-info/
%{_bindir}/ipdb
%{_bindir}/ipdb-2
%{_bindir}/ipdb-%{python2_version}


%files -n python3-%{srcname}
%doc HISTORY.txt README.rst
%license COPYING.txt
%{python3_sitelib}/ipdb/
%{python3_sitelib}/ipdb-%{version}*.egg-info/
%{_bindir}/ipdb-3
%{_bindir}/ipdb-%{python3_version}


%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 0.11-2
- Rebuilt for Python 3.7

* Tue Feb 20 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 0.11-1
- Update to 0.11 (#1546586).
- https://github.com/gotcha/ipdb/blob/0.1/HISTORY.txt

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

* Fri Jan 19 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.10.2-3
- 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.10.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild