Blame SPECS/dyninst.spec

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