Blame SPECS/dyninst.spec

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