From cdde3295931a2dc1f4e4c531c83c6042988423ee Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Mar 30 2021 19:59:30 +0000 Subject: Add support for pre-generated documenation, allowing removal of pandoc dependency. (RHBZ 1943531, Keith Seitz) --- diff --git a/.gitignore b/.gitignore index d368e10..6e43e7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /v2.0.4.tar.gz +/doc-v2.0.4.tar.xz diff --git a/libipt.spec b/libipt.spec index 53770c2..f1b967e 100644 --- a/libipt.spec +++ b/libipt.spec @@ -1,16 +1,23 @@ +# rmpbuild parameters: +# --with docs: Build pre-generated documentation. + %global __cmake_in_source_build 1 Name: libipt Version: 2.0.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Intel Processor Trace Decoder Library License: BSD URL: https://github.com/intel/libipt Source0: https://github.com/intel/libipt/archive/v%{version}.tar.gz Patch0: libipt-gcc11.patch +Source1: doc-v%{version}.tar.xz # c++ is required only for -DPTUNIT test "ptunit-cpp". +BuildRequires: gcc-c++ cmake +%if 0%{?_with_docs:1} # pandoc is for -DMAN. -BuildRequires: gcc-c++ cmake pandoc +BuildRequires: pandoc +%endif BuildRequires: make ExclusiveArch: %{ix86} x86_64 @@ -37,7 +44,9 @@ develop programs that use the Intel Processor Trace (Intel PT) Decoder Library. %build %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DPTUNIT:BOOL=ON \ +%if 0%{?_with_docs:1} -DMAN:BOOL=ON \ +%endif -DDEVBUILD:BOOL=ON \ . %make_build @@ -47,6 +56,16 @@ develop programs that use the Intel Processor Trace (Intel PT) Decoder Library. %global develdocs howto_libipt.md (cd doc;cp -p %{develdocs} ..) +# If not building documentation, copy the pre-generated man pages +# to the appropriate place. Otherwise, tar up the generated +# documentation for use in subsequent builds. +%if 0%{?_with_docs:1} +(cd $RPM_BUILD_ROOT%{_mandir}/..; %__tar cJf %{SOURCE1} .) +%else +mkdir -p $RPM_BUILD_ROOT%{_mandir} +(cd $RPM_BUILD_ROOT%{_mandir}/..; %__tar xJf %{SOURCE1}) +%endif + %check ctest -V %{?_smp_mflags} @@ -62,6 +81,10 @@ ctest -V %{?_smp_mflags} %{_mandir}/*/*.gz %changelog +* Tue Mar 30 2021 Keith Seitz - 2.0.4-2 +- Add support for pre-generated documenation, allowing removal + of pandoc dependency. (RHBZ 1943531, Keith Seitz) + * Wed Mar 10 2021 Kevin Buettner - 2.0.4-1 - Release v2.0.4. diff --git a/sources b/sources index 096eddb..731f0c1 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (v2.0.4.tar.gz) = 596d2dac25fdbd3e5660d7e1feeb7e8d5d359d1d0e19b62ef593449037df236db1d4d98820f0031061b5573ed67797a85a77fb9991e215abaabc4bfe16ceaec8 +SHA512 (doc-v2.0.4.tar.xz) = f6d40c5ad6745ac0ae36f758bfd4dab53ffedc505b9dfa0377de2b67cc92f40417208c9afc094cd24011582b462e67ef5ebc33aec021236d0f3c8e1cabfe05af