File python3-bpython.spec of Package python3-bpython
#
# spec file for package python3-bpython
#
# Copyright (c) 2016 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/
#
Name: python3-bpython
Version: 0.15
Release: 0
Url: http://www.bpython-interpreter.org
Summary: Fancy Curses Interface to the Python Interactive Interpreter
License: MIT
Group: Development/Languages/Python
Source: http://www.bpython-interpreter.org/releases/bpython-%{version}.tar.gz
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-six
BuildRequires: update-desktop-files
# Documentation requirements:
BuildRequires: python3-Sphinx
# Test requirements:
BuildRequires: python3-curses
BuildRequires: python3-mock
BuildRequires: python3-nose
Requires: python3-Pygments
Requires: python3-curses
Requires: python3-curtsies
Requires: python3-greenlet
Requires: python3-jedi
Requires: python3-pyparsing
Requires: python3-setuptools
Requires: python3-six
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%description
Bpython is an enhanced Python interactive interpreter that uses curses
and provides the following main features: in-line syntax highlighting;
readline-like autocompletion with suggestions displayed as you type; expected
argument specification for functions; a handy pastebin function to quickly
submit your code and return a URL. Its goal is to bring together a few handy
ideas to enhance the standard interpreter without getting carried away.
%prep
%setup -q -n bpython-%{version}
# Drop non-existing icon reference
sed -i -e "/Icon.*/d" \
-e "s/bpython/bpython-%{py3_ver}/g" data/bpython.desktop
mv data/bpython.desktop data/bpython3.desktop
mv data/bpython.png data/bpython3.png
mv data/bpython.appdata.xml data/bpython3.appdata.xml
sed -i -e "s/bpython.desktop/bpython3.desktop/" \
-e "s/bpython.png/bpython3.png/" \
-e "s/bpython.appdata.xml/bpython3.appdata.xml/" setup.py
%build
export LC_ALL=en_US.utf8
python3 setup.py build
python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo # HTML documentation
%install
export LC_ALL=en_US.utf8
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for p in bpython bpython-urwid bpython-curses bpdb; do
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py3_ver}
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
touch %{buildroot}%{_sysconfdir}/alternatives/$p
done
install -d %{buildroot}%{_mandir}/man1/
install -m 644 build/man/bpython.1 %{buildroot}%{_mandir}/man1/bpython-%{py3_ver}.1
ln -s -f %{_sysconfdir}/alternatives/bpython.1.gz %{buildroot}%{_mandir}/man1/bpython.1.gz
touch %{buildroot}%{_sysconfdir}/alternatives/bpython.1.gz
install -d %{buildroot}%{_mandir}/man5/
install -m 644 build/man/bpython-config.5 %{buildroot}%{_mandir}/man5/bpython-config-%{py3_ver}.5
ln -s -f %{_sysconfdir}/alternatives/bpython-config.5.gz %{buildroot}%{_mandir}/man5/bpython-config.5.gz
touch %{buildroot}%{_sysconfdir}/alternatives/bpython-config.5.gz
rm -r %{buildroot}%{python3_sitelib}/bpython/test # Don't ship tests
%if 0%{?suse_version}
%suse_update_desktop_file -G bpython -r bpython3 Development IDE
%endif
#NOTE(saschpe): Check the one failing test
#%%check
#nosetests
%post
update-alternatives \
--install %{_bindir}/bpython bpython %{_bindir}/bpython-%{py3_ver} 30 \
--slave %{_bindir}/bpbd bpbd %{_bindir}/bpbd-%{py3_ver} \
--slave %{_bindir}/bpython-curses bpython-curses %{_bindir}/bpython-curses-%{py3_ver} \
--slave %{_bindir}/bpython-urwid bpython-urwid %{_bindir}/bpython-urwid-%{py3_ver} \
--slave %{_mandir}/man1/bpython.1.gz bpython.1.gz %{_mandir}/man1/bpython-%{py3_ver}.1.gz \
--slave %{_mandir}/man5/bpython-config.5.gz bpython-config.5.gz %{_mandir}/man5/bpython-config-%{py3_ver}.5.gz
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove bpython %{_bindir}/bpython-%{py3_ver}
fi
%files
%defattr(-,root,root)
%doc AUTHORS CHANGELOG LICENSE README.rst build/sphinx/html
%{_bindir}/bpython
%{_bindir}/bpython-%{py3_ver}
%{_bindir}/bpdb
%{_bindir}/bpdb-%{py3_ver}
%{_bindir}/bpython-curses
%{_bindir}/bpython-curses-%{py3_ver}
%{_bindir}/bpython-urwid
%{_bindir}/bpython-urwid-%{py3_ver}
%{python3_sitelib}/bpdb
%{python3_sitelib}/bpython-%{version}-py%{py3_ver}.egg-info
%{python3_sitelib}/bpython
%{_mandir}/man1/bpython.1.gz
%{_mandir}/man1/bpython-%{py3_ver}.1.gz
%{_mandir}/man5/bpython-config.5.gz
%{_mandir}/man5/bpython-config-%{py3_ver}.5.gz
%ghost %{_sysconfdir}/alternatives/bpdb
%ghost %{_sysconfdir}/alternatives/bpython
%ghost %{_sysconfdir}/alternatives/bpython-curses
%ghost %{_sysconfdir}/alternatives/bpython-urwid
%ghost %{_sysconfdir}/alternatives/bpython.1.gz
%ghost %{_sysconfdir}/alternatives/bpython-config.5.gz
%{_datadir}/applications/bpython3.desktop
%if %{suse_version} == 1310 || %{suse_version} == 1315
%dir %{_datadir}/appdata
%endif
%{_datadir}/appdata/bpython3.appdata.xml
%{_datadir}/pixmaps/bpython3.png
%changelog