Blame SPECS/dyninst.spec

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