[DTrace-devel] [PATCH v2 1/9] spec: install sdt*.h in /usr/lib64/dtrace/include/sys
Kris Van Hees
kris.van.hees at oracle.com
Fri Aug 2 05:23:38 UTC 2024
On Thu, Aug 01, 2024 at 02:21:48PM +0100, Nick Alcock wrote:
> This is the specfile part of the sdt.h move, rendered more
> complex by the need to clean up the mess left behind by the
> old sdt.h renaming.
>
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
> dtrace.spec | 22 +++++++---------------
> 1 file changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/dtrace.spec b/dtrace.spec
> index 42ea9bc33958..28eeaa478376 100644
> --- a/dtrace.spec
> +++ b/dtrace.spec
> @@ -86,8 +86,6 @@ BuildRequires: binutils-devel >= 2.30-58.0.8
> Requires: libdtrace-ctf >= 1.1.0
> BuildRequires: libdtrace-ctf-devel >= 1.1.0
> %endif
> -Conflicts: systemtap-sdt-devel
> -Provides: systemtap-sdt-devel
> Summary: DTrace user interface.
> Version: 2.0.1
> Release: 0%{?dist}
> @@ -194,11 +192,6 @@ make DESTDIR=$RPM_BUILD_ROOT VERSION=%{version} \
> sed -i '/^ProtectSystem=/d; /^ProtectControlGroups=/d; /^RuntimeDirectory/d;' $RPM_BUILD_ROOT/usr/lib/systemd/system/dtprobed.service
> %endif
>
> -# Because systemtap creates a sdt.h header file we have to rename
> -# ours and then shift theirs out of the way.
> -mv $RPM_BUILD_ROOT/usr/include/sys/sdt.h \
> - $RPM_BUILD_ROOT/usr/include/sys/sdt-dtrace.h
> -
> %clean
> [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
> rm -rf $RPM_BUILD_DIR/%{name}-%{version}
> @@ -222,13 +215,14 @@ if [ $1 -ge 2 ] ; then
> %systemd_postun_with_restart dtprobed.service
> fi
>
> -# if sdt-systemtap.h doesn't exist then we can move the existing dtrace sdt.h
> +# Clean up the mess left behind by previous installations' overwriting
> +# of systemtap's sdt.h: if an sdt-systemtap.h exists and is a regular
> +# file, move it back to sdt.h. (RPM itself will identify and delete
> +# all the other debris.)
> +
> SYSINCDIR=/usr/include/sys
> -if [ -e $SYSINCDIR/sdt.h -a ! -e $SYSINCDIR/sdt-systemtap.h ]; then
> - mv $SYSINCDIR/sdt.h $SYSINCDIR/sdt-systemtap.h
> - ln -s $SYSINCDIR/sdt-dtrace.h $SYSINCDIR/sdt.h
> -elif [ ! -e $SYSINCDIR/sdt.h ]; then
> - ln -s $SYSINCDIR/sdt-dtrace.h $SYSINCDIR/sdt.h
> +if [ -f $SYSINCDIR/sdt-systemtap.h ]; then
> + mv -f $SYSINCDIR/sdt-systemtap.h $SYSINCDIR/sdt.h
> fi
>
> %preun
> @@ -253,8 +247,6 @@ systemctl start dtprobed || :
> %{_sbindir}/dtrace
> %{_sbindir}/dtprobed
> %{_mandir}/man8/dtrace.8.gz
> -%{_includedir}/sys/sdt-dtrace.h
> -%{_includedir}/sys/sdt_internal.h
> %doc %{_docdir}/dtrace-%{version}/*
> %{_unitdir}/dtprobed.service
> %{_unitdir}/dtrace-usdt.target
> --
> 2.46.0.277.ge12b8151ed
More information about the DTrace-devel
mailing list