Reduce macro indirection in spec file

This commit is contained in:
Benjamin A. Beasley 2021-09-25 12:34:38 -04:00
parent 1f2b81be95
commit 77b999680d

View File

@ -15,7 +15,7 @@ URL: https://www.cairographics.org
License: LGPLv2+
%global src_base https://www.cairographics.org/releases
Source0: %{src_base}/%{name}-%{version}.tar.xz
Source0: %{src_base}/cairomm-%{version}.tar.xz
# No keyring with authorized GPG signing keys is published
# (https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/331), but we
# are able to verify the signature using the key for Kjell Ahlstedt from
@ -65,7 +65,7 @@ BuildRequires: boost-devel
# 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: %{name}%{apiver}%{?_isa} = %{version}-%{release}
Provides: cairomm%{apiver}%{?_isa} = %{version}-%{release}
%description
This library provides a C++ interface to cairo.
@ -74,30 +74,31 @@ The API/ABI version series is %{apiver}.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Summary: Development files for cairomm
Requires: cairomm%{?_isa} = %{version}-%{release}
Provides: %{name}%{apiver}-devel%{?_isa} = %{version}-%{release}
Provides: cairomm%{apiver}-devel%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for developing
applications that use %{name}.
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 %{name}
Summary: Documentation for cairomm
BuildArch: noarch
Requires: libstdc++-docs
Requires: libsigc++20-doc
Provides: %{name}%{apiver}-doc = %{version}-%{release}
Provides: cairomm%{apiver}-doc = %{version}-%{release}
%description doc
Documentation for %{name} can be viewed either through the devhelp
Documentation for cairomm can be viewed either through the devhelp
documentation browser or through a web browser at
%{_datadir}/doc/%{name}-%{apiver}/.
%{_docdir}/cairomm-%{apiver}/.
The API/ABI version series is %{apiver}.
@ -108,11 +109,11 @@ The API/ABI version series is %{apiver}.
workdir="$(mktemp --directory)"
gpg2 --homedir="${workdir}" --yes --import '%{SOURCE2}'
gpg2 --homedir="${workdir}" --export --export-options export-minimal \
> %{name}.gpg
> cairomm.gpg
rm -rf "${workdir}"
%{gpgverify} \
--keyring='%{name}.gpg' --signature='%{SOURCE1}' --data='%{SOURCE0}'
--keyring='cairomm.gpg' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup
# We must remove the jQuery/jQueryUI bundle with precompiled/minified/bundled
@ -122,8 +123,8 @@ rm -rf "${workdir}"
# the documentation. While we are at it, we might as well rebuild the devhelp
# XML too.
rm -rf untracked/docs/reference/html
rm untracked/docs/reference/%{name}-%{apiver}.tag \
untracked/docs/reference/%{name}-%{apiver}.devhelp2
rm untracked/docs/reference/cairomm-%{apiver}.tag \
untracked/docs/reference/cairomm-%{apiver}.devhelp2
%build
@ -141,9 +142,9 @@ rm untracked/docs/reference/%{name}-%{apiver}.tag \
%meson_install
find %{buildroot} -type f -name '*.la' -print -delete
install -t %{buildroot}%{_datadir}/doc/%{name}-%{apiver} -m 0644 -p \
install -t %{buildroot}%{_docdir}/cairomm-%{apiver} -m 0644 -p \
AUTHORS ChangeLog MAINTAINERS NEWS README
cp -rp examples %{buildroot}%{_datadir}/doc/%{name}-%{apiver}/
cp -rp examples %{buildroot}%{_docdir}/cairomm-%{apiver}/
%check
@ -152,21 +153,21 @@ cp -rp examples %{buildroot}%{_datadir}/doc/%{name}-%{apiver}/
%files
%license COPYING
%{_libdir}/lib%{name}-%{apiver}.so.%{so_version}
%{_libdir}/lib%{name}-%{apiver}.so.%{so_version}.*
%{_libdir}/libcairomm-%{apiver}.so.%{so_version}
%{_libdir}/libcairomm-%{apiver}.so.%{so_version}.*
%files devel
%{_includedir}/%{name}-%{apiver}
%{_libdir}/lib%{name}-%{apiver}.so
%{_libdir}/pkgconfig/%{name}-%{apiver}.pc
%{_libdir}/pkgconfig/%{name}-*-%{apiver}.pc
%{_libdir}/%{name}-%{apiver}
%{_includedir}/cairomm-%{apiver}
%{_libdir}/libcairomm-%{apiver}.so
%{_libdir}/pkgconfig/cairomm-%{apiver}.pc
%{_libdir}/pkgconfig/cairomm-*-%{apiver}.pc
%{_libdir}/cairomm-%{apiver}
%files doc
%license COPYING
%doc %{_datadir}/doc/%{name}-%{apiver}/
%doc %{_docdir}/cairomm-%{apiver}/
%doc %{_datadir}/devhelp/