File egl-wayland.spec of Package egl-wayland

%define realname egl-wayland
%define realver  1.1.2
%define srcext   tar.gz

%define so_ver   1

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          libnvidia-egl-wayland%{so_ver}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?dist}
License:       MIT
Group:         Development/Libraries/Other
URL:           https://github.com/NVIDIA/egl-wayland
Summary:       The EGLStream-based Wayland external platform

# Install-time parameters
Provides:      %{realname} = %{version}-%{release}
Obsoletes:     %{realname} < %{version}-%{release}
Provides:      libnvidia-egl-wayland = %{version}-%{release}
Obsoletes:     libnvidia-egl-wayland < %{version}-%{release}

# Build-time parameters
BuildRequires: gcc-c++
BuildRequires: meson >= 0.50 ninja
BuildRequires: pkg-config
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(eglexternalplatform) >= 1.1
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-scanner)
BuildRequires: pkgconfig(wayland-egl-backend) >= 3
BuildRequires: pkgconfig(x11)
BuildRequires: libdrm-devel
BuildRoot:     %{_tmppath}/%{name}-root
Source:        https://codeload.github.com/NVIDIA/egl-wayland/%{srcext}/refs/tags/%{realver}#/%{realname}-%{version}%{?extraver}.%{srcext}

%description
This is an implementation of a EGL External Platform library to add client-side
Wayland support to EGL on top of EGLDevice and EGLStream families of extensions.

This library implements an EGL External Platform interface to work along with
EGL drivers that support the external platform mechanism.

%package -n libnvidia-egl-wayland-devel
Group:         Development/Languages/C and C++
Summary:       Development package for %{name}

Requires:      %{name} = %{version}-%{release}
Provides:      %{name}-devel = %{version}-%{release}
Obsoletes:     %{name}-devel < %{version}-%{release}
Provides:      %{realname}-devel = %{version}-%{release}
Obsoletes:     %{realname}-devel < %{version}-%{release}

%description -n libnvidia-egl-wayland-devel
This is an implementation of a EGL External Platform library to add client-side
Wayland support to EGL on top of EGLDevice and EGLStream families of extensions.

This library implements an EGL External Platform interface to work along with
EGL drivers that support the external platform mechanism.

This package provides headers and libraries required to build software
using %{name}.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?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} \
 --libdir=%{_libdir} \
 --default-library=shared \
 \
 -Db_lto=true \
 -Db_ndebug=if-release \
 -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)
%license COPYING
%doc README.md
%{_libdir}/libnvidia-egl-wayland.so.%{so_ver}*
%{_datadir}/wayland-eglstream/

%files -n libnvidia-egl-wayland-devel
%defattr(-,root,root)
%license COPYING
%doc README.md
%{_libdir}/libnvidia-egl-wayland.so
%{_datadir}/pkgconfig/*.pc

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
openSUSE Build Service is sponsored by