+#
+# Conditional build:
+%bcond_without libunwind # strack tracing using libunwind
+%bcond_without libiberty # symbol demangling in stack backtraces
+#
+%ifnarch %{ix86} %{x8664} x32 %{arm} hppa ia64 mips ppc ppc64 sh
+%undefine with_libunwind
+%endif
+
+%ifnarch aarch64
+%define with_mpers 1
+%endif
+
Summary: prints system call strace of a running process
Summary(de.UTF-8): druckt ein Protokoll der Systemaufrufe eines laufenden Prozesses
Summary(es.UTF-8): Enseña las llamadas de sistema de un proceso en ejecución
Summary(tr.UTF-8): Çalışan bir sürecin yaptığı sistem çağrılarını listeler
Summary(uk.UTF-8): Відслідковує та показує системні виклики, пов'язані із запущеним процесом
Name: strace
-Version: 4.5.18
-Release: 2
-License: BSD-like
+Version: 5.13
+Release: 1
+License: LGPL v2.1+
Group: Development/Debuggers
-Source0: http://dl.sourceforge.net/strace/%{name}-%{version}.tar.bz2
-# Source0-md5: e9449fcee97e6a8ed73934c883c870e0
+Source0: https://github.com/strace/strace/releases/download/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: a64471e9e9df0f5b0d81461cb17926ea
Source1: %{name}.1.pl
-Patch0: %{name}-stat64.patch
-Patch1: %{name}-fd.patch
-URL: http://sourceforge.net/projects/strace/
+Patch0: %{name}-binutils2.36.patch
+URL: https://strace.io/
# acl and libaio for headers only
BuildRequires: acl-devel
-BuildRequires: autoconf >= 2.57
-BuildRequires: automake
+%{?with_libiberty:BuildRequires: binutils-devel >= 4:2.30-1}
BuildRequires: libaio-devel
+%{?with_libunwind:BuildRequires: libunwind-devel}
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
invoked subprocesses, and is useful for finding out what complex
commands do.
-The script can also handle the output with strace -t, -tt, or -ttt.
-It will add elapsed time for each process in that case.
+The script can also handle the output with strace -t, -tt, or -ttt. It
+will add elapsed time for each process in that case.
%description graph -l pl.UTF-8
Skrypt strace-graph przetwarza wynik strace -f i wyświetla graf
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
%build
-%{__aclocal}
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure
+%if %{with libunwind}
+# workaround for:
+# /usr/bin/ld: copy reloc against protected `_UPT_accessors' is invalid
+# /usr/bin/ld: failed to set dynamic section sizes: Bad value
+# (should be fixed in gcc >(=?) 5.1)
+CFLAGS="%{rpmcflags} -fPIE"
+%endif
+%configure \
+ %{!?with_libiberty:--without-libiberty} \
+ %{!?with_libunwind:--without-libunwind} \
+ --enable-mpers=%{?with_mpers:yes}%{!?with_mpers:no}
%{__make}
%install
install -D %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/pl/man1/strace.1
+cp -p src/strace-graph $RPM_BUILD_ROOT%{_bindir}
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc COPYRIGHT CREDITS ChangeLog NEWS README-linux TODO
+%doc COPYING CREDITS ChangeLog NEWS doc/README-linux-ptrace
%attr(755,root,root) %{_bindir}/strace
-%{_mandir}/man1/*
-%lang(pl) %{_mandir}/pl/man1/*
+%attr(755,root,root) %{_bindir}/strace-log-merge
+%{_mandir}/man1/strace.1*
+%{_mandir}/man1/strace-log-merge.1*
+%lang(pl) %{_mandir}/pl/man1/strace.1*
%files graph
%defattr(644,root,root,755)