File libdecor.spec of Package libdecor
%define realname libdecor
%define srcext tar.bz2
%define so_ver 0
%define lib_suff -0
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}%{?lib_suff:%lib_suff-}%{?so_ver}
Version: 0
Release: %{?extraver:0.}1%{?dist}
License: MIT
Group: System/Libraries
URL: https://gitlab.gnome.org/jadahl/libdecor
Summary: A client-side decorations library for Wayland client
# Install-time parameters
Provides: %{realname} = %{version}-%{release}
# Build-time parameters
BuildRequires: meson >= 0.47.0 ninja
BuildRequires: pkg-config
BuildRequires: pkgconfig(wayland-client) >= 1.18
BuildRequires: pkgconfig(wayland-protocols) >= 1.15
BuildRequires: pkgconfig(dbus-1) >= 1.0
# src
BuildRequires: wayland-devel
# src/plugins/cairo
BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(pangocairo)
BuildRequires: pkgconfig(wayland-cursor)
BuildRoot: %{_tmppath}/%{name}-root
Source0: %{realname}-%{version}%{?extraver}.%{srcext}
%description
libdecor is a library that can help Wayland clients draw window decorations
for them. It aims to provide multiple backends that implements the
decoration drawing.
%package -n %{realname}-devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
Provides: %{name}-devel = %{version}-%{release}
%description -n %{realname}-devel
Development files for %{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 \
--strip \
\
--prefix=%{_prefix} \
--libexecdir=%{_libexecdir} \
--default-library=shared \
\
-Ddemo=false \
\
-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 LICENSE
%doc README.md
%{_libdir}/libdecor%{?lib_suff}.so.%{?so_ver}*
%{_libdir}/libdecor/
# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%{_libdir}/libdecor%{?lib_suff}.so
%{_libdir}/pkgconfig/libdecor%{?lib_suff}.pc
%{_includedir}/libdecor%{?lib_suff}/
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog