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

%global modname tbgrep

Name:             python-tbgrep
Version:          0.3.0
Release:          16%{?dist}
Summary:          Extract Python Tracebacks from text

License:          GPLv3+
URL:              http://pypi.python.org/pypi/tbgrep
Source0:          http://pypi.python.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:        noarch


BuildRequires:    python2-devel
BuildRequires:    python2-nose

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

%global _description\
A module & command-line tool for extracting Python tracebacks from text.\
\
    $ tbgrep file1 file2 file3\
    $ tail -f logfile | tbgrep\
\
tbgrep can extract tracebacks from logs of various formats. For example,\
CherryPy starts the traceback on a line with other details (like module,\
timestamp, etc), but the rest of the trace starts at the beginning of the\
line. Apache logs, on the other hand, will prefix each line of the\
traceback with this information. tbgrep is designed to these kinds of\
situations

%description %_description

%package -n python2-tbgrep
Summary: %summary
%{?python_provide:%python_provide python2-tbgrep}

%description -n python2-tbgrep %_description

%if 0%{?with_python3}
%package -n python3-tbgrep
Summary:        Extract Python Tracebacks from text

%description -n python3-tbgrep
A module & command-line tool for extracting Python tracebacks from text.

    $ tbgrep file1 file2 file3
    $ tail -f logfile | tbgrep

tbgrep can extract tracebacks from logs of various formats. For example,
CherryPy starts the traceback on a line with other details (like module,
timestamp, etc), but the rest of the trace starts at the beginning of the
line. Apache logs, on the other hand, will prefix each line of the
traceback with this information. tbgrep is designed to these kinds of
situations
%endif

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

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
mv %{buildroot}/%{_bindir}/tbgrep %{buildroot}/%{_bindir}/python3-tbgrep
popd
%endif

%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}

%check
%{__python2} setup.py test

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif


%files -n python2-tbgrep
%doc README.rst LICENSE
%{python2_sitelib}/%{modname}
%{python2_sitelib}/%{modname}-%{version}*
%{_bindir}/tbgrep

%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.rst LICENSE
%{python3_sitelib}/%{modname}
%{python3_sitelib}/%{modname}-%{version}-*
%{_bindir}/python3-tbgrep
%endif


%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Tue Jul 24 2018 Kevin Fenzi <kevin@scrye.com> - 0.3.0-15
- Fix FTBFS bug #1605943

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

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.3.0-13
- Rebuilt for Python 3.7

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

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

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.3.0-10
- Python 2 binary package renamed to python2-tbgrep
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

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

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

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

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

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

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

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

* Fri Mar 27 2015 Ralph Bean <rbean@redhat.com> - 0.3.0-2
- Fix the with_python3 conditional.

* Fri Jan 30 2015 Luke Macken <lmacken@redhat.com> - 0.3.0-1
- Update to 0.3.0

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

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

* Mon Jul 22 2013 Luke Macken <lmacken@redhat.com> - 0.2.3-1
- Enable python3 support
- Update to 0.2.3

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

* Sun Aug 12 2012 Ralph Bean <rbean@redhat.com> - 0.2.2-1
- Latest upstream, includes LICENSE
* Sun Aug 12 2012 Ralph Bean <rbean@redhat.com> - 0.2.0-1
- Initial package for Fedora