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
854b2d
Version: 10.2.1
b00c06
Exclusiveos: linux
b00c06
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
b00c06
854b2d
%define __testsuite_version 10.1.0
b00c06
Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{version}.tar.gz
854b2d
Source1: https://github.com/dyninst/testsuite/archive/v%{__testsuite_version}/testsuite-%{__testsuite_version}.tar.gz
b00c06
854b2d
Patch1: dyninst-gcc11.patch
854b2d
Patch2: dyninst-10.2.1-dbid.patch
854b2d
Patch3: testsuite-10.1.0-gettid.patch
854b2d
Patch4: testsuite-10.1.0-386.patch
854b2d
Patch5: testsuite-10.1.0-throw.patch
854b2d
Patch6: dyninst-10.2.1-tbb.patch
b00c06
b00c06
%global dyninst_base dyninst-%{version}
854b2d
%global testsuite_base testsuite-%{__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
854b2d
BuildRequires: elfutils-debuginfod-client-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
854b2d
BuildRequires: gcc-gfortran glibc-static 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
854b2d
%patch1 -p1 -b .gcc11
854b2d
%patch2 -p1 -b .dbid
854b2d
%patch3 -p1 -b .gettid
854b2d
%patch4 -p1 -b .386
854b2d
%patch5 -p1 -b .throw
854b2d
%patch6 -p1 -b .tbb
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
854b2d
CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
854b2d
LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
854b2d
%ifarch %{ix86}
854b2d
    CFLAGS="$CFLAGS -fno-lto -march=i686"
854b2d
    LDFLAGS="$LDFLAGS -fno-lto"
854b2d
%endif    
854b2d
CXXFLAGS="$CFLAGS"
854b2d
export CFLAGS CXXFLAGS LDFLAGS
854b2d
b00c06
%cmake \
b00c06
 -DENABLE_STATIC_LIBS=1 \
854b2d
 -DENABLE_DEBUGINFOD=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
 -DBoost_NO_BOOST_CMAKE=ON \
854b2d
 -DCMAKE_SKIP_RPATH:BOOL=YES \
854b2d
 .
854b2d
%make_build
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&!' '{}' '+'
854b2d
# cmake mistakenly looks for libtbb.so in the dyninst install dir
854b2d
sed -i '/libtbb.so/ s/".*usr/"\/usr/' $PWD/../install%{_libdir}/cmake/Dyninst/commonTargets.cmake
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 \
854b2d
 -DCMAKE_SKIP_RPATH:BOOL=YES \
854b2d
 .
854b2d
%make_build
b00c06
b00c06
%install
b00c06
b00c06
cd %{dyninst_base}
854b2d
%make_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}
854b2d
%make_install
854b2d
854b2d
# Ugly hack to mask testsuite files from debuginfo extraction.  Running the
854b2d
# testsuite requires debuginfo, so extraction is useless.  However, debuginfo
854b2d
# extraction is still nice for the main libraries, so we don't want to disable
854b2d
# it package-wide.  The permissions are restored by attr(755,-,-) in files.
854b2d
find %{buildroot}%{_libdir}/dyninst/testsuite/ \
854b2d
  -type f '!' -name '*.a' -execdir chmod 644 '{}' '+'
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
%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
%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
854b2d
* Fri Nov 06 2020 Stan Cox <scox@redhat.com> - 10.2.1-2
854b2d
- Enable debuginfod
854b2d
854b2d
* Wed Oct 28 2020 Stan Cox <scox@redhat.com> - 10.2.1-1
854b2d
- Update to 10.2.1
854b2d
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