systemtap/systemtap.spec

564 lines
17 KiB
RPMSpec

%define with_boost 1
%ifnarch arm
%define with_crash 1
%else
%define with_crash 0
%endif
%define with_docs 0
%if "%{stage1}" != "1"
%define with_grapher 1
%else
%define with_grapher 0
%endif
%define with_pie 1
%define with_rpm 1
%define with_sqlite 1
%if %with_docs
%define with_publican 0
%endif
Name: systemtap
Version: 4.4
Release: 3mamba
Summary: An instrumentation system for Linux systems
Group: System/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://sourceware.org/systemtap/
Source0: http://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libavahi-devel
BuildRequires: libdw-devel
BuildRequires: libelf-devel
BuildRequires: libgcc
BuildRequires: libjson-c-devel
BuildRequires: libncurses-devel
BuildRequires: libnspr-devel
BuildRequires: libnss-devel
BuildRequires: libperl
BuildRequires: libpython-devel
BuildRequires: libpython27-devel
BuildRequires: libpython3-devel
BuildRequires: libreadline-devel
BuildRequires: libsqlite-devel
BuildRequires: libstdc++6-devel
BuildRequires: libvirt-devel
BuildRequires: libxml2-devel
BuildRequires: perl-DBI
BuildRequires: perl-HTML-Parser
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: librpm-devel >= 4.16.1.2-1mamba
#%if %with_grapher
#BuildRequires: libglademm-devel
#BuildRequires: libgtkmm-devel
#%endif
BuildRequires: libnss-tools
%if %with_boost
BuildRequires: libboost-devel
%endif
%if %with_crash
BuildRequires: crash-devel
BuildRequires: libz-devel
Requires: crash
%endif
BuildRequires: pkgconfig
%if %with_rpm
BuildRequires: rpm-devel
%endif
# docs
%if %with_docs
BuildRequires: ghostscript
BuildRequires: latex2html
BuildRequires: tetex-dvips
BuildRequires: tetex-latex
BuildRequires: xmlto
#%if %with_publican
#TODO BuildRequires: publican
#%endif
%endif
Requires: gcc
# suggest kernel debuginfo
Requires: kernelheaders
Requires: make
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
%description
SystemTap is an instrumentation system for Linux systems.
Developers can write instrumentation to collect data on the operation of the system.
%package client
Group: System/Tools
Summary: Instrumentation System Client
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
#Requires: avahi
Requires: coreutils
Requires: libnss
Requires: libnss-tools
%description client
SystemTap client is the client component of an instrumentation system for systems running Linux 2.6. Developers can write instrumentation to collect data on the operation of the system.
%if %with_grapher
%package grapher
Summary: Instrumentation System Grapher
Group: System/Tools
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
%description grapher
SystemTap grapher is a utility for real-time visualization of data from SystemTap instrumentation scripts.
%endif
%package initscript
Group: System/Tools
Summary: Systemtap Initscript
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
Requires: initscripts
%description initscript
Initscript for Systemtap scripts.
%package runtime
Group: System/Tools
Summary: Instrumentation System Runtime
Requires: kernelheaders
#Requires: shadow
%description runtime
SystemTap runtime is the runtime component of an instrumentation system for systems running Linux 2.6. Developers can write instrumentation to collect data on the operation of the system.
%package sdt-devel
Group: System/Tools
Summary: Static probe support tools
%description sdt-devel
Support tools to allow applications to use static probes.
%package exporter
Group: System/Tools
Summary: Systemtap exporter
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
%description exporter
SystemTap exporter.
%package server
Group: System/Tools
Summary: Instrumentation System Server
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-runtime = %{?epoch:%epoch:}%{version}-%{release}
#Requires: avahi
Requires: coreutils
Requires: libnss
Requires: libnss-tools
Requires: unzip
Requires: zip
%description server
SystemTap server is the server component of an instrumentation system for systems running Linux 2.6. Developers can write instrumentation to collect data on the operation of the system.
%package testsuite
Group: System/Tools
Summary: Instrumentation System Testsuite
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-sdt-devel = %{?epoch:%epoch:}%{version}-%{release}
Requires: dejagnu
%description testsuite
The testsuite allows testing of the entire SystemTap toolchain without having to rebuild from sources.
%package -n python-systemtap
Group: System/Libraries
Summary: Python bindings to Systemtap
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n python-systemtap
Python bindings to Systemtap.
%debug_package
%prep
%setup -q
%build
%configure \
%if %with_crash
--enable-crash \
%else
--disable-crash \
%endif
%if %with_docs
--enable-docs \
%if %with_publican
--enable-publican \
--with-publican-brand=openmamba \
%endif
%else
--disable-docs \
%endif
%if %with_sqlite
--enable-sqlite \
%else
--disable-sqlite \
%endif
%if %with_rpm
--with-rpm \
%else
--without-rpm \
%endif
%if %with_pie
--enable-pie \
%else
--disable-pie \
%endif
%if %with_grapher
--enable-grapher \
%else
--disable-grapher \
%endif
--disable-silent-rules \
%ifarch arm
CPPFLAGS="%{optflags} -Wno-error=ignored-qualifiers"
%endif
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
#mv %{buildroot}%{_datadir}/doc/systemtap/examples examples
find examples testsuite -type f -name '*.stp' -print0 | xargs -0 sed -i -r -e '1s@^#!.+stap@#!%{_bindir}/stap@'
chmod 755 %{buildroot}%{_bindir}/staprun
install -c -m 755 stap-prep %{buildroot}%{_bindir}/stap-prep
cp -rp testsuite %{buildroot}%{_datadir}/systemtap
#mkdir -p %{buildroot}%{_sysconfdir}//rc.d/init.d/
#install -m 755 initscript/systemtap %{buildroot}%{_sysconfdir}/rc.d/init.d/
#mkdir -p %{buildroot}%{_sysconfdir}/systemtap
#mkdir -p %{buildroot}%{_sysconfdir}/systemtap/conf.d
#mkdir -p %{buildroot}%{_sysconfdir}/systemtap/script.d
#install -m 644 initscript/config.systemtap %{buildroot}%{_sysconfdir}/systemtap/config
#mkdir -p %{buildroot}%{_localstatedir}/cache/systemtap
#mkdir -p %{buildroot}%{_localstatedir}/run/systemtap
%if %with_docs
mkdir docs.installed
mv %{buildroot}%{_datadir}/doc/systemtap/*.pdf docs.installed/
mv %{buildroot}%{_datadir}/doc/systemtap/tapsets docs.installed/
%if %with_publican
mv %{buildroot}%{_datadir}/doc/systemtap/SystemTap_Beginners_Guide docs.installed/
%endif
%endif
#install -m 755 initscript/stap-server %{buildroot}%{_sysconfdir}/rc.d/init.d/
mkdir -p %{buildroot}%{_sysconfdir}/stap-server
mkdir -p %{buildroot}%{_sysconfdir}/stap-server/conf.d
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -m 644 initscript/config.stap-server %{buildroot}%{_sysconfdir}/sysconfig/stap-server
mkdir -p %{buildroot}%{_localstatedir}/log/stap-server
touch %{buildroot}%{_localstatedir}/log/stap-server/log
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 initscript/logrotate.stap-server %{buildroot}%{_sysconfdir}/logrotate.d/stap-server
#
install -d -m 0755 %{buildroot}%{_unitdir}
mv %{buildroot}%{_prefix}/lib/systemd/system/* %{buildroot}%{_unitdir}/
%find_lang %{name}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
getent group stap-server >/dev/null || groupadd -g 155 -r stap-server || groupadd -r stap-server
%pre runtime
getent group stapdev >/dev/null || groupadd -r stapdev
getent group stapusr >/dev/null || groupadd -r stapusr
exit 0
%pre server
getent passwd stap-server >/dev/null || \
/usr/sbin/useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d %{_localstatedir}/lib/stap-server -m -r -s /sbin/nologin stap-server || \
/usr/sbin/useradd -c "Systemtap Compile Server" -g stap-server -d %{_localstatedir}/lib/stap-server -m -r -s /sbin/nologin stap-server
test -e ~stap-server && chmod 755 ~stap-server
exit 0
%post server
test -e %{_localstatedir}/log/stap-server/log || {
touch %{_localstatedir}/log/stap-server/log
chmod 664 %{_localstatedir}/log/stap-server/log
chown stap-server:stap-server %{_localstatedir}/log/stap-server/log
}
if test ! -e ~stap-server/.systemtap/ssl/server/stap.cert; then
runuser -s /bin/sh - stap-server -c %{_libexecdir}/%{name}/stap-gen-cert >/dev/null
%{_bindir}/stap-authorize-server-cert ~stap-server/.systemtap/ssl/server/stap.cert
%{_bindir}/stap-authorize-signing-cert ~stap-server/.systemtap/ssl/server/stap.cert
fi
/sbin/chkconfig --add stap-server
exit 0
%preun server
if [ $1 = 0 ] ; then
/sbin/service stap-server stop >/dev/null 2>&1
/sbin/chkconfig --del stap-server
fi
exit 0
%postun server
if [ "$1" -ge "1" ] ; then
/sbin/service stap-server condrestart >/dev/null 2>&1 || :
fi
exit 0
%post initscript
/sbin/chkconfig --add systemtap
exit 0
%preun initscript
if [ $1 = 0 ] ; then
/sbin/service systemtap stop >/dev/null 2>&1
/sbin/chkconfig --del systemtap
fi
exit 0
%postun initscript
if [ "$1" -ge "1" ] ; then
/sbin/service systemtap condrestart >/dev/null 2>&1 || :
fi
exit 0
%post
(make -C %{_datadir}/systemtap/runtime/linux/uprobes clean) >/dev/null 3>&1 || true
(/sbin/rmmod uprobes) >/dev/null 2>&1 || true
%preun
(make -C %{_datadir}/systemtap/runtime/linux/uprobes clean) >/dev/null 3>&1 || true
(/sbin/rmmod uprobes) >/dev/null 2>&1 || true
%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/stap
%{_bindir}/stapbpf
%{_bindir}/stap-merge
%{_bindir}/stap-prep
%{_bindir}/stap-report
%{_bindir}/stapsh
%{_bindir}/stapvirt
%{_libexecdir}/systemtap/HelperSDT.jar
%{_libexecdir}/systemtap/stapbm
%{_libexecdir}/systemtap/libHelperSDT_*.so
%dir %{_datadir}/systemtap
%dir %{_datadir}/systemtap/runtime
%{_datadir}/systemtap/runtime/*.h
%{_datadir}/systemtap/runtime/*.c
%dir %{_datadir}/systemtap/runtime/softfloat
%{_datadir}/systemtap/runtime/softfloat/*.h
%{_datadir}/systemtap/runtime/transport
%{_datadir}/systemtap/runtime/unwind
%dir %{_datadir}/systemtap/runtime/linux
%{_datadir}/systemtap/runtime/linux/*.c
%{_datadir}/systemtap/runtime/linux/*.h
%dir %attr(0775,root,stap-server) %{_datadir}/systemtap/runtime/linux/uprobes
%{_datadir}/systemtap/runtime/linux/uprobes/*
%dir %{_datadir}/systemtap/runtime/linux/uprobes2
%{_datadir}/systemtap/runtime/linux/uprobes2/*
%{_datadir}/systemtap/tapset
%{_mandir}/man1/stap*.1*
%{_mandir}/man3/stap*.3stap*
%{_mandir}/man7/warning::symbols.7stap*
%{_mandir}/man7/stappaths.7*
%{_mandir}/man8/stapbpf.8*
%{_mandir}/man8/stapsh.8*
%{_mandir}/man8/systemtap-service.8*
%lang(cs) %{_mandir}/cs/man*/
%doc AUTHORS COPYING
#%files client
#%defattr(-,root,root)
#%{_bindir}/stap-client
#%{_libexecdir}/systemtap/stap-find-servers
#%{_libexecdir}/systemtap/stap-client-connect
#%{_mandir}/man8/stap-client.8.gz
#%if %with_grapher
#%files grapher
#%defattr(-,root,root)
#%{_bindir}/stapgraph
#%{_datadir}/systemtap/*.glade
#%{_mandir}/man1/stapgraph.1.gz
#%endif
#%files initscript
#%defattr(-,root,root)
#%{_sysconfdir}/rc.d/init.d/systemtap
#%dir %{_sysconfdir}/systemtap
#%dir %{_sysconfdir}/systemtap/conf.d
#%dir %{_sysconfdir}/systemtap/script.d
#%config(noreplace) %{_sysconfdir}/systemtap/config
#%dir %{_localstatedir}/cache/systemtap
#%dir %{_localstatedir}/run/systemtap
%files runtime
%defattr(-,root,root)
%attr(4111,root,root) %{_bindir}/staprun
#%{_bindir}/stap-authorize-server-cert
#%{_bindir}/stap-authorize-signing-cert
%{_libexecdir}/systemtap/stapio
%{_libexecdir}/systemtap/stap-env
%{_libexecdir}/systemtap/stap-authorize-cert
%if %with_crash
%{_libdir}/systemtap/staplog.so*
%endif
#%{_mandir}/man8/stap-authorize-server-cert.8.gz
#%{_mandir}/man8/stap-authorize-signing-cert.8.gz
%{_mandir}/man8/staprun.8*
%files sdt-devel
%defattr(-,root,root)
%{_bindir}/dtrace
%{_includedir}/sys/sdt.h
%{_includedir}/sys/sdt-config.h
%dir %{_datadir}/systemtap/examples/
%{_datadir}/systemtap/examples/*
%{_mandir}/man1/dtrace.1*
#%doc NEWS
%if %with_docs
%doc docs.installed/*.pdf
%doc docs.installed/tapsets
%if %with_publican
%doc docs.installed/SystemTap_Beginners_Guide
%endif
%endif
%files exporter
%defattr(-,root,root)
%dir %{_sysconfdir}/stap-exporter
%{_sysconfdir}/stap-exporter/EXAMPLE*
%config %{_sysconfdir}/stap-exporter/*.stp
%config(noreplace) %{_sysconfdir}/sysconfig/stap-exporter
%{_unitdir}/stap-exporter.service
%{_sbindir}/stap-exporter
%{_mandir}/man8/stap-exporter.8*
%files server
%defattr(-,root,root)
#%{_sysconfdir}/rc.d/init.d/stap-server
%config(noreplace) %{_sysconfdir}/logrotate.d/stap-server
%dir %{_sysconfdir}/stap-server
%dir %{_sysconfdir}/stap-server/conf.d
%{_bindir}/stap-server
%{_libexecdir}/systemtap/stap-serverd
%{_libexecdir}/systemtap/stap-start-server
%{_libexecdir}/systemtap/stap-stop-server
#%{_libexecdir}/systemtap/stap-find-servers
#%{_libexecdir}/systemtap/stap-find-or-start-server
%{_libexecdir}/systemtap/stap-gen-cert
#%{_libexecdir}/systemtap/stap-server-connect
%{_libexecdir}/systemtap/stap-sign-module
%config(noreplace) %{_sysconfdir}/sysconfig/stap-server
%dir %attr(0755,stap-server,stap-server) %{_localstatedir}/log/stap-server
%ghost %config %attr(0644,stap-server,stap-server) %{_localstatedir}/log/stap-server/log
%{_mandir}/man7/error::*.7stap*
%{_mandir}/man7/warning::buildid.7stap*
%{_mandir}/man7/warning::debuginfo.7stap*
%{_mandir}/man8/stap-server.8*
%files testsuite
%defattr(-,root,root)
%{_datadir}/systemtap/testsuite
%files -n python-systemtap
%defattr(-,root,root)
%dir %{python27_sitearch}/HelperSDT-*-py2.7.egg-info
%{python27_sitearch}/HelperSDT-*-py2.7.egg-info/*
%dir %{python27_sitearch}/HelperSDT
%{python27_sitearch}/HelperSDT/*
%dir %{python3_sitearch}/HelperSDT-*-py3.*.egg-info
%{python3_sitearch}/HelperSDT-0.1.0-py3.*.egg-info/*
%dir %{python3_sitearch}/HelperSDT
%{python3_sitearch}/HelperSDT/*
%{_libexecdir}/systemtap/python/stap-resolve-module-function.py
%changelog
* Mon Mar 08 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4-3mamba
- rebuilt to fix binary requirements under /bin
* Sun Mar 07 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4-2mamba
- rebuilt by autoport with build requirements: librpm-devel>=4.16.1.2-1mamba
* Thu Feb 25 2021 Automatic Build System <autodist@mambasoft.it> 4.4-1mamba
- automatic version update by autodist
* Mon Oct 26 2020 Automatic Build System <autodist@mambasoft.it> 4.3-1mamba
- automatic update by autodist
* Sat Jul 27 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1-1mamba
- update to 4.1
* Sun Dec 03 2017 Automatic Build System <autodist@mambasoft.it> 3.2-1mamba
- automatic update by autodist
* Sun Sep 24 2017 Automatic Build System <autodist@mambasoft.it> 3.1-1mamba
- automatic version update by autodist
* Wed Jul 27 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0-1mamba
- update to 3.0
* Sat Mar 07 2015 Automatic Build System <autodist@mambasoft.it> 2.7-1mamba
- automatic update by autodist
* Mon Oct 27 2014 Automatic Build System <autodist@mambasoft.it> 2.6-1mamba
- automatic update by autodist
* Wed Apr 09 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4-2mamba
- systemtap-runtime: remove requirement for shadow
* Sun Dec 01 2013 Automatic Build System <autodist@mambasoft.it> 2.4-1mamba
- automatic update by autodist
* Mon Jul 29 2013 Automatic Build System <autodist@mambasoft.it> 2.3-1mamba
- automatic update by autodist
* Fri May 17 2013 Automatic Build System <autodist@mambasoft.it> 2.2.1-1mamba
- automatic version update by autodist
* Sun Feb 24 2013 Automatic Build System <autodist@mambasoft.it> 2.1-1mamba
- automatic version update by autodist
* Thu Oct 18 2012 Automatic Build System <autodist@mambasoft.it> 2.0-1mamba
- automatic version update by autodist
* Mon Aug 13 2012 Automatic Build System <autodist@mambasoft.it> 1.8-1mamba
- automatic version update by autodist
* Sat Apr 14 2012 Automatic Build System <autodist@mambasoft.it> 1.7-1mamba
- automatic version update by autodist
* Mon Feb 21 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3-3mamba
- removed requirement and build requirement for kernel-mamba-headers
- require kernelheaders
- don't require crash for arm
* Mon Dec 27 2010 gil <puntogil@libero.it> 1.3-2mamba
- rebuilt devel
* Sat Sep 18 2010 gil <puntogil@libero.it> 1.3-1mamba
- update to 1.3
* Thu Jun 24 2010 gil <puntogil@libero.it> 1.2-1mamba
- update to 1.2
* Fri Jul 03 2009 gil <puntogil@libero.it> 0.9.8-1mamba
- package created by autospec