Blame SPECS/dyninst.spec

874308
# For RHEL8 we need this before using any scl macro.
874308
%global __python /usr/bin/python3
874308
874308
%{?scl:%scl_package dyninst}
874308
874308
Summary: An API for Run-time Code Generation
874308
License: LGPLv2+
874308
Name: %{?scl_prefix}dyninst
874308
Group: Development/Libraries
874308
Release: 1%{?dist}
874308
URL: http://www.dyninst.org
874308
Version: 11.0.0
874308
Exclusiveos: linux
874308
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
874308
874308
Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz
874308
Source1: https://github.com/dyninst/testsuite/archive/%{version}/testsuite-%{version}.tar.gz
874308
874308
Patch1: testsuite-11.0.0-test12.patch
874308
Patch2: testsuite-11.0.0-386.patch
874308
Patch3: dyninst-11.0.0-dwarf.patch
874308
Patch4: dyninst-11.0.0-tbb.patch
874308
874308
%global dyninst_base dyninst-%{version}
874308
%global testsuite_base testsuite-%{version}
874308
874308
BuildRequires: zlib-devel
874308
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
874308
BuildRequires: elfutils-devel
874308
BuildRequires: elfutils-libelf-devel
874308
BuildRequires: elfutils-debuginfod-client-devel
874308
BuildRequires: boost-devel
874308
BuildRequires: binutils-devel
874308
BuildRequires: cmake
874308
BuildRequires: libtirpc-devel
874308
BuildRequires: tbb tbb-devel
874308
874308
%{?scl:Requires: %scl_runtime}
874308
874308
# Extra requires just for the testsuite
874308
# NB, there's no separate libstdc++-static for <=el6
874308
%if 0%{?rhel} >= 7
874308
BuildRequires: libstdc++-static
874308
%endif
874308
BuildRequires: gcc-gfortran glibc-static libxml2-devel
874308
%if 0%{?rhel} == 6
874308
# C++11 requires devtoolset gcc.
874308
BuildRequires: %{?scl_prefix}gcc-c++
874308
%endif
874308
874308
# Testsuite files should not provide/require anything
874308
%{?filter_setup:
874308
%filter_provides_in %{_libdir}/dyninst/testsuite/
874308
%filter_requires_in %{_libdir}/dyninst/testsuite/
874308
%filter_setup
874308
}
874308
874308
%description
874308
874308
Dyninst is an Application Program Interface (API) to permit the insertion of
874308
code into a running program. The API also permits changing or removing
874308
subroutine calls from the application program. Run-time code changes are
874308
useful to support a variety of applications including debugging, performance
874308
monitoring, and to support composing applications out of existing packages.
874308
The goal of this API is to provide a machine independent interface to permit
874308
the creation of tools and applications that use run-time code patching.
874308
874308
%package doc
874308
Summary: Documentation for using the Dyninst API
874308
Group: Documentation
874308
%description doc
874308
dyninst-doc contains API documentation for the Dyninst libraries.
874308
874308
%package devel
874308
Summary: Header files for compiling programs with Dyninst
874308
Group: Development/System
874308
Requires: %{?scl_prefix}dyninst = %{version}-%{release}
874308
Requires: boost-devel
874308
Requires: tbb-devel
874308
874308
%description devel
874308
dyninst-devel includes the C header files that specify the Dyninst user-space
874308
libraries and interfaces. This is required for rebuilding any program
874308
that uses Dyninst.
874308
874308
%package static
874308
Summary: Static libraries for the compiling programs with Dyninst
874308
Group: Development/System
874308
Requires: %{?scl_prefix}dyninst-devel = %{version}-%{release}
874308
%description static
874308
dyninst-static includes the static versions of the library files for
874308
the dyninst user-space libraries and interfaces.
874308
874308
%package testsuite
874308
Summary: Programs for testing Dyninst
874308
Group: Development/System
874308
Requires: %{?scl_prefix}dyninst = %{version}-%{release}
874308
Requires: %{?scl_prefix}dyninst-devel = %{version}-%{release}
874308
Requires: %{?scl_prefix}dyninst-static = %{version}-%{release}
874308
Requires: glibc-static
874308
%description testsuite
874308
dyninst-testsuite includes the test harness and target programs for
874308
making sure that dyninst works properly.
874308
874308
%prep
874308
%setup -q -n %{name}-%{version} -c
874308
%setup -q -T -D -a 1
874308
874308
%patch1 -p1 -b .test12
874308
%patch2 -p1 -b .386
874308
%patch3 -p1 -b .dwarf
874308
%patch4 -p1 -b .tbb
874308
874308
# cotire seems to cause non-deterministic gcc errors
874308
# https://bugzilla.redhat.com/show_bug.cgi?id=1420551
874308
sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \
874308
  %{dyninst_base}/cmake/shared.cmake
874308
874308
%build
874308
874308
cd %{dyninst_base}
874308
874308
%if 0%{?rhel} == 6
874308
# C++11 requires devtoolset gcc.
874308
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
874308
%endif
874308
874308
CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
874308
LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
874308
%ifarch %{ix86}
874308
    CFLAGS="$CFLAGS -fno-lto -march=i686"
874308
    LDFLAGS="$LDFLAGS -fno-lto"
874308
%endif    
874308
CXXFLAGS="$CFLAGS"
874308
export CFLAGS CXXFLAGS LDFLAGS
874308
874308
%cmake \
874308
 -DENABLE_STATIC_LIBS=1 \
874308
 -DENABLE_DEBUGINFOD=1 \
874308
 -DINSTALL_LIB_DIR:PATH=%{_libdir}/dyninst \
874308
 -DINSTALL_INCLUDE_DIR:PATH=%{_includedir}/dyninst \
874308
 -DINSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Dyninst \
874308
 -DBoost_NO_BOOST_CMAKE=ON \
874308
 -DCMAKE_BUILD_TYPE:STRING=None \
874308
 -DCMAKE_SKIP_RPATH:BOOL=YES \
874308
 .
874308
%cmake_build
874308
874308
# Hack to install dyninst nearby, so the testsuite can use it
874308
DESTDIR="../install" %__cmake --install "%{__cmake_builddir}"
874308
find ../install -name '*.cmake' -execdir \
874308
  sed -i -e "s!%{_prefix}!$PWD/../install&!" '{}' '+'
874308
# cmake mistakenly looks for libtbb.so in the dyninst install dir
874308
sed -i '/libtbb.so/ s/".*usr/"\/usr/' $PWD/../install%{_libdir}/cmake/Dyninst/commonTargets.cmake
874308
874308
cd ../%{testsuite_base}
874308
%cmake \
874308
 -DDyninst_DIR:PATH=$PWD/../install%{_libdir}/cmake/Dyninst \
874308
 -DINSTALL_DIR:PATH=%{_libdir}/dyninst/testsuite \
874308
 -DCMAKE_BUILD_TYPE:STRING=Debug \
874308
 -DBoost_NO_BOOST_CMAKE=ON \
874308
 -DCMAKE_SKIP_RPATH:BOOL=YES \
874308
 .
874308
%cmake_build
874308
874308
%install
874308
874308
cd %{dyninst_base}
874308
%cmake_install
874308
874308
# It doesn't install docs the way we want, so remove them.
874308
# We'll just grab the pdfs later, directly from the build dir.
874308
rm -v %{buildroot}%{_docdir}/*-%{version}.pdf
874308
874308
cd ../%{testsuite_base}
874308
%make_install
874308
874308
# Ugly hack to mask testsuite files from debuginfo extraction.  Running the
874308
# testsuite requires debuginfo, so extraction is useless.  However, debuginfo
874308
# extraction is still nice for the main libraries, so we don't want to disable
874308
# it package-wide.  The permissions are restored by attr(755,-,-) in files.
874308
find %{buildroot}%{_libdir}/dyninst/testsuite/ \
874308
  -type f '!' -name '*.a' -execdir chmod 644 '{}' '+'
874308
874308
%files
874308
%defattr(-,root,root,-)
874308
874308
%dir %{_libdir}/dyninst
874308
%{_libdir}/dyninst/*.so.*
874308
# dyninst mutators dlopen the runtime library
874308
%{_libdir}/dyninst/libdyninstAPI_RT.so
874308
874308
%doc %{dyninst_base}/COPYRIGHT
874308
%doc %{dyninst_base}/LICENSE.md
874308
874308
%files doc
874308
%defattr(-,root,root,-)
874308
%doc %{dyninst_base}/dataflowAPI/doc/dataflowAPI.pdf
874308
%doc %{dyninst_base}/dynC_API/doc/dynC_API.pdf
874308
%doc %{dyninst_base}/dyninstAPI/doc/dyninstAPI.pdf
874308
%doc %{dyninst_base}/instructionAPI/doc/instructionAPI.pdf
874308
%doc %{dyninst_base}/parseAPI/doc/parseAPI.pdf
874308
%doc %{dyninst_base}/patchAPI/doc/patchAPI.pdf
874308
%doc %{dyninst_base}/proccontrol/doc/proccontrol.pdf
874308
%doc %{dyninst_base}/stackwalk/doc/stackwalk.pdf
874308
%doc %{dyninst_base}/symtabAPI/doc/symtabAPI.pdf
874308
874308
%files devel
874308
%defattr(-,root,root,-)
874308
%{_includedir}/dyninst
874308
%{_libdir}/dyninst/*.so
874308
%{_libdir}/cmake/Dyninst
874308
874308
%files static
874308
%defattr(-,root,root,-)
874308
%{_libdir}/dyninst/*.a
874308
874308
%files testsuite
874308
%defattr(-,root,root,-)
874308
%{_bindir}/parseThat
874308
%dir %{_libdir}/dyninst/testsuite/
874308
%attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a]
874308
%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a
874308
874308
%changelog
874308
* Wed May 19 2021 Stan Cox <scox@redhat.com> - 11.0.0
874308
- Update to 11.0.0
874308
874308
* Fri Nov 06 2020 Stan Cox <scox@redhat.com> - 10.2.1-2
874308
- Enable debuginfod
874308
874308
* Wed Oct 28 2020 Stan Cox <scox@redhat.com> - 10.2.1-1
874308
- Update to 10.2.1
874308
874308
* Mon Jun 1 2020 Martin Cermak <mcermak@redhat.com> - 10.1.0-2
874308
- NVR Bump and rebuild
874308
874308
* Sun Jun 9 2019 Stan Cox <scox@redhat.com> - 10.1.0-1
874308
- Update to 10.1.0