Blame SPECS/dyninst.spec

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