File wayland-protocols.spec of Package wayland-protocols
%define realname wayland-protocols
%define realver 1.33
%define srcext tar.xz
%define so_ver 0
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: %{realver}
Release: %{?extraver:0.}1%{?dist}
License: MIT
Group: Development/Libraries/Other
URL: https://wayland.freedesktop.org/
Summary: Wayland protocol files
# Build-time parameters
BuildRequires: gcc-c++
BuildRequires: meson >= 0.53.0 ninja
BuildRequires: pkg-config
BuildRequires: pkgconfig(wayland-scanner)
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-root
Source: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/%{realver}%{?extraver}/downloads/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
wayland-protocols contains Wayland protocols that add functionality not
available in the Wayland core protocol. Such protocols either add
completely new functionality, or extend the functionality of some other
protocol either in Wayland core, or some other protocol in
wayland-protocols.
A protocol in wayland-protocols consists of a directory containing a set
of XML files containing the protocol specification, and a README file
containing detailed state and a list of maintainers.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%build
_CFLAGS='%{optflags}'
_LDFLAGS='-Wl,--strip-all -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro'
meson setup build \
--buildtype=release \
--optimization=2 \
--strip \
\
--prefix=%{_prefix} \
--default-library=shared \
\
-Dtests=false \
\
-Db_lto=true \
-Db_ndebug=if-release \
-Dc_args="$_CFLAGS" \
-Dcpp_args="$_CFLAGS" \
-Dc_link_args="$_LDFLAGS" \
-Dcpp_link_args="$_LDFLAGS"
ninja -v -C build %{?_smp_mflags}
%install
DESTDIR=%{buildroot} ninja -C build install
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%license COPYING
%doc GOVERNANCE.md MEMBERS.md README.md
%{_datadir}/pkgconfig/%{name}.pc
%{_datadir}/%{name}
%changelog