spec: install sdt*.h in /usr/lib64/dtrace/include/sys
PATCH 1/1 spec: install sdt*.h in /usr/lib64/dtrace/include/sys
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 <[email protected]>
--- dtrace.spec | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-)
dtrace.spec +7 -15
@@ -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
Signature · 1 line
2.45.1.275.g567cb0950c