File wayland-utils.spec of Package wayland-utils
%define realname wayland-utils
%define realver 1.2.0
%define srcext tar.xz
%define wayland_ver 1.17.0
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: MIT
Group: System/X11/Servers/XF86_4
URL: https://wayland.freedesktop.org/
Summary: Wayland diagnostic utilities
# Build-time parameters
BuildRequires: meson >= 0.47.0
BuildRequires: ninja
BuildRequires: pkg-config
BuildRequires: pkgconfig(wayland-server) >= %{wayland_ver}
BuildRequires: pkgconfig(wayland-client) >= %{wayland_ver}
BuildRequires: pkgconfig(wayland-protocols) >= 1.18
BuildRequires: pkgconfig(libdrm)
BuildRoot: %{_tmppath}/%{name}-root
Source: https://gitlab.freedesktop.org/wayland/wayland-utils/-/releases/%{realver}%{?extraver}/downloads/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
Wayland diagnostic utilities:
- wayland-info is a utility for displaying information about the Wayland
protocols supported by a Wayland compositor
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
meson setup build \
--buildtype=release \
--strip \
\
--prefix=%{_prefix} \
--default-library=shared \
\
-Dc_args="$_CFLAGS" \
-Dc_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)
%doc COPYING README.md
%{_bindir}/*
%doc %{_mandir}/man1/*
%changelog