# # spec file for package systemtap # # Copyright (c) 2019 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 https://bugs.opensuse.org/ # %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" != "" %define name_ext -%{flavor} %else %define name_ext %{nil} %endif %if ! %{defined _rundir} %define _rundir %{_localstatedir}/run %endif Name: systemtap%{name_ext} Version: 4.1 Release: 0 %if "%{flavor}" == "" Summary: Instrumentation System License: GPL-2.0-or-later Group: Development/Tools/Debuggers %endif %if "%{flavor}" == "docs" Summary: Documents and examples for systemtap License: GPL-2.0-or-later Group: Development/Tools/Debuggers %endif %if "%{flavor}" == "headers" Summary: SystemTap Headers License: GPL-2.0-or-later Group: Development/Tools/Debuggers %endif %if "%{flavor}" == "dtrace" Summary: SystemTap dtrace utility License: GPL-2.0-or-later Group: Development/Tools/Debuggers %endif Url: https://sourceware.org/systemtap/ Source0: https://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz Source1: https://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz.asc Source2: systemtap.keyring Source3: README-BEFORE-ADDING-PATCHES Source4: README-KEYRING Source5: stap-server.conf Patch1: systemtap-build-source-dir.patch Patch2: systemtap-docdir-fix.diff %if "%{flavor}" == "docs" || "%{flavor}" == "" BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ BuildRequires: libebl-devel BuildRequires: pkgconfig %endif %if "%{flavor}" == "docs" BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: texlive-amsfonts BuildRequires: texlive-babel-english BuildRequires: texlive-collection-fontsrecommended BuildRequires: texlive-metafont-bin BuildRequires: xmlto BuildRequires: tex(charter.sty) BuildRequires: tex(fancybox.sty) BuildRequires: tex(fancyhdr.sty) BuildRequires: tex(fancyvrb.sty) BuildRequires: tex(float.sty) BuildRequires: tex(fullpage.sty) %endif %if "%{flavor}" == "" BuildRequires: libavahi-devel BuildRequires: libcap-devel BuildRequires: mozilla-nspr-devel BuildRequires: mozilla-nss-devel BuildRequires: mozilla-nss-tools BuildRequires: python3-base BuildRequires: sqlite-devel BuildRequires: pkgconfig(systemd) Requires: %{name}-dtrace = %{version}-%{release} Requires: %{name}-runtime = %{version}-%{release} Requires: libebl1 Obsoletes: systemtap-client < 1.5 %endif %if "%{flavor}" == "docs" || "%{flavor}" == "dtrace" BuildArch: noarch %endif %description %if "%{flavor}" == "" SystemTap is an instrumentation system for systems running Linux. Developers can write instrumentation to collect data on the operation of the system. %endif %if "%{flavor}" == "docs" SystemTap is an instrumentation system for systems running Linux. This package contains the documents and examples for systemtap. %endif %if "%{flavor}" == "headers" SystemTap is an instrumentation system for systems running Linux. This package contains only the headers for static system probes and exists only to limit build cycles. Normally you should install systemtap-sdt-devel, which also contains these headers. %endif %if "%{flavor}" == "dtrace" SystemTap is an instrumentation system for systems running Linux. This package contains the dtrace utility to build provider and probe definitions. %endif %if "%{flavor}" == "" %package runtime Summary: Runtime environment for systemtap Group: Development/Tools/Debuggers %description runtime SystemTap is an instrumentation system for systems running Linux. This package contains the runtime environment for systemtap programs. %package server Summary: Systemtap server Group: Development/Tools/Debuggers Requires: %{name} = %{version}-%{release} # dependancies for systemtap shell scripts Requires: avahi Requires: avahi-utils Requires: coreutils Requires: mozilla-nss-tools Requires: unzip Requires: zip %description server SystemTap is an instrumentation system for systems running Linux. This package contains the server component of systemtap. %package sdt-devel Summary: Static probe support tools # systemtap-headers provides the same header files # as sdt-devel, so we must conflict. Group: Development/Tools/Debuggers Requires: %{name} = %{version}-%{release} Conflicts: systemtap-headers %description sdt-devel SystemTap is an instrumentation system for systems running Linux. This package contains the support tools for static probes. %endif %prep %setup -q -n systemtap-%{version} %patch1 -p1 %patch2 -p1 %build %if "%{flavor}" == "" autoreconf -fi %configure \ --disable-docs \ --with-python3 \ --docdir=%{_docdir}/systemtap make %{?_smp_mflags} V=1 %endif %if "%{flavor}" == "docs" # fix interpreter find testsuite examples -name "*.stp" | xargs -n1 sed -i -e 's, /bin/env, %{_bindir}/env,' find testsuite examples -type f | xargs chmod 644 autoreconf -fi %configure --docdir=%{_docdir}/systemtap --disable-nls --with-python3 make %{?_smp_mflags} %endif %if "%{flavor}" == "headers" # Our binutils always support '?' in the section characters on all # architectures, no need for configure tests sed -e 's/@support_section_question@/1/' < includes/sys/sdt-config.h.in > includes/sys/sdt-config.h %endif %if "%{flavor}" == "dtrace" sed s=@preferred_python@=%{_bindir}/python3= dtrace.in |sed s=@prefix@=%{prefix}= >dtrace %endif %install %if "%{flavor}" == "" %make_install rm -f %{buildroot}%{_bindir}/dtrace rm -f %{buildroot}%{_libexecdir}/systemtap/stap-server-request # README, AUTHORS, NEWS, man3 and all examples packaged by systemtap-docs # COPYING needs to stay in main for GPL rm -rf %{buildroot}%{_docdir}/systemtap/ rm -rf %{buildroot}%{_datadir}/systemtap/examples rm -rf %{buildroot}%{_mandir}/man3 %{buildroot}%{_mandir}/cs/man3 mkdir -p %{buildroot}%{_docdir}/systemtap/ cp COPYING %{buildroot}%{_docdir}/systemtap/ mkdir -p %{buildroot}%{_localstatedir}/cache/systemtap mkdir -p %{buildroot}%{_localstatedir}/log touch %{buildroot}%{_localstatedir}/log/stap-server.log # config file for stap-server (/var/run now on tmpfs) mkdir -p %{buildroot}%{_libexecdir}/tmpfiles.d install -m 644 %{SOURCE5} %{buildroot}%{_libexecdir}/tmpfiles.d %find_lang systemtap %endif %if "%{flavor}" == "docs" make DESTDIR=%{buildroot} install %{?_smp_mflags} doc # COPYING packaged by main spec cp README AUTHORS NEWS %{buildroot}%{_docdir}/systemtap/ # remove binaries and runtime stuff rm -rf %{buildroot}%{_bindir} rm -rf %{buildroot}%{_sbindir} rm -rf %{buildroot}%{_libdir} rm -rf %{buildroot}%{_libexecdir} rm -rf %{buildroot}%{_datadir}/systemtap rm -rf %{buildroot}%{_includedir} rm -rf %{buildroot}%{_sysconfdir} rm -rf %{buildroot}%{_unitdir} # these man pages are in each sub package rm -rf %{buildroot}%{_mandir}/man[178] rm -rf %{buildroot}%{_mandir}/cs/man[178] %endif %if "%{flavor}" == "headers" mkdir -p %{buildroot}%{_includedir}/sys cp -rp includes/sys/*.h %{buildroot}%{_includedir}/sys/ %endif %if "%{flavor}" == "dtrace" mkdir -p %{buildroot}%{_bindir} install -m 755 dtrace %{buildroot}%{_bindir} %endif %if "%{flavor}" == "" %post server # Create tmpfiles %tmpfiles_create %{_libexecdir}/tmpfiles.d/stap-server.conf %endif %files %if "%{flavor}" == "" %{_bindir}/stap %{_mandir}/man[17]/* %{_mandir}/cs/man[17]/* %dir %{_datadir}/%{name} %{_datadir}/%{name}/runtime %{_datadir}/%{name}/tapset #packaged by systemtap-initscript in upstream %dir %{_localstatedir}/cache/systemtap %files runtime -f systemtap.lang %doc %{_docdir}/systemtap %{_bindir}/staprun %{_bindir}/stapsh %{_bindir}/stap-merge %{_bindir}/stap-report %{_bindir}/stapbpf %dir %{_libexecdir}/%{name} %{_libexecdir}/%{name}/stapio %{_libexecdir}/%{name}/stap-env %{_libexecdir}/%{name}/stap-authorize-cert %{_mandir}/man8/staprun.8* %{_mandir}/man8/systemtap-service.8* %{_mandir}/cs/man8/systemtap.8* %{_mandir}/man8/stapsh.8* %{_mandir}/cs/man8/stapsh.8* %{_mandir}/man8/stapbpf.8* %files server %dir %{_libexecdir}/tmpfiles.d %{_libexecdir}/tmpfiles.d/stap-server.conf %{_bindir}/stap-server %{_libexecdir}/%{name}/stap-gen-cert %{_libexecdir}/%{name}/stap-serverd %{_libexecdir}/%{name}/stap-sign-module %{_libexecdir}/%{name}/stap-start-server %{_libexecdir}/%{name}/stap-stop-server %{_mandir}/man8/stap-server.8* %{_mandir}/cs/man8/stap-server.8* %ghost %{_localstatedir}/log/stap-server.log %ghost %dir %{_rundir}/stap-server %files sdt-devel %{_includedir}/sys/*.h %endif %if "%{flavor}" == "docs" %doc %{_docdir}/systemtap %{_mandir}/man3/* %{_mandir}/cs/man3/* %endif %if "%{flavor}" == "headers" %{_includedir}/sys/*.h %endif %if "%{flavor}" == "dtrace" %{_bindir}/dtrace %endif %changelog