Blob Blame History Raw
%global         usegit      1
%global         mainrel     0.16

%global         githash     78310e76371950cda6f77eb165521b19f7028c4a
%global         shorthash   %(TMP=%githash ; echo ${TMP:0:10})
%global         gitdate     Wed, 27 Jul 2016 08:17:23 +0100
%global         gitdate_num 20160727

%if 0%{?usegit} >= 1
%global         fedorarel   %{mainrel}.D%{gitdate_num}git%{shorthash}
%else
%global         fedorarel   %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}
%endif

%global	description_common \
This is a Python script to convert the output from prof, gprof, oprofile,\
Shark, AQtime, and python profilers into a dot graph.  It has the following\
features:\
\
* can correctly parse C++ template function names\
* allows to prune nodes and edges below a certain threshold\
* uses an heuristic to propagate time inside mutually recursive functions\
* uses color efficiently to draw attention to hot-spots\
%{nil}


Name:           gprof2dot
Version:        1.0
Release:        %{fedorarel}%{?dist}.1
Summary:        Generate dot graphs from the output of several profilers

Group:          Applications/Multimedia
License:        LGPLv3+
URL:            https://github.com/jrfonseca/gprof2dot
Source0:        https://github.com/jrfonseca/gprof2dot/archive/%{githash}/%{name}-%{version}-D%{gitdate_num}git%{githash}.tar.gz
BuildArch: noarch

BuildRequires:  python2
BuildRequires:  python3
BuildRequires:  graphviz
Requires:       python2

%description
%description_common

%package        python3
Summary:        Generate dot graphs from the output of several profilers
Group:          Applications/Multimedia
Requires:       python3

%description    python3
%description_common

This package uses python3.

%prep
%setup -q -n %{name}-%{githash}

%build

%install
mkdir -p %{buildroot}%{_bindir}

install -p -m 0755 gprof2dot.py %{buildroot}%{_bindir}/gprof2dot
ln -sf gprof2dot %{buildroot}%{_bindir}/gprof2dot-py2
install -p -m 0755 gprof2dot.py %{buildroot}%{_bindir}/gprof2dot-py3

sed -i %{buildroot}%{_bindir}/gprof2dot \
	-e 's|/usr/bin/env[ \t][ \t]*python$|%{_bindir}/python2|'
sed -i %{buildroot}%{_bindir}/gprof2dot-py3 \
	-e 's|/usr/bin/env[ \t][ \t]*python$|%{_bindir}/python3|'

chmod 0644 hotshotmain.py

%check
python2 ./tests/test.py
python3 ./tests/test.py

%files
%license LICENSE.txt
%doc README.markdown
%doc hotshotmain.py 
%doc sample.png

%{_bindir}/gprof2dot
%{_bindir}/gprof2dot-py2

%files python3
%license LICENSE.txt
%doc README.markdown
%doc hotshotmain.py 
%doc sample.png

%{_bindir}/gprof2dot-py3

%changelog
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.0-0.16.D20160727git78310e7637.1
- Rebuild for Python 3.6

* Thu Aug 18 2016 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.0-0.16.D20160727git78310e7637
- New upstream snapshot
- Create python3 subpackage

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-0.15.20150131gitc1354af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-0.14.20150131gitc1354af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Mar  4 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.0-0.13.20150131gitc1354af
- New upstream snapshot (actually same as pypi 2015.02.03)

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

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-0.11.20130226git1ef99
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Feb 26 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.9.20130226git1ef99
- New upstream snapshot

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

* Fri Jul 20 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.8.20120720git56961
- Update to solve https://bugzilla.redhat.com/show_bug.cgi?id=821864 (support perf)
- Upstream has switched to a git repo

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-0.7.20100708hg89
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-0.6.20100708hg89
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-0.5.20100708hg89
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 08 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.4.20100708hg89
- Update to new upstream

* Tue Apr 13 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.3.20100413hg88
- Update to new upstream

* Mon Sep 14 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.2.20090901svn
- Use svn export instead of svn checkout to generate the tarball
- Replace use of env with direct call to the python interpreter

* Tue Sep 1 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.1.20090901svn
- Initial Fedora build