From 303548954cea44863222afe8f381ece08ff13638 Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 15 Dec 2016 13:06:02 -0600 Subject: [PATCH] Add new subrpms for python support to the spec file. * systemtap.spec: Add two new subrpms, 'systemtap-runtime-python2' and 'systemtap-runtime-python3', that contain python probe support. --- systemtap.spec | 84 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/systemtap.spec b/systemtap.spec index 7a6b661c6..7aaf5aa89 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -33,6 +33,8 @@ %endif %{!?with_pyparsing: %global with_pyparsing 0%{?fedora} >= 18 || 0%{?rhel} >= 7} %{!?with_python3: %global with_python3 0%{?fedora} >= 23} +%{!?with_python2_probes: %global with_python2_probes 1} +%{!?with_python3_probes: %global with_python3_probes 0%{?fedora} >= 23} %ifarch ppc64le aarch64 %global with_virthost 0 @@ -87,6 +89,8 @@ Release: 1%{?dist} # systemtap-runtime-java libHelperSDT.so, HelperSDT.jar, stapbm, req:-runtime # systemtap-runtime-virthost /usr/bin/stapvirt, req:libvirt req:libxml2 # systemtap-runtime-virtguest udev rules, init scripts/systemd service, req:-runtime +# systemtap-runtime-python2 HelperSDT python2 module, req:-runtime +# systemtap-runtime-python3 HelperSDT python3 module, req:-runtime # # Typical scenarios: # @@ -170,6 +174,12 @@ BuildRequires: readline-devel %if 0%{?rhel} <= 5 BuildRequires: ncurses-devel %endif +%if %{with_python2_probes} +BuildRequires: python-devel +%endif +%if %{with_python3_probes} +BuildRequires: python3-devel +%endif # Install requirements Requires: systemtap-client = %{version}-%{release} @@ -337,6 +347,12 @@ Requires: crash %if %{with_java} Requires: systemtap-runtime-java = %{version}-%{release} %endif +%if %{with_python2_probes} +Requires: systemtap-runtime-python2 = %{version}-%{release} +%endif +%if %{with_python3_probes} +Requires: systemtap-runtime-python3 = %{version}-%{release} +%endif %ifarch x86_64 Requires: /usr/lib/libc.so # ... and /usr/lib/libgcc_s.so.* @@ -372,6 +388,32 @@ that probe Java processes running on the OpenJDK 1.6 and OpenJDK 1.7 runtimes using Byteman. %endif +%if %{with_python2_probes} +%package runtime-python2 +Summary: Systemtap Python 2 Runtime Support +Group: Development/System +License: GPLv2+ +URL: http://sourceware.org/systemtap/ +Requires: systemtap-runtime = %{version}-%{release} + +%description runtime-python2 +This package includes support files needed to run systemtap scripts +that probe python 2 processes. +%endif + +%if %{with_python3_probes} +%package runtime-python3 +Summary: Systemtap Python 3 Runtime Support +Group: Development/System +License: GPLv2+ +URL: http://sourceware.org/systemtap/ +Requires: systemtap-runtime = %{version}-%{release} + +%description runtime-python3 +This package includes support files needed to run systemtap scripts +that probe python 3 processes. +%endif + %if %{with_virthost} %package runtime-virthost Summary: Systemtap Cross-VM Instrumentation - host @@ -493,6 +535,22 @@ cd .. %global java_config --without-java %endif +%if %{with_python3} +%global python3_config --with-python3 +%else +%global python3_config --without-python3 +%endif +%if %{with_python2_probes} +%global python2_probes_config --with-python2-probes +%else +%global python2_probes_config --without-python2-probes +%endif +%if %{with_python3_probes} +%global python3_probes_config --with-python3-probes +%else +%global python3_probes_config --without-python3-probes +%endif + %if %{with_virthost} %global virt_config --enable-virt %else @@ -505,15 +563,10 @@ cd .. %global dracut_config %{nil} %endif -%if %{with_python3} -%global python3_config --with-python3 -%else -%global python3_config --without-python3 -%endif # We don't ship compileworthy python code, just oddball samples %global py_auto_byte_compile 0 -%configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} %{python3_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" +%configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} %{python3_config} %{python2_probes_config} %{python3_probes_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" make %{?_smp_mflags} %if %{with_emacsvim} @@ -1033,6 +1086,25 @@ done %{_libexecdir}/systemtap/stapbm %endif +# Notice we're putting one file, stap-resolve-module-function.py, into +# *both* the python2 and python3 subrpms. This is OK as far as rpm is +# concerned, since they are the same file. Both subrpms use that same +# python script to help list python probes. +%if %{with_python2_probes} +%files runtime-python2 +%{python_sitelib}/HelperSDT +%{python_sitelib}/HelperSDT-*.egg-info +%{_libexecdir}/systemtap/python/stap-resolve-module-function.py +%exclude %{_libexecdir}/systemtap/python/stap-resolve-module-function.py? +%endif +%if %{with_python3_probes} +%files runtime-python3 +%{python3_sitelib}/HelperSDT +%{python3_sitelib}/HelperSDT-*.egg-info +%{_libexecdir}/systemtap/python/stap-resolve-module-function.py +%exclude %{_libexecdir}/systemtap/python/stap-resolve-module-function.py? +%endif + %if %{with_virthost} %files runtime-virthost %{_mandir}/man1/stapvirt.1* -- 2.43.5