%global so_version 1 %global apiver 1.0 %bcond_without autoreconf # Doxygen HTML help is not suitable for packaging due to a minified JavaScript # bundle inserted by Doxygen itself. See discussion at # https://bugzilla.redhat.com/show_bug.cgi?id=2006555. # # We can enable the Doxygen PDF documentation as a lesser substitute. # # We still generate the HTML documentation, but strip out all the JavaScript # that causes policy issues. This degrades it in the browser, but is sufficient # to keep the Devhelp documentation working. %bcond_without doc_pdf Name: cairomm Summary: C++ API for the cairo graphics library Version: 1.12.2 Release: %autorelease URL: https://www.cairographics.org License: LGPLv2+ %global src_base https://www.cairographics.org/releases Source0: %{src_base}/cairomm-%{version}.tar.gz # The complete set of authorized GPG signing keys is not published # (https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/331), and # the signature is over a cryptographically-weak SHA1 checksum file # (https://gitlab.freedesktop.org/cairo/cairo/-/issues/458), as initially # reported in https://gitlab.freedesktop.org/cairo/cairomm/-/issues/25. # However, we are able to verify the signature (of the weak SHA1 checksum) # using the DSA key for Murray Cumming obtained from a public keyserver. Source1: %{src_base}/cairomm-%{version}.tar.gz.sha1.asc # Keyring with developer signature created on 2021-02-18 with: # # workdir="$(mktemp --directory)" # gpg2 --with-fingerprint < cairomm-1.12.2.tar.gz.sha1.asc 2>&1 | # awk '$2 == "using" { print "0x" $NF }' | # xargs gpg2 --homedir="${workdir}" \ # --keyserver=hkp://pool.sks-keyservers.net --recv-keys # gpg2 --homedir="${workdir}" --export --export-options export-minimal \ # > cairomm.gpg # rm -rf "${workdir}" # # Inspect keys using: gpg2 --list-keys --keyring ./cairomm.gpg Source2: cairomm.gpg BuildRequires: gnupg2 BuildRequires: gcc-c++ BuildRequires: make BuildRequires: pkgconfig %if %{with autoreconf} BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: autoconf-archive %endif BuildRequires: mm-common BuildRequires: cairo-devel BuildRequires: libsigc++20-devel BuildRequires: perl-interpreter BuildRequires: perl(Getopt::Long) BuildRequires: doxygen # dot BuildRequires: graphviz # xsltproc BuildRequires: libxslt BuildRequires: pkgconfig(mm-common-libstdc++) %if %{with doc_pdf} BuildRequires: doxygen-latex BuildRequires: make %endif # For tests: BuildRequires: boost-devel # Based on discussion in # https://src.fedoraproject.org/rpms/pangomm/pull-request/2, cairomm will # continue to provide API/ABI version 1.0 indefinitely, with the cairomm1.16 # package providing the new 1.16 API/ABI series. This virtual Provides is # therefore no longer required, as dependent packages requiring the 1.0 API/ABI # may safely require cairomm and its subpackages. Provides: cairomm%{apiver}%{?_isa} = %{version}-%{release} %description This library provides a C++ interface to cairo. The API/ABI version series is %{apiver}. %package devel Summary: Development files for cairomm Requires: cairomm%{?_isa} = %{version}-%{release} Provides: cairomm%{apiver}-devel%{?_isa} = %{version}-%{release} %description devel The cairomm-devel package contains libraries and header files for developing applications that use cairomm. The API/ABI version series is %{apiver}. %package doc Summary: Documentation for cairomm BuildArch: noarch Provides: cairomm%{apiver}-doc = %{version}-%{release} %description doc Documentation for cairomm can be viewed through the devhelp documentation browser. The API/ABI version series is %{apiver}. %prep # https://gitlab.freedesktop.org/cairo/cairomm/-/issues/25 # The .sha1.asc file in %%{SOURCE1} is a signed-but-not-encrypted copy of the # corresponding .sha1 file; see the description of the --sign option in # https://access.redhat.com/solutions/1541303. We “decrypt it” using the # signer’s public key from the keyring provided as %%{SOURCE2} to obtain a # verified copy of the .sha1 file. See /usr/lib/rpm/redhat/gpgverify, which is # the implementation of the %%gpgverify macro, although we cannot use that # macro due to the unconventional signing scheme. workdir="$(mktemp --directory)" gpg2 --homedir="${workdir}" --keyring '%{SOURCE2}' --decrypt '%{SOURCE1}' \ > "${workdir}/cairomm.sha1" pushd "${workdir}" ln -s '%{SOURCE0}' sha1sum -c cairomm.sha1 popd rm -rf "${workdir}" %autosetup # We must remove the jQuery/jQueryUI bundle with precompiled/minified/bundled # JavaScript that is in untracked/docs/reference/html/jquery.js, since such # sources are banned in Fedora. (Note also that the bundled JavaScript had a # different license.) We also remove the tag file, which triggers a rebuild of # the documentation. While we are at it, we might as well rebuild the devhelp # XML too. Note that we will still install the HTML documentation, since the # devhelp XML requires it, but we will strip out the JavaScript, which will # degrade the documentation in a web browser. rm -rf docs/reference/html rm docs/reference/cairomm-%{apiver}.tag \ docs/reference/cairomm-%{apiver}.devhelp2 %if %{with doc_pdf} # We enable the Doxygen PDF documentation as a lesser substitute. We must # enable GENERATE_LATEX and LATEX_BATCHMODE; the rest are precautionary and # should already be set as we like them. sed -r -i \ -e "s/^([[:blank:]]*(GENERATE_LATEX|LATEX_BATCHMODE|USE_PDFLATEX|\ PDF_HYPERLINKS)[[:blank:]]*=[[:blank:]]*)NO[[:blank:]]*/\1YES/" \ -e "s/^([[:blank:]]*(LATEX_TIMESTAMP)\ [[:blank:]]*=[[:blank:]]*)YES[[:blank:]]*/\1NO/" \ docs/reference/Doxyfile.in %endif %build %if %{with autoreconf} # Update obsolete Boost m4 macros cp -vp /usr/share/aclocal/ax_boost_base.m4 \ /usr/share/aclocal/ax_boost_unit_test_framework.m4 \ build/ NOCONFIGURE=1 ./autogen.sh %endif %configure --disable-static %make_build %if %{with doc_pdf} %make_build -C 'docs/reference/latex' %endif %install %make_install find %{buildroot} -type f -name '*.la' -print -delete install -t %{buildroot}%{_docdir}/cairomm-%{apiver} -m 0644 -p \ AUTHORS ChangeLog MAINTAINERS NEWS README # Strip out bundled and/or pre-minified JavaScript; this degrades the browser # experience, but the HTML is still usable for devhelp. find '%{buildroot}%{_docdir}/cairomm-%{apiver}/reference/html' \ -type f \( -name '*.js' -o -name '*.js.*' \) -print -delete %if %{with doc_pdf} install -t '%{buildroot}%{_docdir}/cairomm-%{apiver}/reference' -p -m 0644 \ 'docs/reference/latex/refman.pdf' %endif # Currently, we cannot run the tests because they require a static boost-test # library. %files %license COPYING %{_libdir}/libcairomm-%{apiver}.so.%{so_version} %{_libdir}/libcairomm-%{apiver}.so.%{so_version}.* %files devel %{_includedir}/cairomm-%{apiver} %{_libdir}/libcairomm-%{apiver}.so %{_libdir}/pkgconfig/cairomm-%{apiver}.pc %{_libdir}/pkgconfig/cairomm-*-%{apiver}.pc %{_libdir}/cairomm-%{apiver} %files doc %license COPYING # Note: JavaScript has been removed from HTML reference manual, degrading the # browser experience. It is still needed for Devhelp support. %doc %{_docdir}/cairomm-%{apiver} %doc %{_datadir}/devhelp/ %changelog %autochangelog