File wayland.spec of Package wayland
%define realname wayland
%define realver 1.22.0
%define srcext tar.xz
%define so_ver 0
%define egl_so_ver 1
# 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 Compositor Infrastructure
# Build-time parameters
BuildRequires: meson >= 0.47.0
BuildRequires: ninja
BuildRequires: python3
BuildRequires: gcc-c++
BuildRequires: pkg-config
BuildRequires: pkgconfig(libffi)
BuildRequires: %{?suse_version:lib}expat-devel
BuildRequires: pkgconfig(libxml-2.0)
# Docs
BuildRequires: doxygen >= 1.6.0
BuildRequires: libxslt%{?suse_version:-tools} libxml2%{?suse_version:-tools}
BuildRequires: xmlto
BuildRequires: graphviz >= 2.26.0 graphviz-gd
%if 0%{?suse_version}
BuildRequires: docbook-xsl-stylesheets docbook_4
BuildRequires: dejavu-fonts
%else
BuildRequires: docbook-style-xsl
BuildRequires: dejavu-sans-fonts
%endif
# SUSE-specific
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source: https://gitlab.freedesktop.org/wayland/wayland/-/releases/%{realver}/downloads/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
Wayland is a protocol for a compositor to talk to its clients as well as
a C library implementation of that protocol. The compositor can be a standalone
display server running on Linux kernel modesetting and evdev input devices,
an X application, or a wayland client itself. The clients can be traditional
applications, X servers (rootless or fullscreen) or other display servers.
%package -n libwayland-client%{?so_ver}
Group: System/Libraries
Summary: Wayland client side library
Provides: libwayland-client = %{version}-%{release}
Provides: libwayland-client%{_isa} = %{version}-%{release}
Obsoletes: libwayland-client < %{version}-%{release}
%description -n libwayland-client%{?so_ver}
The open-source reference implementation of Wayland protocol is split in two
C libraries, libwayland-client and libwayland-server. Their main responsibility
is to handle the Inter-process communication (IPC) with each other, therefore
guaranteeing the protocol objects marshaling and messages synchronization.
A client uses libwayland-client to communicate with one or more wayland servers.
%package -n libwayland-cursor%{?so_ver}
Group: System/Libraries
Summary: Wayland cursor helper library
Provides: libwayland-cursor = %{version}-%{release}
Provides: libwayland-cursor%{_isa} = %{version}-%{release}
Obsoletes: libwayland-cursor < %{version}-%{release}
%description -n libwayland-cursor%{?so_ver}
Wayland cursor helper library
%package -n libwayland-server%{?so_ver}
Group: System/Libraries
Summary: Server side implementation of the Wayland protocol
Provides: libwayland-server = %{version}-%{release}
Provides: libwayland-server%{_isa} = %{version}-%{release}
Obsoletes: libwayland-server < %{version}-%{release}
%description -n libwayland-server%{?so_ver}
The open-source reference implementation of Wayland protocol is split in two
C libraries, libwayland-client and libwayland-server. Their main responsibility
is to handle the Inter-process communication (IPC) with each other, therefore
guaranteeing the protocol objects marshaling and messages synchronization.
The server library is designed to work much like libwayland-client, although it
is considerably complicated due to the server needing to support multiple
versions of the protocol.
%package -n libwayland-egl%{?egl_so_ver}
Group: System/Libraries
Summary: Additional egl functions for wayland
Provides: libwayland-egl = %{version}-%{release}
Provides: libwayland-egl%{_isa} = %{version}-%{release}
Obsoletes: libwayland-egl < %{version}-%{release}
%description -n libwayland-egl%{?egl_so_ver}
This package provides additional functions for egl-using programs
that run within the wayland framework. This allows for applications
that need not run full-screen and cooperate with a compositor.
%package devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: libwayland-client%{?so_ver} = %{version}-%{release}
Requires: libwayland-cursor%{?so_ver} = %{version}-%{release}
Requires: libwayland-server%{?so_ver} = %{version}-%{release}
Requires: libwayland-egl%{?egl_so_ver} = %{version}-%{release}
Provides: libwayland-devel = %{version}-%{release}
Provides: libwayland-client-devel = %{version}-%{release}
Provides: libwayland-cursor-devel = %{version}-%{release}
Provides: libwayland-server-devel = %{version}-%{release}
Provides: libwayland-egl-devel = 1:%{version}-%{release}
%description devel
Development files for %{name}
%package doc
Group: Documentation/HTML
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
Documentation for %{name}
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
# Disable tests
%{__sed} -i '/^\s*subdir.*tests/d' meson.build
# Fix HTML data directory
%{__sed} -i \
-e "/^publican_install_prefix/,/^publican_html_dir/ d" \
-e "/^subdir.*doxygen/ i publican_install_prefix = '%{_datadir}/doc/HTML/en'" \
-e "/^subdir.*doxygen/ i publican_html_dir = 'wayland'" \
doc/meson.build
%build
_CFLAGS='%{optflags}'
_LDFLAGS='-Wl,--strip-all -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro'
meson setup build \
--buildtype=release \
--strip \
--optimization=2 \
\
--prefix=%{_prefix} \
--libexecdir=%{_libexecdir} \
--default-library=shared \
\
-Dtests=false \
%if 0%{?rhel} == 7
-Ddocumentation=false \
%endif
\
-Db_lto=%{?gcc_lto:true}%{!?gcc_lto:false} \
-Db_ndebug=if-release \
-Dc_args="$_CFLAGS" \
-Dc_link_args="$_LDFLAGS"
ninja -v -C build %{?_smp_mflags}
%install
DESTDIR=%{buildroot} ninja -C build install
%if 0%{?suse_version}
%fdupes %{buildroot}%{_mandir}/man3/
%endif
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files -n libwayland-client%{?so_ver}
%defattr(-,root,root)
%license COPYING
%doc README.md
%{_libdir}/libwayland-client.so.%{?so_ver}*
%files -n libwayland-cursor%{?so_ver}
%defattr(-,root,root)
%license COPYING
%doc README.md
%{_libdir}/libwayland-cursor.so.%{?so_ver}*
%files -n libwayland-server%{?so_ver}
%defattr(-,root,root)
%license COPYING
%doc README.md
%{_libdir}/libwayland-server.so.%{?so_ver}*
%files -n libwayland-egl%{?egl_so_ver}
%defattr(-,root,root)
%license COPYING
%doc README.md
%{_libdir}/libwayland-egl.so.%{?egl_so_ver}*
# Development stuff
%files devel
%defattr(-,root,root)
%license COPYING
%doc CONTRIBUTING.md README.md
%{_bindir}/wayland-scanner
%{_libdir}/pkgconfig/*.pc
%{_includedir}/%{name}-*.h
%{_libdir}/*.so
%dir %{_datadir}/aclocal
%{_datadir}/aclocal/wayland-scanner.m4
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%if ! 0%{?rhel}
%exclude %{_libdir}/*.la
%endif
%if 0%{?rhel} != 7
%doc %{_mandir}/man3/*
%endif
# Documentation
%if 0%{?rhel} != 7
%files doc
%defattr(-,root,root)
%dir %{_datadir}/doc/HTML/en/wayland
%dir %{_datadir}/doc/HTML/en
%dir %{_datadir}/doc/HTML
%docdir %{_datadir}/doc/HTML/en/wayland/
%doc %{_datadir}/doc/HTML/en/wayland/*
%exclude %{_datadir}/doc/HTML/en/wayland/Wayland.proc
%endif
%post -n libwayland-client%{?so_ver} -p /sbin/ldconfig
%postun -n libwayland-client%{?so_ver} -p /sbin/ldconfig
%post -n libwayland-cursor%{?so_ver} -p /sbin/ldconfig
%postun -n libwayland-cursor%{?so_ver} -p /sbin/ldconfig
%post -n libwayland-server%{?so_ver} -p /sbin/ldconfig
%postun -n libwayland-server%{?so_ver} -p /sbin/ldconfig
%post -n libwayland-egl%{?egl_so_ver} -p /sbin/ldconfig
%postun -n libwayland-egl%{?egl_so_ver} -p /sbin/ldconfig
%changelog