%bcond_without perf # perf tools
%bcond_without gtk # gtk perf version
-%define rel 2
+%define rel 3
%define basever 3.10
%define postver .27
Summary: Assortment of tools for the Linux kernel
%endif
Source1: cpupower.service
Source2: cpupower.config
+Source3: perf
URL: http://www.kernel.org/
BuildRequires: gettext-tools
BuildRequires: pciutils-devel
%py_ocomp $RPM_BUILD_ROOT%{_datadir}/perf-core/scripts/python
rm -r $RPM_BUILD_ROOT%{_datadir}/perf-core/tests
+
+install %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/perf
%endif
# gen_init_cpio
%if %{with perf}
%files perf-core
%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/perf
%{_mandir}/man1/perf*.1*
%dir %{_datadir}/perf-core
%attr(755,root,root) %{_datadir}/perf-core/perf-archive
--- /dev/null
+#!/bin/sh
+
+if [ -x /usr/bin/perf_gtk -a -n "$DISPLAY" ] ; then
+ # prefer GTK version under X11
+ exec /usr/bin/perf_gtk "$@"
+fi
+if [ -x /usr/bin/perf_slang ] ; then
+ # use text version if perf_gtk or $DISPLAY is not available
+ exec /usr/bin/perf_slang "$@"
+fi
+if [ -x /usr/bin/perf_gtk ] ; then
+ # fall-back to perf_gtk if no perf_slang (it can work in a terminal
+ # too)
+ exec /usr/bin/perf_gtk "$@"
+fi
+
+echo "You need 'kernel-tools-perf-gtk' or 'kernel-tools-perf-slang' package installed!"
+
+exit 1