Blame SPECS/dyninst.spec

13be8c
# For RHEL8 we need this before using any scl macro.
13be8c
%global __python /usr/bin/python3
13be8c
13be8c
%{?scl:%scl_package dyninst}
13be8c
13be8c
Summary: An API for Run-time Code Generation
13be8c
License: LGPLv2+
13be8c
Name: %{?scl_prefix}dyninst
13be8c
Group: Development/Libraries
13be8c
Release: 1%{?dist}
13be8c
URL: http://www.dyninst.org
13be8c
Version: 10.1.0
13be8c
Exclusiveos: linux
13be8c
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
13be8c
13be8c
Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz
13be8c
Source1: https://github.com/dyninst/testsuite/archive/v%{version}/testsuite-%{version}.tar.gz
13be8c
13be8c
Patch1: dyninst-10.1.0-tbb.patch
13be8c
Patch2: dyninst-10.1.0-result.patch
13be8c
Patch3: testsuite-10.1.0-386.patch
13be8c
13be8c
%global dyninst_base dyninst-%{version}
13be8c
%global testsuite_base testsuite-%{version}
13be8c
13be8c
13be8c
BuildRequires: zlib-devel
13be8c
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13be8c
BuildRequires: elfutils-devel
13be8c
BuildRequires: elfutils-libelf-devel
13be8c
BuildRequires: boost-devel
13be8c
BuildRequires: binutils-devel
13be8c
BuildRequires: cmake
13be8c
BuildRequires: libtirpc-devel
13be8c
BuildRequires: tbb tbb-devel
13be8c
13be8c
%{?scl:Requires: %scl_runtime}
13be8c
13be8c
# Extra requires just for the testsuite
13be8c
# NB, there's no separate libstdc++-static for <=el6
13be8c
%if 0%{?rhel} >= 7
13be8c
BuildRequires: libstdc++-static
13be8c
%endif
13be8c
BuildRequires: gcc-gfortran glibc-static nasm libxml2-devel
13be8c
%if 0%{?rhel} == 6
13be8c
# C++11 requires devtoolset gcc.
13be8c
BuildRequires: %{?scl_prefix}gcc-c++
13be8c
%endif
13be8c
13be8c
# Testsuite files should not provide/require anything
13be8c
%{?filter_setup:
13be8c
%filter_provides_in %{_libdir}/dyninst/testsuite/
13be8c
%filter_requires_in %{_libdir}/dyninst/testsuite/
13be8c
%filter_setup
13be8c
}
13be8c
13be8c
%description
13be8c
13be8c
Dyninst is an Application Program Interface (API) to permit the insertion of
13be8c
code into a running program. The API also permits changing or removing
13be8c
subroutine calls from the application program. Run-time code changes are
13be8c
useful to support a variety of applications including debugging, performance
13be8c
monitoring, and to support composing applications out of existing packages.
13be8c
The goal of this API is to provide a machine independent interface to permit
13be8c
the creation of tools and applications that use run-time code patching.
13be8c
13be8c
%package doc
13be8c
Summary: Documentation for using the Dyninst API
13be8c
Group: Documentation
13be8c
%description doc
13be8c
dyninst-doc contains API documentation for the Dyninst libraries.
13be8c
13be8c
%package devel
13be8c
Summary: Header files for compiling programs with Dyninst
13be8c
Group: Development/System
13be8c
Requires: %{?scl_prefix}dyninst = %{version}-%{release}
13be8c
Requires: boost-devel
13be8c
Requires: tbb-devel
13be8c
13be8c
%description devel
13be8c
dyninst-devel includes the C header files that specify the Dyninst user-space
13be8c
libraries and interfaces. This is required for rebuilding any program
13be8c
that uses Dyninst.
13be8c
13be8c
%package static
13be8c
Summary: Static libraries for the compiling programs with Dyninst
13be8c
Group: Development/System
13be8c
Requires: %{?scl_prefix}dyninst-devel = %{version}-%{release}
13be8c
%description static
13be8c
dyninst-static includes the static versions of the library files for
13be8c
the dyninst user-space libraries and interfaces.
13be8c
13be8c
%package testsuite
13be8c
Summary: Programs for testing Dyninst
13be8c
Group: Development/System
13be8c
Requires: %{?scl_prefix}dyninst = %{version}-%{release}
13be8c
Requires: %{?scl_prefix}dyninst-devel = %{version}-%{release}
13be8c
Requires: %{?scl_prefix}dyninst-static = %{version}-%{release}
13be8c
Requires: glibc-static
13be8c
%description testsuite
13be8c
dyninst-testsuite includes the test harness and target programs for
13be8c
making sure that dyninst works properly.
13be8c
13be8c
%prep
13be8c
%setup -q -n %{name}-%{version} -c
13be8c
%setup -q -T -D -a 1
13be8c
13be8c
%patch1 -p1 -b.tbb
13be8c
%patch2 -p1 -b.result
13be8c
%patch3 -p1 -b.386
13be8c
13be8c
# cotire seems to cause non-deterministic gcc errors
13be8c
# https://bugzilla.redhat.com/show_bug.cgi?id=1420551
13be8c
sed -i.cotire -e 's/USE_COTIRE true/USE_COTIRE false/' \
13be8c
  %{dyninst_base}/cmake/shared.cmake
13be8c
13be8c
%build
13be8c
13be8c
cd %{dyninst_base}
13be8c
13be8c
%if 0%{?rhel} == 6
13be8c
# C++11 requires devtoolset gcc.
13be8c
%{?scl:PATH=%{_bindir}${PATH:+:${PATH}}}
13be8c
%endif
13be8c
13be8c
%cmake \
13be8c
 -DENABLE_STATIC_LIBS=1 \
13be8c
 -DCMAKE_BUILD_TYPE:STRING=None \
13be8c
 -DINSTALL_LIB_DIR:PATH=%{_libdir}/dyninst \
13be8c
 -DINSTALL_INCLUDE_DIR:PATH=%{_includedir}/dyninst \
13be8c
 -DINSTALL_CMAKE_DIR:PATH=%{_libdir}/cmake/Dyninst \
13be8c
 -DLIBDWARF_LIBRARIES:FILEPATH="$libdwarf_builddir/libdwarf.a;-lz" \
13be8c
 -DLIBDWARF_INCLUDE_DIR:PATH=$libdwarf_builddir \
13be8c
 -DBoost_NO_BOOST_CMAKE=ON \
13be8c
 -DCMAKE_SKIP_RPATH:BOOL=YES
13be8c
make %{?_smp_mflags}
13be8c
13be8c
# Hack to install dyninst nearby, so the testsuite can use it
13be8c
make DESTDIR=../install install
13be8c
find ../install -name '*.cmake' -execdir \
13be8c
  sed -i -e 's!%{_prefix}!../install&!' '{}' '+'
13be8c
13be8c
cd ../%{testsuite_base}
13be8c
%cmake \
13be8c
 -DDyninst_DIR:PATH=$PWD/../install%{_libdir}/cmake/Dyninst \
13be8c
 -DINSTALL_DIR:PATH=%{_libdir}/dyninst/testsuite \
13be8c
 -DCMAKE_BUILD_TYPE:STRING=Debug \
13be8c
 -DBoost_NO_BOOST_CMAKE=ON \
13be8c
 -DCMAKE_SKIP_RPATH:BOOL=YES
13be8c
make %{?_smp_mflags}
13be8c
13be8c
%install
13be8c
13be8c
cd %{dyninst_base}
13be8c
make DESTDIR=$RPM_BUILD_ROOT install
13be8c
13be8c
# It doesn't install docs the way we want, so remove them.
13be8c
# We'll just grab the pdfs later, directly from the build dir.
13be8c
rm -v %{buildroot}%{_docdir}/*-%{version}.pdf
13be8c
13be8c
cd ../%{testsuite_base}
13be8c
make DESTDIR=$RPM_BUILD_ROOT install
13be8c
13be8c
%files
13be8c
%defattr(-,root,root,-)
13be8c
13be8c
%dir %{_libdir}/dyninst
13be8c
%{_libdir}/dyninst/*.so.*
13be8c
# dyninst mutators dlopen the runtime library
13be8c
%{_libdir}/dyninst/libdyninstAPI_RT.so
13be8c
13be8c
%doc %{dyninst_base}/COPYRIGHT
13be8c
%doc %{dyninst_base}/LICENSE.md
13be8c
13be8c
# %config(noreplace) /etc/ld.so.conf.d/*
13be8c
13be8c
%files doc
13be8c
%defattr(-,root,root,-)
13be8c
%doc %{dyninst_base}/dataflowAPI/doc/dataflowAPI.pdf
13be8c
%doc %{dyninst_base}/dynC_API/doc/dynC_API.pdf
13be8c
%doc %{dyninst_base}/dyninstAPI/doc/dyninstAPI.pdf
13be8c
%doc %{dyninst_base}/instructionAPI/doc/instructionAPI.pdf
13be8c
%doc %{dyninst_base}/parseAPI/doc/parseAPI.pdf
13be8c
%doc %{dyninst_base}/patchAPI/doc/patchAPI.pdf
13be8c
%doc %{dyninst_base}/proccontrol/doc/proccontrol.pdf
13be8c
%doc %{dyninst_base}/stackwalk/doc/stackwalk.pdf
13be8c
%doc %{dyninst_base}/symtabAPI/doc/symtabAPI.pdf
13be8c
13be8c
%files devel
13be8c
%defattr(-,root,root,-)
13be8c
%{_includedir}/dyninst
13be8c
%{_libdir}/dyninst/*.so
13be8c
%{_libdir}/cmake/Dyninst
13be8c
13be8c
%files static
13be8c
%defattr(-,root,root,-)
13be8c
%{_libdir}/dyninst/*.a
13be8c
13be8c
%files testsuite
13be8c
%defattr(-,root,root,-)
13be8c
%{_bindir}/parseThat
13be8c
13be8c
# Remove example tools packaged with dyninst
13be8c
%exclude %{_bindir}/cfg_to_dot
13be8c
%exclude %{_bindir}/codeCoverage
13be8c
%exclude %{_bindir}/unstrip
13be8c
%exclude %{_bindir}/ddb.db
13be8c
%exclude %{_bindir}/params.db
13be8c
%exclude %{_bindir}/unistd.db
13be8c
# and the corresponding debuginfo
13be8c
%exclude /usr/lib/debug/%{_bindir}/codeCoverage*debug
13be8c
%exclude /usr/lib/debug/%{_bindir}/unstrip*debug
13be8c
13be8c
%dir %{_libdir}/dyninst/testsuite/
13be8c
%attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a]
13be8c
%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a
13be8c
13be8c
%changelog
13be8c
* Sun Jun 9 2019 Stan Cox <scox@redhat.com> - 10.1.0-1
13be8c
- Update to 10.1.0